Discussion:
[dart-misc] Re: Optional end of line semi-colons
KDawg
2018-02-26 00:56:42 UTC
Permalink
Lack of an end-of-statement terminator is a horrible idea. Case in point,
consider Kotlin:

var x = 1 + 1 + 1
println(x)

results in 3, whereas

var x = 1 + 1
+ 1
println(x)

results in 2.

the lack of an end-of-statement terminator creates ambiguous code. Making
them optional only makes the situation worse.
This has been brought up a few times so I thought it would be a good idea
to have this written down somewhere so we can measure demand for it.
http://code.google.com/p/dart/issues/detail?id=4461
Mandatory semi colons just adds un-necessary line-noise making the code
uglier and less fun.
It would be nice if Dart followed all the modern C-like languages i.e.
Scala, Go, Kotlin and not require end-of-line semi colons.
It's actually rare to require them considering most functional,
scheme-like, scripting & dynamic langs avoid them as well. I understand
Dart is meant to appeal to C# / Java devs, but they would still be able to
optionally add end of lines semi-colon if it makes them more comfortable -
whilst the rest of us can write prettier code :)
Normally I wouldn't suggest this, but since even modern C-like languages
are able to get by without them, I don't expect them to be too disruptive
to implement.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
r***@gmail.com
2018-02-26 15:15:29 UTC
Permalink
Uhh...that's not really ambiguous if you know that new lines are
terminators. It's just getting used to it.


--
Ryan (ラむアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone
elsehttps://refi64.com/

On Feb 26, 2018 at 7:18 AM, <KDawg <***@gmail.com>> wrote:

Lack of an end-of-statement terminator is a horrible idea. Case in point,
consider Kotlin:

var x = 1 + 1 + 1
println(x)

results in 3, whereas

var x = 1 + 1
+ 1
println(x)

results in 2.

the lack of an end-of-statement terminator creates ambiguous code. Making
them optional only makes the situation worse.
This has been brought up a few times so I thought it would be a good idea
to have this written down somewhere so we can measure demand for it.
http://code.google.com/p/dart/issues/detail?id=4461
Mandatory semi colons just adds un-necessary line-noise making the code
uglier and less fun.
It would be nice if Dart followed all the modern C-like languages i.e.
Scala, Go, Kotlin and not require end-of-line semi colons.
It's actually rare to require them considering most functional,
scheme-like, scripting & dynamic langs avoid them as well. I understand
Dart is meant to appeal to C# / Java devs, but they would still be able to
optionally add end of lines semi-colon if it makes them more comfortable -
whilst the rest of us can write prettier code :)
Normally I wouldn't suggest this, but since even modern C-like languages
are able to get by without them, I don't expect them to be too disruptive
to implement.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to misc+***@dartlang.org.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Istvan Soos
2018-02-26 15:34:11 UTC
Permalink
Post by r***@gmail.com
Uhh...that's not really ambiguous if you know that new lines are
terminators. It's just getting used to it.
This is a religious topic, but we may have a place for a personal anecdote.

I've spent about 6 months working on a CoffeeScript codebase. I made
at least two line-ending mistakes over that time, which slipped though
the review and reached production. Not fun. It makes everyone's life
miserable to think about it, and it is much easier to typing that
extra `;` character (and overall saves time). I'd favor explicit over
implicit any time, because it served me over the years.

Cheers,
Istvan
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
tatumizer-v0.2
2018-02-26 15:48:19 UTC
Permalink
Maybe comma can be made optional as a separator of name-value pairs - both
in constructors (for named parameters) and map literals.
This won't be as bug-prone IMO. And it can help to un-clutter object
literals in flutter. Not sure it's a good idea though.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Istvan Soos
2018-02-26 15:53:18 UTC
Permalink
'We' ' do ' 'have' ' adjacent string literals:' 'Let\'s spot the error'.
Post by tatumizer-v0.2
Maybe comma can be made optional as a separator of name-value pairs - both
in constructors (for named parameters) and map literals.
This won't be as bug-prone IMO. And it can help to un-clutter object
literals in flutter. Not sure it's a good idea though.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Ryan Gonzalez
2018-02-26 16:06:41 UTC
Permalink
CoffeeScript is definitely more on the extreme end of "free syntax"
than most similar languages, though. In addition, in languages like
Dart that have things like status analysis, the analyzer could warn
with unused expressions.

FWIW I've also managed to make the same mistake in C++ when I try to
refactor something and split expressions incorrectly, but the compiler
will always warn you.

So stuff like this wouldn't be a problem:

var x = 1
+ 1 // warning: unused expression
Post by Istvan Soos
Post by r***@gmail.com
Uhh...that's not really ambiguous if you know that new lines are
terminators. It's just getting used to it.
This is a religious topic, but we may have a place for a personal anecdote.
I've spent about 6 months working on a CoffeeScript codebase. I made
at least two line-ending mistakes over that time, which slipped though
the review and reached production. Not fun. It makes everyone's life
miserable to think about it, and it is much easier to typing that
extra `;` character (and overall saves time). I'd favor explicit over
implicit any time, because it served me over the years.
Cheers,
Istvan
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
--
Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
tatumizer-v0.2
2018-02-26 16:53:02 UTC
Permalink
Post by Istvan Soos
'We' ' do ' 'have' ' adjacent string literals:' 'Let\'s spot the error'.
This must be rare. But you WILL spot the error easily in IDE b/c
highlighting. And in case of named parameters, this counterexample doesn't
apply.
The issue is more like - to what extent this feature can help, even if
implemented.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Rob Becker
2018-02-26 16:53:02 UTC
Permalink
Hard pass on optional semicolons. Just no. One of the things that I love
about Dart is that it is opinionated and has an awesome style guide and
formatter. I don't want to go back to nitpicks on code reviews about
whether you should or shouldn't use semi-colons (or tabs, or braces, or
etc...)
This has been brought up a few times so I thought it would be a good idea
to have this written down somewhere so we can measure demand for it.
http://code.google.com/p/dart/issues/detail?id=4461
Mandatory semi colons just adds un-necessary line-noise making the code
uglier and less fun.
It would be nice if Dart followed all the modern C-like languages i.e.
Scala, Go, Kotlin and not require end-of-line semi colons.
It's actually rare to require them considering most functional,
scheme-like, scripting & dynamic langs avoid them as well. I understand
Dart is meant to appeal to C# / Java devs, but they would still be able to
optionally add end of lines semi-colon if it makes them more comfortable -
whilst the rest of us can write prettier code :)
Normally I wouldn't suggest this, but since even modern C-like languages
are able to get by without them, I don't expect them to be too disruptive
to implement.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Bob Nystrom' via Dart Misc
2018-02-26 18:48:40 UTC
Permalink
Post by Rob Becker
Hard pass on optional semicolons. Just no. One of the things that I love
about Dart is that it is opinionated and has an awesome style guide and
formatter. I don't want to go back to nitpicks on code reviews about
whether you should or shouldn't use semi-colons (or tabs, or braces, or
etc...)
If we were to move to optional semicolons like Go did, we would be just as
strongly opinionated as we are today and push for an ecosystem where no one
uses semicolons, and dartfmt gracefully formats your code without them.

This is exactly how the ecosystems for Python, Ruby, Go, Swift, Scala,
Kotlin, and others work. In all of those languages, semicolons are allowed
but optional, and you almost never see them in the wild.

(I'm not mentioning JS in that list because the specific semantics JS chose
for semicolon insertion are so broken that it effectively kills the
feature. I'd quit my job at Google before I shipped a semantics that bad
for Dart.)

Cheers!

– bob
Post by Rob Becker
This has been brought up a few times so I thought it would be a good idea
to have this written down somewhere so we can measure demand for it.
http://code.google.com/p/dart/issues/detail?id=4461
Mandatory semi colons just adds un-necessary line-noise making the code
uglier and less fun.
It would be nice if Dart followed all the modern C-like languages i.e.
Scala, Go, Kotlin and not require end-of-line semi colons.
It's actually rare to require them considering most functional,
scheme-like, scripting & dynamic langs avoid them as well. I understand
Dart is meant to appeal to C# / Java devs, but they would still be able to
optionally add end of lines semi-colon if it makes them more comfortable -
whilst the rest of us can write prettier code :)
Normally I wouldn't suggest this, but since even modern C-like languages
are able to get by without them, I don't expect them to be too disruptive
to implement.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Randal L. Schwartz
2018-02-26 19:34:35 UTC
Permalink
Bob> (I'm not mentioning JS in that list because the specific semantics
Bob> JS chose for semicolon insertion are so broken that it effectively
Bob> kills the feature. I'd quit my job at Google before I shipped a
Bob> semantics that bad for Dart.)

And for which Brendan Eich has publicly apologized. :)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<***@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/Dart consulting, Technical writing, Comedy, etc. etc.
Still trying to think of something clever for the fourth line of this .sig
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Faried Nawaz
2018-02-26 14:05:58 UTC
Permalink
Post by KDawg
Lack of an end-of-statement terminator is a horrible idea. Case in point,
var x = 1 + 1 + 1
println(x)
results in 3, whereas
var x = 1 + 1
+ 1
println(x)
results in 2.
I think that's just bad style. This parses properly, in Kotlin, JS,
Ruby, and Go:

var x = 1 + 1 +
1
println(x)

It's not a lot of work to encode the rules for where semi-colons are
automatically inserted, or where they're needed. Go, for example, has
just two rules; see https://golang.org/ref/spec#Semicolons


Faried.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Bob Nystrom' via Dart Misc
2018-02-26 20:29:07 UTC
Permalink
Post by Faried Nawaz
Post by KDawg
Lack of an end-of-statement terminator is a horrible idea. Case in point,
var x = 1 + 1 + 1
println(x)
results in 3, whereas
var x = 1 + 1
+ 1
println(x)
results in 2.
I think that's just bad style. This parses properly, in Kotlin, JS,
var x = 1 + 1 +
1
println(x)
And, in particular, if you run dartfmt on the code, it will put the "+" at
the end of the previous line.

Of course, any optional semicolon behavior we define needs to gracefully
handle code that has not been formatted yet too (if for no other reason
than to be a well-defined input to dartfmt), but our style guide and
formatter already set up your newlines in a way that's quite friendly to
significant newlines.

Cheers!

– bob
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Adrian Mercieca
2018-02-27 04:24:29 UTC
Permalink
100% pro mandatory semi-colon.
Code is clearer, more well defined/structured with semi-colon.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Tobe Osakwe
2018-02-27 04:24:59 UTC
Permalink
I agree with Adrian.
Post by Adrian Mercieca
100% pro mandatory semi-colon.
Code is clearer, more well defined/structured with semi-colon.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Kasper Peulen
2018-02-27 14:31:36 UTC
Permalink
There may be a way to make everybody happy here.

Remove all semicolons, and have an option to see them in the editor
(without them being really there).

I picture this similarly as how Flutter shows the end of a Widget by a
comment that is not really there.

That being said, semicolons are just noise, they decrease readability,
liking them is like a bad habit. In the beginning you crave it, but after a
while life is actually easier when you quit.

Met vriendelijke groet, Kasper Peulen
Post by Tobe Osakwe
I agree with Adrian.
Post by Adrian Mercieca
100% pro mandatory semi-colon.
Code is clearer, more well defined/structured with semi-colon.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to
http://www.dartbug.com/new
Post by Adrian Mercieca
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
Post by Adrian Mercieca
To unsubscribe from this group and stop receiving emails from it, send
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Danny Tuppeny
2018-02-27 14:38:35 UTC
Permalink
If only everyone was as enthusiastic about removing nulls as removing
semicolons! 😁

The idea of removing semicolons feels kinda weird to me, but I do wish
there was less noise in my code so I reckon I'd get to used to it.
Presumably the next step is removing braces and being whitespace-sensitive?
No? :(
Post by Kasper Peulen
There may be a way to make everybody happy here.
Remove all semicolons, and have an option to see them in the editor
(without them being really there).
I picture this similarly as how Flutter shows the end of a Widget by a
comment that is not really there.
That being said, semicolons are just noise, they decrease readability,
liking them is like a bad habit. In the beginning you crave it, but after a
while life is actually easier when you quit.
Met vriendelijke groet, Kasper Peulen
Post by Tobe Osakwe
I agree with Adrian.
Post by Adrian Mercieca
100% pro mandatory semi-colon.
Code is clearer, more well defined/structured with semi-colon.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to
http://www.dartbug.com/new
Post by Adrian Mercieca
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
Post by Adrian Mercieca
To unsubscribe from this group and stop receiving emails from it, send
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Filipe Morgado
2018-02-27 15:18:32 UTC
Permalink
Post by Danny Tuppeny
If only everyone was as enthusiastic about removing nulls as removing
semicolons! 😁
THIS!!!

I favor optional semi-colons, although it would seem very weird at first.
But in the end, it's pretty insignificant, IMO.
It's mostly relevant to new-comers. They will either love it or hate it,
depending on their background, but it all comes down to habits.

I'd rather see new features that are actually useful.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Randal L. Schwartz
2018-02-27 17:29:33 UTC
Permalink
Danny> The idea of removing semicolons feels kinda weird to me, but I do
Danny> wish there was less noise in my code so I reckon I'd get to used
Danny> to it. Presumably the next step is removing braces and being
Danny> whitespace-sensitive? No? :(

And then the "spaces vs tabs" battle will begin. :)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<***@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/Dart consulting, Technical writing, Comedy, etc. etc.
Still trying to think of something clever for the fourth line of this .sig
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Bob Nystrom' via Dart Misc
2018-02-27 17:38:24 UTC
Permalink
Post by Danny Tuppeny
If only everyone was as enthusiastic about removing nulls as removing
semicolons! 😁
I think most people are *more* enthusiastic about removing nulls. :) But
it's also a *much* more complex feature to ship.
Post by Danny Tuppeny
Presumably the next step is removing braces and being
whitespace-sensitive? No? :(
No, definitely not. I could write an essay about this but the short summary
is that significant indentation works OK for Python but pushes you towards
a statement-oriented mindset. This is why, for example, lambdas can only
contain a single expression, not statements in Python. You *can* do
significant indentation in an expression-oriented language — Haskell does —
but it's weird and quirky.

Dart is not at all as statement-focused as Python. Idiomatic Dart code
often contains lambdas (expressions) containing block bodies (statements)
containing other lambdas (expressions) containing block bodies
(statements). That kind of interleaving gets mega-weird if you try to use
indentation for blocks.

Curly brace blocks work really well, I think. It's useful to have an
explicit terminator for a region of code and "}" does that.

Cheers!

– bob
Post by Danny Tuppeny
Post by Kasper Peulen
There may be a way to make everybody happy here.
Remove all semicolons, and have an option to see them in the editor
(without them being really there).
I picture this similarly as how Flutter shows the end of a Widget by a
comment that is not really there.
That being said, semicolons are just noise, they decrease readability,
liking them is like a bad habit. In the beginning you crave it, but after a
while life is actually easier when you quit.
Met vriendelijke groet, Kasper Peulen
Post by Tobe Osakwe
I agree with Adrian.
Post by Adrian Mercieca
100% pro mandatory semi-colon.
Code is clearer, more well defined/structured with semi-colon.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to
http://www.dartbug.com/new
Post by Adrian Mercieca
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
Post by Adrian Mercieca
To unsubscribe from this group and stop receiving emails from it, send
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to
http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Randal L. Schwartz
2018-02-27 18:00:42 UTC
Permalink
Bob> Curly brace blocks work really well, I think. It's useful to have an
Bob> explicit terminator for a region of code and "}" does that.

I like it because a text editor can easily go "out block" or "end of
block" or "beginning of block". It's why I always do my Perl regex as
m{foo}... because my editor is happy at that.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<***@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/Dart consulting, Technical writing, Comedy, etc. etc.
Still trying to think of something clever for the fourth line of this .sig
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Danny Tuppeny
2018-02-27 18:32:13 UTC
Permalink
Post by Danny Tuppeny
If only everyone was as enthusiastic about removing nulls as removing
Post by Danny Tuppeny
semicolons! 😁
I think most people are *more* enthusiastic about removing nulls. :) But
it's also a *much* more complex feature to ship.
Yeah, it wasn't a moan that it's not here yet (for once!) but I've often
been in discussions where devs didn't understand the benefits of removing
null ("we have null-aware operators, just use them, k?") and it makes me
kinda sad (I guess I'm kinda at conveying them)!
Post by Danny Tuppeny
Presumably the next step is removing braces and being
Post by Danny Tuppeny
whitespace-sensitive? No? :(
No, definitely not. I could write an essay about this but the short
summary is that significant indentation works OK for Python but pushes you
towards a statement-oriented mindset. This is why, for example, lambdas can
only contain a single expression, not statements in Python. You *can* do
significant indentation in an expression-oriented language — Haskell does —
but it's weird and quirky.
Dart is not at all as statement-focused as Python. Idiomatic Dart code
often contains lambdas (expressions) containing block bodies (statements)
containing other lambdas (expressions) containing block bodies
(statements). That kind of interleaving gets mega-weird if you try to use
indentation for blocks.
Curly brace blocks work really well, I think. It's useful to have an
explicit terminator for a region of code and "}" does that.
Heh, my comment was meant as a joke, but I appreciate the extra info :-)
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Erik Ernst' via Dart Misc
2018-02-27 16:20:43 UTC
Permalink
Post by Kasper Peulen
There may be a way to make everybody happy here.
Remove all semicolons, and have an option to see them in the editor
(without them being really there).
I picture this similarly as how Flutter shows the end of a Widget by a
comment that is not really there.
That being said, semicolons are just noise, they decrease readability,
liking them is like a bad habit. In the beginning you crave it, but after a
while life is actually easier when you quit.
Here's one perspective which is rarely mentioned: `class A {}` is easy to
parse because `class` is a reserved word, but when a class body contains a
declaration like `set get(get) => set = 2 * get.get
<https://github.com/dart-lang/sdk/blob/73eb8a37e00bc1f0be7885ce7c347df557ca32f2/tests/language_2/built_in_identifier_test.dart#L83>`
then there's a need for more disambiguation, simply because a token like
`get` can be a "keyword" that indicates "this declaration is a getter" and
it can also be a name (here: the name of a setter, and the name of a formal
parameter, and the name of a member of the actual argument).

The point is that if we make semicolons optional then the amount of
ambiguity in the syntax of the language goes up, and then we need to be
more conservative in the creation of new syntactic constructs (in order to
be able to parse Dart programs at all).

Basically, *the syntactic language design space gets smaller every time we
make the language more ambiguous*.

Met vriendelijke groet, Kasper Peulen
Post by Kasper Peulen
Post by Tobe Osakwe
I agree with Adrian.
Post by Adrian Mercieca
100% pro mandatory semi-colon.
Code is clearer, more well defined/structured with semi-colon.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to
http://www.dartbug.com/new
Post by Adrian Mercieca
---
You received this message because you are subscribed to the Google
Groups "Dart Misc" group.
Post by Adrian Mercieca
To unsubscribe from this group and stop receiving emails from it, send
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
Erik Ernst - Google Danmark ApS
Skt Petri Passage 5, 2 sal, 1165 KÞbenhavn K, Denmark
CVR no. 28866984
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Tom M
2018-02-27 22:48:31 UTC
Permalink
Dart gets semicolon insertion and Go uses pub.
Post by Kasper Peulen
There may be a way to make everybody happy here.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Jan Mostert
2018-08-21 18:27:48 UTC
Permalink
Death to null :-D
Kotlin and Ceylon's null works lovely, just mark stuff as Type? if it's
nullable, otherwise Type if it's non-nullable.
Would be great to have null safety in Dart as well, currently we're getting
so used to it in Kotlin that some devs
forget to do null checks in Dart when they have to work on the frontend
again.

Python's lack of curly braces drove me nuts when i was still using Python.
In Python 2, often bugs would creep in because somebody used spaces to
indent and somebody used tabs to indent and some tab would slip through
causing a statement to appear in a certain block, but actually be outside
that block

+1 for no semicolons or at least making them optional
Coming from a Java background, it's normal to want to type semi-colons, it
almost happen by muscle memory
and it would be annoying if it caused compiler errors when you added
semi-colons accidentally.
Having worked in Kotlin for the last two years, i wouldn't say i miss
semi-colons,
when i accidentally add a semi-colon (after switching back from Dart to
Kotlin), Kotlin doesn't complain either,
it just suggest that the semi-colon is not needed.

Either way, semi-colons do not bother me much, nulls on the other hand is a
different story.
Post by Tom M
Dart gets semicolon insertion and Go uses pub.
Post by Kasper Peulen
There may be a way to make everybody happy here.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CAKkrQ9vU4ep2ACYeegVFcALLF_WV-ZBh6Ye6%2BqZVohhFXYRPig%40mail.gmail.com.
Continue reading on narkive:
Loading...