5 ms·
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 th
by svdev 9y ago
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/stocks/lib/stock_row.dart#L41-L56 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/c6b0f833af9e431df1e67f15e8b51a76e8bc7d71/packages/flutter/lib/src/widgets/scroll_view.dart#L42 https://github.com/flutter/flutter/blob/c6b0f833af9e431df1e6...
Why?
- gman83 9y agoI 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.
- johnfn 9y ago> 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.
- gman83 9y agoTake 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 :)
- johnfn 9y agoHmm, 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?
- sureshv 9y agoSounds 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.
- tomatsu 9y ago> 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/LXafJQqSK4M 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.
- deleted 9y ago[deleted]
- mmjaa 9y ago>The IDE should do that for you. Fail. IDE dependence is an anti-pattern and a programmer-smell.
- tomatsu 9y agoEither 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.
- mmjaa 9y agoNothing 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.
- blikdak 9y agoThat'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.
- tomatsu 9y ago> 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.