One document about Go
Lurker
nospam at spamfree.net
Tue Jun 1 12:49:51 PDT 2010
== Quote from Walter Bright (newshound1 at digitalmars.com)'s article
> Lurker wrote:
> > When will D support that? Removing unnecessary semis really pretties up
the
> > code.
> This idea reappears every few years, and even gets folded into a language
now
> and then. It started with Pascal, and most recently has appeared in
Javascript.
> The idea basically sux because of the maintenance issue. What maintenance
issue?
> The one where you decide to add a new line of code before the }. You
inevitably
> forget to go back and append the ; to the previous line. Even if you do
happen
> to remember, now your diff visualizer shows 2 lines changed rather than 1.
While I've not coded in a language without semis, I don't think that adding
the semi on a multi-statement line is something easy to forget to do. Did I
grok your example correctly?
> C got it right and it doesn't need fixing.
> (There are other good reasons for the ; I outlined in my blog
> http://www.drdobbs.com/blog/archives/2010/05/improving_compi.html )
I think that when people suggest removing semis, they mean that the compiler
will put them in automagically, in place of an end-of-line character. So on
your blog, where you suggest that semis are important as synching tokens,
it's really the same thing, because you either work with the EOLs or the
compiler converts them to semis on statement lines. Maybe it opens a can of
worms, but maybe semis proliferate to new languages (obviously Go jettisoned
the semis) just because someone picked the "wrong" way to do it with C(?)
and maybe you didn't step back an eval that issue when you created D so long
ago and/or just wanted backwards compatibility with C (?) instead of
a "drastic" departure from it (?).
So, we have a semi-new language (no pun intended), D that embraces semis,
and we have a new language Go that rejects them. The thing is though, C-
compatibility was not a goal of Go but some level of C-likeness was an
important goal for D (right?). Therefore, I think I'd have to weight Go's
decision more, at least for now unless they decide it was a bad decision and
go back and change to semis. And I do like what the the
unnecessary "missing" semis do for code readability.
.02 (Just aloud off the top of my head).
More information about the Digitalmars-d
mailing list