Live data from Hacker News

Why Go is my favorite programming language

michael.stapelberg.de

71–80 of 256 posts

Re: Why Go is my favorite programming language

#71
post #48
post #21

I have said it before and I will say it again - for all the deficiencies Go has, it is somehow highly compatible with the way my brain works. One point the article does not mention is the documentation. I think Go's documentation is excellent, it does not overwhelm the reader with its volume, but mostly anything one might want to know about the syntax and semantic can be answered by carefully reading through the docu…

"for all the deficiencies Go has, it is somehow highly compatible with the way my brain works." I have been tempted to write a blog post about "Why People Actually Can Write Real Programs In Go." To listen to HN complain about the language you'd think that it must be clearly impossible to ever write a program of any kind without massively copying and pasting everywhere, when in reality I find it's actually quite plea…

Many of us, old timers, surely programmed in languages like Go in the past, and were able to deliver lots of successful projects into production.

I for one was a very passionate Oberon user and Niklaus Wirth is well known for its minimalism design goals, Oberon-07 is even more minimalist than Go.

Just because I used to program like that almost 20 years ago, doesn't mean I still enjoy using such minimalist languages.

Re: Why Go is my favorite programming language

#72
post #65

Earlier quoted context omitted.

It is way safer than void * : A void * can be cast to (and then used as) any arbitrary type, leading to all sorts of undefined behavior. On the other hand, the following code will just panic() (i.e. exit cleanly without corrupting memory). var x int = 5 var i interface{} = &x *(i.(*string)) = "boom"

True, now imagine that program was controlling some kind of device and due to the panic it wasn't able to turn the device off.

That's "shitty programmer", not bad language. You can catch panics, and there's a panic safe "val, ok := ival.(type)" assertion.

Re: Why Go is my favorite programming language

#73
post #66

Just use modern C++

Couldn't agree more, a much better investment of anyones time. C++ won't suddenly refuse to solve your problems because they don't fit into an arbitrarily limited view of the world. And some of the stuff coming out of standardization lately is simply awesome.

Re: Why Go is my favorite programming language

#74

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…

Lot of new languages try do to everything which is imo a big mistake.

Re: Why Go is my favorite programming language

#75
post #36

I haven't looked at Go yet, but all these "is so easy to learn" and "generics are bad because they're not easy to learn" articles on HN, I have to wonder if this language is really so great or people push it because of the politics of people making it.

While I do like that Go is ready to learn, I like that it is small enough to hold in my head. Pretty much everything works intuitively, save for a couple surprises. The same goes for its tooling. There is no complex project or package tooling to learn either. That said, it doesn't have a passable story for sum types or generics, which are important for the kind of programs I write these days. I'm convinced that summe…

> There is no complex project or package tooling to learn either.

Question, how do you handle dependencies without them ending up checked in in your git? I’ve had no success yet with go and dependencies, there’s no simple way like in the Java world to just define a list of dependencies and have the built tool automatically fetch them in some dotfolder, and take care of the rest, is there?

Re: Why Go is my favorite programming language

#76
post #63

What would convince an avid Python user to switch to Go st this point? Let’s narrow down the scope to an API backend to be more specific (isn’t that’s where Go’s performance thrives?)

- Real concurrency without having to deal with spawning multiple programs that communicate over some higher level process

- Good concurrency primitive (channel), although asyncio Futures in Py3 aren't that bad either

- Strong typing

- Easy byte-level manipulation

- Extremely easy to learn

- Simplistic error handling compared to exceptions (there are problems with this I won't go into, but it's easy to learn at least)

- Amazing tooling (gofmt forces your codebase to be consistent regardless of who is writing it)

Re: Why Go is my favorite programming language

#77
post #67

Earlier quoted context omitted.

SAP ABAP syntax includes: + database retrieval and manipulation as a 1st class concept. ABAP doesn't require a 3rd-party ORM and therefore, SQL statements are 1st class syntax. + GUI capabilities as 1st class syntax (user interface elements for forms, lists, grids, visual reports, etc) Golang core doesn't have those, so it understandably doesn't need extra official keywords to address that functionality. SAP ABAP has…

> Golang can have less keywords, because it has less features. So, you are saying… because it's less complex?

No. I don't think Golang is "less complex" because it has less features than ABAP _if_ you plan to use Golang to write GUI applications that interact with databases to track enterprise data of sales, purchase orders, manufacturing, inventory control etc.

"Complexity" is not a useful label unless you look at what you're actually building:

- If the goal is to show "hello world", yes Golang is "simpler".

- If the goal is an ERP system, Golang is way more "complex".

Between those 2 extremes requires analysis on a case-by-case basis.

Re: Why Go is my favorite programming language

#78

Earlier quoted context omitted.

I know this is repeated often, but only because it apparently still has to: interface{} is very different from void*. It carries type-information with it. That makes it safe.

Safe as in nil not even being equal to nil any more, I know I'll sleep better.

nil is always equal to nil. You might be confusing it with comparing a nil pointer to a pointer to a nil pointer, which are not equal.

Re: Why Go is my favorite programming language

#79
post #2

I think regardless of how each one of us sees Go, its adoption among DevOps (Docker, K8s), Apple and Microsoft means that just like with C and JavaScript it will become unavoidable to use it for certain tasks.

Adoption from Apple? If you mean on their internal services, then that's irrelevant as to the rest of us "having to use it".

Re: Why Go is my favorite programming language

#80
post #75
post #36

Earlier quoted context omitted.

While I do like that Go is ready to learn, I like that it is small enough to hold in my head. Pretty much everything works intuitively, save for a couple surprises. The same goes for its tooling. There is no complex project or package tooling to learn either. That said, it doesn't have a passable story for sum types or generics, which are important for the kind of programs I write these days. I'm convinced that summe…

> There is no complex project or package tooling to learn either. Question, how do you handle dependencies without them ending up checked in in your git? I’ve had no success yet with go and dependencies, there’s no simple way like in the Java world to just define a list of dependencies and have the built tool automatically fetch them in some dotfolder, and take care of the rest, is there?

Use dep, which they're planning to add to the official tools like 'go get'. Then add your vendor directory to your gitignore, and you're done.
Post reply on HN