Re:Announcing Dart 2 Stable and the Dart Web Platform
by nailer on Tuesday August 07, 2018 @05:25PM
(#17710968)
I removed everything that seems redundant. Less syntax means less to break, and less for new programmers (who are 10x the volume of existing programmers) to learn:
[ Parent
| on HN ]
Re:Announcing Dart 2 Stable and the Dart Web Platform
by aoeusnth1 on Tuesday August 07, 2018 @05:52PM
(#17711187)
how are the semicolons in a for loop redundant? Without them it's extremely difficult to parse what's going on.
Re:Announcing Dart 2 Stable and the Dart Web Platform
by nailer on Tuesday August 07, 2018 @06:23PM
(#17711427)
Typo when removing the others. Thanks for the spot. Maybe a forEach or map might be more appropriate for all those future programmers anyway though.
Re:Announcing Dart 2 Stable and the Dart Web Platform
by emmelaich on Tuesday August 07, 2018 @08:19PM
(#17712156)
While you're there, you may as well indent everything after the "while(true)"
Re:Announcing Dart 2 Stable and the Dart Web Platform
by nailer on Wednesday August 08, 2018 @07:07AM
(#17714828)
Oops, I killed that during one of the edits.
Re:Announcing Dart 2 Stable and the Dart Web Platform
by laxd on Tuesday August 07, 2018 @06:11PM
(#17711340)
Separating variable declaration and reassignment at a glance makes code more clear. Indenting loop bodys makes code more clear, and the curly braces won't suddenly break. Keeping lines short makes it nicer to work with in various editor setups.
Re:Announcing Dart 2 Stable and the Dart Web Platform
by nailer on Tuesday August 07, 2018 @06:23PM
(#17711424)
> Separating variable declaration and reassignment at a glance makes code more clear.
Hrm, maybe. Python does well not using them - if you reassign something, it's being reassigned. Maybe, since declaration is more common, make declaration the default and reassignment explicit?
> Indenting loop bodys makes code more clear
Glad you agree.
> curly braces won't suddenly break
They do all the time, everytime indentation (how people read coe) gets out of sync with braces. Hence avoiding redundancy.
> Keeping lines short makes it nicer to work with in various editor setups.
Displaying code to match the screen is the editors job. Sometimes your screen is 30 characters, sometimes it's a lot more.