3 ms·
Go has very much "magic" all around. Take a look at goroutines, they are pure magic. Theres also lots of implicit magic going on with magic comments, file names
by phplovesong 2y ago
Go has very much "magic" all around. Take a look at goroutines, they are pure magic. Theres also lots of implicit magic going on with magic comments, file names convention etc.
- lifthrasiir 2y agoWhile I agree that Go has lots of magics, probably far more than the average programming language, it seems that Go has also successfully hidden many if not most magics so far.
- anal_reactor 2y agoI worked in a company that used golang but my position did not and that was pain because golang's syntax is "we do things differently because we can" so whenever I needed to make a small change in existing code, it always turned into a bigger project because I never understood what the fuck was going on in that program.
- lifthrasiir 2y agoYeah, that's a curse of knowledge to be frank because you can see many magics once you have used many other languages and it is generally a good instinct to be skeptical about those magics anyway (Go included).
- ithkuil 2y agoI agree about directives embedded in comments. Especially things like // go:embed But goroutines? They are a foundational language feature with clear syntactic demarcation and documented behaviour. I think that in computer science "Magic" doesn't mean that the implementation is hard to understand. Magic means that the behavior is surprising, that there is misdirection involved etc
- saghm 2y agoMy hot take is that "magic" is just a pejorative term to dismiss any abstraction that someone doesn't like. It's subjective, and IMO it's used mostly as a thought-terminating cliche rather than providing any value to a discussion. Sometimes it seems like people throw around the word "magic" like it's some morally dubious shortcut used by programmers who lack the discipline to resist its temptations. I'd argue that making a good language that doesn't require using "magic" is actually _hard_; it needs to differentiate from existing languages enough not to be redundant but still try to fit into the non-uniform expectations of users. Rather than saying that a language "has magic" or "doesn't have magic", I wish it was more common for people to directly state that a language works like they'd expect or point out the areas where it doesn't (which can be separated from a value judgment of whether something is "good" or not). If anything, I think that saying a language works like you expect is _more_ of a compliment than saying "it doesn't have magic" because it properly conveys the sense that our expectations are fairly narrow in comparison to the entire design space and require skill to identify rather than something obvious that people would only avoid by choice.