2 Months of Flutter Development
Tags: flutter, mobile, dart, android
Published: 2019-03-23 05:53:15

---
title: 2 Months of Flutter Development
published: true
description: 
tags: flutter, mobile, dart, android
---

I started writing some posts on Flutter development back in January, but quickly gave up because writing sucks up a lot of screen time and I like to use that time for other things.  I spend enough time sitting on my ass programming already.

One article a month sounds much more achievable.

## The Good

My experience with mobile development is limited to Android dev.  

If you are going to start mobile dev, I would recommend just going straight to Flutter.  It's faster to pick up than Android development (I've never picked done any iOS dev).  And it't more stable than any other cross platform solution. And the dart package manager is has a lot of high quality packages ready to use.

I can safely say this is the future of mobile development.  And since Google is backing it, it might actually be the primary form of Android development in the future.

## The Bad

It's the worst of NPM. And you can't even upgrade a package if it has conflicting dependancies with another one of your packages. (This will be really fun once packages stop getting maintained).

It feels exactly like programming Javascript because Dart also runs on a single-threaded, asynchronous, event loop.  But there's also a much heavier class system so it feels like coding Java as well. I got lucky and was able to pick up quickly because I've worked extensively with both those languages, but a green programmer might have some trouble with the learning curve.  And since Dart is a newer language, finding solutions to problems requires a mastery of google-fu. (expect to learn a lot about darts the pub game as well)

It's the WORST of PHP. With Flutter you can put all your UI code and business code in the same file.  Reading through someone else'e Flutter code feels like digging through PHP projects before frameworks got popular.


## The Spaghetti

In Flutter, the entire UI is written in code.  You make new UI elements by writing something like

```
Column(children:[
  Text('Your First Paragraph'),
  Row(children:[
     // You Get The Point
  ])
])
```

There's a lot to be said about the pros and cons of this.  It is easy to work with, but feels less flexible when compared to CSS/HTML.  And there are some rough edges dealing with images.  But the biggest side effect of the 'your UI is code' design philosophy is the spaghetti it makes.

If you have ever worked on PHP, you probably know about how easy it is to make spaghetti by combining UI and code.  If you have not worked on PHP, the idea is you can embed PHP directly into HTML files.  If done correctly, this makes for a powerful templating language.  When left to an amateur, this leads to 10,000 lined html files that are a bastardization of business logic and UI code.

[My first Flutter app](https://mstream.io/software) has already hit the point of hard to read.  I need to spend some time to clean it up and break it into logical chunks.  Right now most of the UI is broken into a handful of 100+ line classes.  And those classes are embedded with event handling code that does a lot of business type logic.  And to top it off I got a little too liberal with global variables.