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.
[ Parent
| on HN ]
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?