Most active commenters

    ←back to thread

    131 points apta | 13 comments | | HN request time: 1.67s | source | bottom
    Show context
    carbocation ◴[] No.9266352[source]
    My summary of the author's points: no generics, inexpressive, no good package manager, procedural.

    Of these, caring about the fact that it is procedural seems pure opinion. Lacking a package manager is not really a language issue (PHP's package manager, for example, is not coupled to the core language).

    So, we are left with the lack of generics and the lack of expressivity. I'm not deep enough in the weeds to be able to argue pro/con for generics intelligently right now, so I will concede that as a concern that has been raised by many.

    The lack of expressivity seems to be an inexorable consequence of the goal of simplicity, so I'm sympathetic. That said, it seems to be a tradeoff acknowledged by Go's authors, not an oversight.

    Overall, these points don't convince me of the author's thesis (or, at least, they don't seem to justify the title's degree of inflammation).

    replies(5): >>9266432 #>>9266452 #>>9266511 #>>9269687 #>>9281940 #
    1. pivo ◴[] No.9266452[source]
    I hadn't really looked at Go before, but I have to say the generics issue reminds me of Java 10 years ago before it got generics. Java also had the goal of being simple, which is probably why it's so popular, but for me it was always too simple in the sense used in TFA (haven't tried Java8 yet though.) At least it looks like Go has higher order functions, but I don't see how they will be that useful without generics unless you subvert the type system.

    I definitely think the too-simple nature of Java is the reason behind all the reams of boilerplate Java code found in most any Java project, and I can't see how Go would be any different. It seems like a shame not to have learned that lesson.

    replies(2): >>9266919 #>>9267041 #
    2. davecheney ◴[] No.9266919[source]
    If you want a more complex Java you can have Scala. Scala remains hostile to newcomers with an almost vertical learning curve. I don't think anyone can seriously argue that commercial programmers need a more complex language.
    replies(2): >>9267046 #>>9268612 #
    3. Someone ◴[] No.9267041[source]
    I think the too-simpleness of Java 1 also has made Java 8 more complex than it could be. Java got generics 'the easy way' through reification, and that gave us the mess that is mentioned in http://java.dzone.com/articles/whats-wrong-java-8-part-ii:

    "the methods of these interfaces have different names. Object functions have a method named apply, where methods returning numeric primitives have method name applyAsInt, applyAsLong, or applyAsDouble. Functions returning boolean have a method called test, and suppliers have methods called get, or getAsInt, getAsLong, getAsDouble, or getAsBoolean."

    The solution that go offers for such problems seems to be to deny that there is such a thing as libraries and to promise to deliver migration scripts whenever changes in the language or its libraries break existing programs.

    That approach works fine now, but I am not sure it scales to a situation where go is truly successful; in particular, I think go, at some time, will have to allow for dynamic linking to support commercial libraries, if it wants to become truly successful.

    On the other hand, the times of copy protection on software being normal are far behind us, and CLR has an ecosystem for commercial libraries, that decompile so well that CLR libraries do not differ much source code. Maybe, I am underestimating the willingness of commercial vendors to start shipping libraries in source form.

    replies(1): >>9267211 #
    4. frowaway001 ◴[] No.9267046[source]
    "Why should I ever wash my hands before a medical procedure? It just makes things more complex!" –– Surgeon, ~1700.
    replies(2): >>9267667 #>>9267725 #
    5. waps ◴[] No.9267211[source]
    I don't get where people get the idea that Go is simple.

    1) go has generic functions : http://golang.org/pkg/builtin/, they're just not accessible to you

    2) go has generic types : slices, maps, and channels, all of which have slightly differing behaviour, including some highly counter intuitive and contradictory behaviour (example: slices are pass-by-reference, arrays are pass-by-value. In other words []int and [5]int behave entirely differently)

    3) go has overloaded functions : http://golang.org/pkg/builtin/, they're just not accessible to you

    4) go has exceptions (panic/recover), negating all the advantages of Go error checking, and providing zero fixes for the problems it introduces (finding the source line where an error happened and if/how multiple errors are related. Easy in Java/C++/..., hard in Go) (in C++ you have to be aware of whether any external code you use throws exceptions ... in Go you have to be aware if any external code you use panics. And if you say I haven't dealt with it, that means that you quite literally haven't dealt with it. Same as in C++. External libraries throwing exceptions is perfectly fine ... as long as they never actually throw an exception. Panicing standard library is fine ... as long as it doesn't panic ... If you're looking for correct code, it is of course not fine)

    5) Go's "simple" threading and panics. Try crashing a Go program with shared data with a null-pointer derefence in the shared data. Someone please explain to me how the resulting output is simple.

    6) golang's own compiler and standard library are not in fact idiomatic Go. This goes from small problems (like total lack of unit tests in quite a few places), to larger ones, like not using interfaces for logging.

    7) interface{}. I just grepped a reasonable, thoroughly reviewed codebase I've written, of several tens of thousands lines of Go. Result: 2.7 uses of interface{} per 1000 lines of code.

    Is this what people here call simple to think about code ? I would argue that you don't understand a codebase until you've read it. That's a certainty. So can we at least agree there's a point where verbosity no longer increases readability ? I hope you can see Go is far past that point.

    Go's type system : riddled with exceptional behaviour. Literally it says "type system applies unless it's doing <-, cap, len, copy, new, append or delete calls", in which case we do something custom. The resulting behaviour, of course, is inconsistent with Go's type system (which is really the point of the code of course, unfortunately, there's surprises buried in there, and those calls are inconsistent with eachother as well).

    All of these are implemented as exceptions in the compiler. I would warn you about this link : once it is seen, it cannot be unseen :

    https://github.com/golang/go/blob/master/src/cmd/internal/gc...

    The irritating part is that this sums up Go mailinglist behaviour quite well. Coding practices is for you, not for us, the Go authors. Generics ? Of course we need that, but you obviously don't as you're a bad programmer. And if you're asking for something else that must mean you suck. Overloading ? Ditto. Generic types ? Yes for us, not for you though !

    Of course, all of these claims are thrown around and when you actually read the compiler code you wonder ... do these guys know about type systems ? Don't these guys know about the standard coloring algorithm ? Why aren't they using extremely-well-known algorithm X for this ?

    In other words, it really looks like the compiler was (and is) written by someone who last opened a compiler book in the 70s. But reading the mailinglist, you'd think they were the central authority on compiler theory and you're stupid. This is in fact not the case.

    Go works and feels like a late-90s language like Oberon. Clean at the surface, with lots of buried ugliness. Lots of weird custom datatypes, forms and parts of the standard library that are not implemented in the language itself. It's why I switched to C/C++. Go is simply the same as those old languages we moved away from. There is nothing in Go that cannot be achieved better and more flexible in C++, D and Rust.

    replies(1): >>9267436 #
    6. zzzcpan ◴[] No.9267436{3}[source]
    > Clean at the surface, with lots of buried ugliness.

    Maybe we will see a DSL that compiles into Go to fix this. Like we have for Javascript.

    replies(1): >>9267615 #
    7. mmastrac ◴[] No.9267615{4}[source]
    What would be the point? You may as well just target LLVM.
    replies(1): >>9267676 #
    8. davecheney ◴[] No.9267667{3}[source]
    What a feckless comparison. Don't mistake something taking more time with something being more complex.
    9. zzzcpan ◴[] No.9267676{5}[source]
    To benefit from the whole Golang ecosystem.
    replies(1): >>9270085 #
    10. Gigablah ◴[] No.9267725{3}[source]
    Comparing Scala's complexity to a life-saving procedure says more about your own self-importance than anything.
    replies(1): >>9278157 #
    11. modersky ◴[] No.9268612[source]
    We have data to contradict this argument: Over 400'000 people have enrolled in an online Scala course with a success rate twice the industry average. "Almost vertical learning curve?" Please!
    12. mmastrac ◴[] No.9270085{6}[source]
    Fair enough.
    13. krenoten ◴[] No.9278157{4}[source]
    Strong type systems absolutely save lives.