News for hackers. Stuff that matters.
Re:Exploring Flutter for Cross-Platform Mobile Development by svdev on Sunday May 28, 2017 @02:34AM (#14433353)
I had high hopes for flutter but gave up after a while. It feels like their design meetings were spent arguing about grammar and splitting hairs, rather than thinking about ergonomics and how people would use it.

In Flutter, everything is a nested pile of objects with too many APIs to keep track of. Take this example: https://github.com/flutter/flutter/blob/master/examples/stoc...

Why do I need to care if something takes a `child: (single object)` argument or a `children: [LIST of objects]`?

Flutter would be better with JSX: JSX hides how the puzzle pieces fit together. I don't care if it takes a child or children; just make everything connect the same way.

React Native's Flexbox also beats how Flutter did things. Why do I need to memorize which objects take which styling arguments? You want to center items on the screen? Re-nest everything inside a Center object! You want a column or a row of elements? Use a Column/Row object!

For a framework that's trying to bill itself as a great tool for prototyping, it feels like I'm sifting through a mountain of minutiae. I was able to guess my way through a React Native app and be right 99% of the time. With flutter, my luckiest guess would lead me to an abstract base class... Then I'd have to dig around to figure out what the hell I need to use to make a view scrollable. Seriously:

https://github.com/flutter/flutter/blob/c6b0f833af9e431df1e6...

Why?

Re:Exploring Flutter for Cross-Platform Mobile Development by tomatsu on Sunday May 28, 2017 @06:37AM (#14433829)
> Why do I need to care if something takes a `child: (single object)` argument or a `children: [LIST of objects]`?

The IDE tells you what's needed and the latest version of the plugin automatically adds a list literal and places the cursor inside it:

https://groups.google.com/forum/#!topic/flutter-dev/LXafJQqS...

Personally, I think it makes sense to differentiate between exactly one and zero or more.

> Why do I need to memorize which objects take which styling arguments?

The IDE should do that for you.

Re:Exploring Flutter for Cross-Platform Mobile Development by mmjaa on Monday May 29, 2017 @08:12AM (#14438706)
>The IDE should do that for you.

Fail. IDE dependence is an anti-pattern and a programmer-smell.

Re:Exploring Flutter for Cross-Platform Mobile Development by tomatsu on Wednesday May 31, 2017 @01:48PM (#14454469)
Either the IDE/editor is able to assist you or you have to consult the documentation regularly.

That's just how it is.

JS' standard library, for example, is really tiny but I haven't memorized all of it. If the editor can't clue me in, I have to check the docs.

Re:Exploring Flutter for Cross-Platform Mobile Development by mmjaa on Thursday June 01, 2017 @04:57AM (#14458849)
Nothing wrong with doing any of it, as long as its a dependency you can manage while also maintaining productivity... but such is the life of a Javascript developer.
Re:Exploring Flutter for Cross-Platform Mobile Development by gman83 on Sunday May 28, 2017 @04:56AM (#14433601)
I mean, if you're using IntelliJ or Visual Studio Code it automatically completes which argument something takes, it's hardly like you need to go around digging for that stuff. Personally, I think it makes sense to differentiate between something which takes one child and something which takes an array of children.
Re:Exploring Flutter for Cross-Platform Mobile Development by johnfn on Sunday May 28, 2017 @05:12AM (#14433640)
> Personally, I think it makes sense to differentiate between something which takes one child and something which takes an array of children.

Could you please explain this - it doesn't make sense to me.

To me it seems clearly and unambiguously true that a single child is not a special case vs multiple children, but rather just a list of children that is 1 long. I can't think of any cases where handling both as an array would possibly have you write worse code.

Re:Exploring Flutter for Cross-Platform Mobile Development by gman83 on Sunday May 28, 2017 @05:22AM (#14433672)
Take the Container class in Flutter, it can only take a single Widget as a child. Having to write a list of children that is 1 long every time I use a container doesn't make sense to me, and to me seems confusing as it will lead to people trying to add more items. I don't know, that's my opinion, maybe I'm wrong :)
Re:Exploring Flutter for Cross-Platform Mobile Development by johnfn on Sunday May 28, 2017 @05:35AM (#14433694)
Hmm, perhaps it's me not understanding the flutter paradigm, but if something only accepted a single child, I would stop calling it a child and start calling it a more precise name. Like perhaps contents in the case of a container?
Re:Exploring Flutter for Cross-Platform Mobile Development by sureshv on Sunday May 28, 2017 @11:43AM (#14434789)
Sounds like they took that from Android where IIRC a scrollview could only take one child. Coming from Win32 Android, back in the G1 days, always had its own idiosyncrasies.
Re:Exploring Flutter for Cross-Platform Mobile Development by blikdak on Sunday May 28, 2017 @07:11AM (#14433911)
That's the first thing I thought too re JSX or something like that, it looks like they are trying to shoehorn Java and full OO into what is basically React, replacing JSX and json with a huge pile of different classes. Over-engineering and obfuscating in much the way GWT did back in the day. The web is the web, there is only the DOM guys, deal with it and move on.
Re:Exploring Flutter for Cross-Platform Mobile Development by tomatsu on Sunday May 28, 2017 @07:30AM (#14433969)
> The web is the web, there is only the DOM guys, deal with it and move on.

Flutter doesn't use a WebView. There is no DOM.

That's why it's fast.