3 ms·
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
by general_failure 11y ago
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....
- Retra 11y agoThat'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.
- dpc_pw 11y agoAs 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).
- _ak 11y agoThe 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 http://c-faq.com/decl/spiral.anderson.html