News for hackers. Stuff that matters.
Re:WebGL Terrain Flyover Demo by TazeTSchnitzel on Sunday March 10, 2013 @06:58PM (#5353930)
What are they, aside from just := and the lack of brackets?
Re:WebGL Terrain Flyover Demo by snogglethorpe on Sunday March 10, 2013 @10:23PM (#5354541)
Actually Go's use of := is almost anti-pascal: it means something rather different, but similar enough to be confusing, and so is likely to confuse anybody who's used to the vastly more common meaning of := in Algol-family languages (Pascal, Ada, etc).

... and then there's Go's screwed up version of Pascal-style declaration syntax...

[a link to my earlier rant on this subject: http://news.ycombinator.com/item?id=4520104 (TL;DR: Go: "var foo, bar int"; Pascal: "var foo, bar : int"; the colon vastly improves readability, and has no real drawback)]

Re:WebGL Terrain Flyover Demo by dualogy on Monday March 11, 2013 @02:24AM (#5355206)
> the colon vastly improves readability

We have gofmt for that :)

Re:WebGL Terrain Flyover Demo by snogglethorpe on Monday March 11, 2013 @02:50AM (#5355249)
> > the colon vastly improves readability

> We have gofmt for that :)

Er, what? gofmt doesn't improve the readability of declarations at all... [there's really not much it can do]

Re:WebGL Terrain Flyover Demo by dualogy on Monday March 11, 2013 @03:16AM (#5355309)
It spaces them evenly if you have multiple subsequent lines of them. Readable enough:

    var (
        i, j        int
        foobarStuff string
        bebop       bool
    )
What's not readable?
Re:WebGL Terrain Flyover Demo by snogglethorpe on Monday March 11, 2013 @04:56AM (#5355587)
Er, ok, it can slightly mitigate the problem in a few cases. Even to the extent that it work though, this is a very fragile "solution" — (1) declarations often occur alone, (2) multiple declarations can have similarly sized variables, meaning there's no big whitespace chunk to act as a separator, and (3) one shouldn't have to run one's code through a code formatter, or use awkward formatting practices, to get basic readability....

Simply following standard practice (over decades), and including a colon, on the other hand, would have made all declarations more readable, and be more familiar, for no real cost.

Really, some of Go's syntax decisions are completely baffling...

[Sure there are lots of crazy computer languages around, but these guys really should have known better—and anything they do is much more likely to have an impact than most random languages, so it'd be nice if they could take a bit more care...]

Re:WebGL Terrain Flyover Demo by jbarham on Sunday March 10, 2013 @08:40PM (#5354278)
Go's declaration syntax (http://golang.org/doc/articles/gos_declaration_syntax.html) and package system are inspired by the Pascal family, according to the FAQ (http://golang.org/doc/faq#ancestors).