6 ms·
The reason is people have no clue about Go most of the time and advocate against it because it's popular. Pretty much like Node ect... I mean look at Erlang der
by Thaxll 9y ago
The reason is people have no clue about Go most of the time and advocate against it because it's popular. Pretty much like Node ect... I mean look at Erlang derivates / Haskell / Rust, you don't see negativity in related language.
- candiodari 9y agoOr perhaps they're language geeks. Go is truly a horror show when it comes to programming language concepts. Everything about go is a complete special case. Select ... has it's own type system exceptions (and so many exceptions you might as well say Go simply has different type systems for all built in types, for all built in functions, and for several special forms). Make ... ditto. New ... ditto. "Go" same. Channels ? Effectively a separate type system. Dicts ? Same. And so on. Everything is a compiler exception. Nothing makes sense. Nothing. The absolute worst in Go, in my opinion, is the "range" function/special case. It is return-type polymorphic. That's right, it does different things depending on what you assign it's result to (not even C++ dared to go there). Not parameter polymorphic, return type polymorphic. "Assign" a range to one variable, does X, two variables, does Y, nothing ? does something else yet again, channel ? Again something else and all of these are special cases in the type system (same -but not quite the same, of course- with case, channels and dicts, by the way) Needless to say, even though you have to assign ranges to things in Go, that's the only way to use it, that assignment does something entirely different from any other assignment in Go's type system. Go is how to make a language extremely dumb and yet make have a type system that can't be (fully) described shorter than Haskell's.
- Vendan 9y agoRange is hardly return-type polymorphic. It always returns the same things, you are just free to ignore them, i.e. for k := range map { } is the same thing as for k, _ := range map { } Would requiring the second version instead of the first actually be that much of an improvement? The only true return-type polymorphism is type assertions, which is reasonable in my mind cause I don't think ignoring the "assertion failed" should ever be a logical thing to do.
- candiodari 9y agoOk. Now consider what happens with slices/arrays instead of maps. 1) for k := range list {} 2) for k, i := range list {} In python, the equivalents are: 1) for x in lst: 2) for x, y in enumerate(lst): So are these "the same" ? No.
- Vendan 9y agomore accurately it's for index := range list {} and for index, value := range list {} Yes, these 2 version do perform very similarly, you are just ignoring the second return value in the first version, i.e.: for index, _ := range list {}
- PopsiclePete 9y agoI love Go and agree with everything you said. I was never good at computer science-y "language theory" type stuff. I believe you when you say that Haskell or Forth are better languages - I just can't use them worth a damn. Go is a practical language for me - it's not beautiful, or elegant, the type system is only 70% there, can be verbose, etc, etc, but it allows me to put my code in production and have a very high level of confidence that I won't get a phone call at 4 am. I don't have that confidence with Ruby, or Python, or Javascript. I find that Go is very easy to pick up, and hard to really fuck up. Most people at my company can read my code and I can read theirs, which is mind-boggling to me. Go somehow achieved what I thought was impossible - to read and grok quickly other people's code. Go sees was developed by "engineer" types - not "language nerds". And, yes, it shows. FWIW, I also love Rust and C, but will choose Go over Rust any day when my productivity and dead-lines are more important than close-to-C performance.
- Thaxll 9y agoI don't code at work for programming language concept, you see you should use the tools that make sense for the task you're working on. I'm not being paid to have fun on using an academic language that no one use, have bad tooling, not enough libraries to work with. You never wonder why pretty much no one uses Haskell / Erlang if it's that great? Having the best language concepts doesn't mean a thing in the real world. I try those things at home not at work where $$$ is at play.
- peoplewindow 9y agoHe wasn't saying use Haskell instead. It was a comparison of the complexity of the type system vs power provided. Most Go programs could have been written in Java, Scala, C# or Kotlin and been shorter, more predictable and probably faster. Certainly more maintainable (ok maybe not for Scala).