Live data from Hacker News

Why Go is my favorite programming language

michael.stapelberg.de

151–160 of 256 posts

Re: Why Go is my favorite programming language

#151

The "easy to learn" argument is getting old. If the cognitive load never decreases, that's one thing, but initial ramp-up time shouldn't be a large determining factor. The MVC pattern, ADTs, functional programming, and so many other useful concepts were foreign at first, but have a substantial impact on how you think and work. With the exception of channels, Go doesn't add much when compared to other languages. Maybe…

With the exception of channels, Go doesn't add much when compared to other languages. It doesn't add things, it takes them away, notably exceptions, inheritance, generics. I disagree that's short sighted, it's precisely for long term maintenance that it becomes important to have less ways to do things. You may not agree with the choices, but they are not only about being easy to learn, more about being easy to read.

[deleted]

Re: Why Go is my favorite programming language

#152

When Java was first introduced, the world was abuzz about this cool new language which you could "write once, run anywhere". It took some time, but as it grew in popularity, articles started appearing about how much Java sucked because it was slow and bloated, required a ton of boilerplate code, and eventually because "write once, run anywhere" turned out to be a myth, along with a boatload of other reasons. The hone…

> "there are two types of languages, the ones everyone complains about, and the ones nobody uses"

Of course Bjarne would say that. The reality is, there are some languages that people use a lot and don't complain about nearly as much. Some languages are just actually worse to use. http://andrewvos.com/2011/02/21/amount-of-profanity-in-git-c...

Re: Why Go is my favorite programming language

#153

Earlier quoted context omitted.

> Go, with its lack of complicated mechanics targets the middle of the bell curve. No, it targets the less experienced - interns, as the language creators said.

I don't think Go targets the less experienced. Could you provide a resource, where the language creators have stated that Go targets interns? Go is a safe programming language, but it is not simple. Go has very rigid rules. I don't see any difference in complexity between programming in C and programming in Golang. Programming in Golang may even be harder than C. If you format your code wrong, Golang screams at you.…

> C is much more forgiving :).

I think this is confusing being permissible with difficulty. Because C is permissible, it makes writing correct code in it hard. The fact that the Go compiler has a (relatively) simple type system and is able to point out mistakes like the ones you mentioned makes it much easier to write correct code.

I'd also just like to point out most of the things you list about Go won't cause a crash or undefined behaviour if you were able to leave them in anyway.

As pointed out elsewhere in this thread, interface{} isn't the same as void. void will let you reference anything as a type unsafely leading to undefined behaviour. interface{} carries type information, and while it does cause crashes, it doesn't lead to undefined behaviour.

Also, how is memory management in C easier? Leaking memory is the least of your worries, you could double free, null ptr access, invalid free, have dangling ptrs, etc. Lots of these things are taken care of by Go's GC so you don't have to worry about it.

Re: Why Go is my favorite programming language

#154

I love Go! It houses us and puts food in our mouths. It also powers our side projects. Go is awesome!

To paraphrase Upton Sinclair: it is difficult to get someone to understand something, when their salary depends on their not understanding it.

Re: Why Go is my favorite programming language

#155

I love Go! It houses us and puts food in our mouths. It also powers our side projects. Go is awesome!

To paraphrase Upton Sinclair: it is difficult to get someone to understand something, when their salary depends on their not understanding it.

Re: Why Go is my favorite programming language

#156
post #114

Earlier quoted context omitted.

They have quite a few open positions asking for Go knowledge. No idea how they are using it.

Yes, I meant it's not like Apple is forcing it on external developers though, like e.g. they "force" Swift. Google could do that (if they adopted Go on Android), but I think they went with Dart instead IIRC.

> Yes, I meant it's not like Apple is forcing it on external developers though, like e.g. they "force" Swift.

Sure, but at the same time it creates awareness in other companies that Go is a good bet that they might adopt as well.

> Google could do that (if they adopted Go on Android), but I think they went with Dart instead IIRC.

They went with Kotlin.

Dart is still looking for a killer application beyond supporting AdWords, lets see how far they go with Flutter or Fuchsia.

Re: Why Go is my favorite programming language

#157
post #152

When Java was first introduced, the world was abuzz about this cool new language which you could "write once, run anywhere". It took some time, but as it grew in popularity, articles started appearing about how much Java sucked because it was slow and bloated, required a ton of boilerplate code, and eventually because "write once, run anywhere" turned out to be a myth, along with a boatload of other reasons. The hone…

> "there are two types of languages, the ones everyone complains about, and the ones nobody uses" Of course Bjarne would say that. The reality is, there are some languages that people use a lot and don't complain about nearly as much. Some languages are just actually worse to use. http://andrewvos.com/2011/02/21/amount-of-profanity-in-git-c...

So of course, going by the logic of linking that article, we're all wasting our time and should just be using PHP?

Re: Why Go is my favorite programming language

#158

> There is a cost to introducing an abstraction layer. Go code is usually rather clear, at the cost of being a bit repetitive at times. Go programmers say this a lot and every time I see it I wince. We've had all sorts of flights of fashion and fancy in the programming world, but one observation has emerged that seems closer to fact every time we test it: more code is more bugs. The more code you write, the more chan…

As Sandy Metz once said, "A little duplication is far better than the wrong abstraction." After a decade of OOP indoctrination and misuse, we see the results of this. > Go has popularized a mode of writing code where not only are abstractions unwelcome, but they're nearly impossible This lends me to believe you actually haven't written any go code for yourself. This is the same thing every OOP-indoctrinated developer…

> "A little duplication is far better than the wrong abstraction."

A little exploration is better than a false dichotomy.

Re: Why Go is my favorite programming language

#159
post #88

Earlier quoted context omitted.

I don’t want a vendor directory in the first place, how do I avoid that? I want it to just automatically do its stuff just like maven/gradle/sbt work, and not deal with any damn dependencies. I want it to automatically set the dependency path, and handle incremental compiles. If people claim it has so much better tooling than Java, then I expect at least it to work as well as Java’s tooling.

I'm trying to understand your complaint. Obviously you'll need a vendor directory somewhere containing the source code of your dependencies. Maven places them outside the project's root dir (defaults to ~/.m2/repository), whereas Go puts them inside the project's root dir. Tomato-tomato. They have to exist on your system somewhere.

> They have to exist on your system somewhere.

Yes, but they shouldn’t be something I’d have to ever care about. Whenever I type "build", the build tool should automatically manage the dependencies and invoke the build process.

Re: Why Go is my favorite programming language

#160

> There is a cost to introducing an abstraction layer. Go code is usually rather clear, at the cost of being a bit repetitive at times. Go programmers say this a lot and every time I see it I wince. We've had all sorts of flights of fashion and fancy in the programming world, but one observation has emerged that seems closer to fact every time we test it: more code is more bugs. The more code you write, the more chan…

As Sandy Metz once said, "A little duplication is far better than the wrong abstraction." After a decade of OOP indoctrination and misuse, we see the results of this. > Go has popularized a mode of writing code where not only are abstractions unwelcome, but they're nearly impossible This lends me to believe you actually haven't written any go code for yourself. This is the same thing every OOP-indoctrinated developer…

You can't write a generic map function for lists. The lack of this abstraction alone should be damning. Even rudimentary functional programming is hard in Go.
Post reply on HN