3 ms·
Python's approach has always been highly pragmatic. Go's is as well, but with somewhat different goals. The Go team's goal seems to involve putting together a
by stcredzero 16y ago
Python's approach has always been highly pragmatic. Go's is as well, but with somewhat different goals. The Go team's goal seems to involve putting together a clean-enough syntax with fast-enough for systems programming performance combined with powerful-enough high-level concurrency model. They don't want to win the gold in any one category. They're going for the decathalon!
In any case, language syntax should always take into account the expectation of programmer communities. If you push syntax too far, you lose too many people.
- andralex 16y agoThe point of my example was simple - Go's gross mishandling of whitespace is a permanent trap for the unwary and a huge liability for people coming from other languages. When D was nascent, many people proposed various schemes for making semicolons optional. I think it's great D didn't fall for such.
- stcredzero 16y agoName one language that doesn't have "a permanent trap for the unwary and a huge liability for people coming from other languages."
- jibal 16y agotu quoque fallacy -- the worst possible form of argument FOR something.
- stcredzero 16y agoOnly a fallacy if it's an argument for something. It's actually a criticism of your criticism. Oh hey, you tried to spin my comment with a different meaning. I guess you're guilty of an entirely different fallacy.
- kjksf 16y agoI don't really follow what in your example shows "gross mishandling of whitespace". The most popular languages are C, C++, Java and C# and Go's syntax is very similar to those. If anything, Python is the weird one in how it treats the whitespace and hence most likely to confuse people coming from other languages. As to optional semicolon elision - what is the problem with that? They make the code cleaner looking and gofmt will remove them for you even if you forget due to C/Java reflexes. I don't see the downside of making them optional.
- WalterBright 16y agoThe problem is that the code looks correct for anyone coming from C, C++, Java, D, Javascript, etc., but produces unexpected results.
- andralex 16y agoPlease make sure you give the example a close read, as it surprises even experienced Go programmers. Both examples look similar to code in the likes of C, C++, Java, and so on, _except_ the semantics gets radically changed depending on one line feed, which is very unlike those languages. I hope this clarifies things.
- deleted 16y ago[deleted]