5 ms·
it is weird they made that the only valid syntax
by shadowmint 13y ago
it is weird they made that the only valid syntax
- masklinn 13y agoWhat you stated is not just that (which is not actually weird), but — quoting you > Go is also the only place I've ever seen this syntax compounded by > Maybe that's popular in some obscure places (thus calling Java's coding conventions or the K&R "obscure places")
- doktrin 13y agoI don't understand why this comment is being downvoted. I just learned something. If Go enforces a specific coding convention at the compiler level, then that could legitimately be considered at least slightly unusual. While it's true that this style is far from esoteric, it's also typically just that ( a coding style ). This strikes me as at least somewhat analogous to Python's whitespace indentation rules or Java's checked exceptions, in that what is typically a design choice is enforced by the compiler / interpreter.
- CatMtKing 13y agoIt's a great choice for readability; cuts down on inconsistency.
- wonderzombie 13y agoIt's because of arguments like this, that's why. They render a huge swath of subjective, unproductive discussions about style completely moot.
- jlgreco 13y agoWell, that is the idea at least. Unfortunately it almost seems as though the style arguments will be replaced with the "pro/against enforced style" arguments. Hopefully this new topic has less staying power.
- coldtea 13y agoNot, it's very pragmatic, based on a parser need (to make it simpler), and it's well explained in their docs. Not to mention that's a well known style, has a lot of benefits (less wasted lines compared to the style that puts both brackets on empty lines, less potential for errors in than when you omit the brackets for a single statement), and, most importantly, puts and end to all bikeshedding. Especially along with gofmt, go is a bikeshedding free language in regards to syntax.