Just curious, I hear many people talk enthusiastically about the language, yet every serious critic of it I see runs along those lines and makes me want to skip the language altogether.
This is actually why I'm posting this, both Nim and Rust are higher on my languages-to-try list. Free time is sadly not unlimited and I'd like other people's opinions as well :)
Try it on a small project and decide for yourself.
There are a lot of detractors repeating the same thing: "It does not have all the features of my favorite language X so its bad", while not explaining why they don't just use X.
A lot of people are super productive with Go, despite all the detractors criticizing the (supposed) lack of people's favourite language features. That's reason enough to have a closer look. Conceptual purity doesn't buy you anything in the real world.
One of the thing that annoyed me is that the language forces you to put your opening braces on the same line as your condition/loop. I like to have them on the same vertical line, I find it easier to see the blocks.
I personally prefer to way Go does it although there are other formatting standards that are enforced that bug me. However, even if I don't like everything I am somewhat fond of the fact that this actually enforced.
I don't mind that, after years of working in languages like Clojure, CoffeeScript, Python and Haskell (mostly for personal projects, at work I use C++/C#/Java) I now see braces as syntactic noise and use indentation to see the blocks. But that's just a matter of preferences.
I'm more curious about Go on a semantical level. What does it make practical and idiomatic?
I don't code much in Go but the thing that bothers me the most is the way variable types come after the variables names. What is surprising is nobody talk seems to be bothered by this at all....
That's actually the more 'normal' way of doing it. In type theory (or mathematics in general), you almost always write value: Type. (For instance F: A -> B.)
This is how it is done in ML, Haskell, Erlang, Rust, Smalltalk, etc...
It's mostly just C-like languages that do it the other way.
As dayjob C coder, I just find the way types are written in C complete nonsense (especially when you start declaring pointers to functions), and no modern language should force that horror upon developers.
Go types syntax is well done, IMO, even though I'm not into Go language that much (I rather Rust).
The good thing about how things are structured in Go is that you can read your types from left to right, while in C, you need to use a more intricate way of reading types... http://c-faq.com/decl/spiral.anderson.html
14 comments
[ 3.0 ms ] story [ 38.4 ms ] threadThere are a lot of detractors repeating the same thing: "It does not have all the features of my favorite language X so its bad", while not explaining why they don't just use X.
I'm more curious about Go on a semantical level. What does it make practical and idiomatic?
This is how it is done in ML, Haskell, Erlang, Rust, Smalltalk, etc...
It's mostly just C-like languages that do it the other way.
Go types syntax is well done, IMO, even though I'm not into Go language that much (I rather Rust).