Live data from Hacker News

Go is my hammer, and everything is a nail

maragu.dev

151–160 of 816 posts

Re: Go is my hammer, and everything is a nail

#151
post #120
post #47

The author lists multiple reasons for this, but for me the biggest one is the first one: Go is good for almost everything . I have extremely good productivity when using Go. Once your project exceeds 100 lines it is usually even better than python. And yes, I am aware that Rustians did a survey where Rust was crowned as the most efficient language but in my reality (which may differ from yours) Go is simply the best…

Go is the only language I've ever felt highly productive working in. Oftentimes in other stacks I find myself in analysis paralysis on meta things that don't matter: - what design patterns/language features make sense to use - what is the best lib to accomplish X - how do you keep things up to date With Go, the language is so simple that it's pretty difficult to over engineer or write terse code. Everything you need…

I do programming interviews and I found candidates struggling a lot in doing http request and parsing response json in Go while in Python its a breeze, what makes it particularly hard, is it lack of generics or dict data type?

Re: Go is my hammer, and everything is a nail

#152
post #21

If all you know is a Hammer… I was searching for reasons why to use the Go-Hammer when there are comparable ones such as Java, C#, etc. but the article left me wanting. It strikes me that Go is riding the peak of hype languages, succeeding Rust and Node.js (which are all good pieces of technology and absolutely have their merit). And like with most hype driven decisions there is little (self) awareness of context and…

I wasn't aiming for that. My point is more: I know Go already, it's good enough for my purposes, so I'm using that as my hammer. I could just as well have been Java or C# I learned eight years ago and used that for everything. :)

And this is a perfectly reasonable approach. Frankly, the cost/benefit ratio of delving into another language is most often not appealing.

As a suggestion, you could have delved more into the "hammer" metaphor, mentioning that a hammer is a flexible tool: nail planks, remove nails, smash things and even as a defensive weapon! You shouldn't misuse it for drilling walls, but that is outside the required scope of your work etc.

But in the end it's a very personal post, and we typically crave here for universality and judge posts up high from a meta-perspective, haha. Often neglecting that we were not actually the intended audience.

Re: Go is my hammer, and everything is a nail

#153
post #133
post #105

Go is everything I don’t want in a language for my personal projects. It’s verbose, every simple task feels like a lot to write. It’s not expressive, what would be a one-liner in Python makes you write three for loops in Go. I constantly need to find workarounds for the lack of proper enums, lack of sum types, no null safety etc. I’m sure these are the exact reasons why Go is good for enterprise software, but for per…

So you're ok with Python, which doesn't have sum types or null safety, 2 out of 3 things you say are missing in Go. In fact, Python didn't have any compile-type type until recently and compared to Go is slow and bloated. So maybe the issue is not Go's lacking some features but something entirely different.

Mypy supports those for like 3-4 years already

Re: Go is my hammer, and everything is a nail

#154

You could have written the same article about C#.

Indeed, this article would read just as well after applying s/\bgo\b/C#/ig, or should I say: Regex.Replace(articleText, @"\bgo\b", "C#", RegexOptions.IgnoreCase); Or indeed most general purpose languages, which the article itself mentions.

The C#'s regex engine would have run circles around Go's here though while doing so :)

https://github.com/BurntSushi/rebar?tab=readme-ov-file#summa...

Re: Go is my hammer, and everything is a nail

#155
post #41

Earlier quoted context omitted.

Just looking at Go after having experience with Erlang and Crystal, does it still have a narrow-minded view of what features language won't support? Like I remember there was a whole drama about generics, errors being simple strings and always returned without being able to raise them, is this attitude still there or have things changed?

That attitude is still there because there is no compelling reason to move away from that. A lot of languages have been diseased by bolting on features for no other reason than different languages have them, and it's overcomplicated the languages and fragmented the codebases. Example, if you ask ten Scala developers to solve a problem, you'll get ten different solutions. That number drops quickly for less feature-ric…

I agree with that and Scala example, but also languages diseased by not evolving and not allowing new widely-accepted features. I wonder what would happen with Go if they never changed their mind and kept it without generics?

My point is not about bringing all features other languages have (its just not possible unless its a lisp), but rather creating a new language and not understanding how vital something like generics is for general purpose programming. That is an orange flag for me.

Re: Go is my hammer, and everything is a nail

#156
post #120

Earlier quoted context omitted.

Go is the only language I've ever felt highly productive working in. Oftentimes in other stacks I find myself in analysis paralysis on meta things that don't matter: - what design patterns/language features make sense to use - what is the best lib to accomplish X - how do you keep things up to date With Go, the language is so simple that it's pretty difficult to over engineer or write terse code. Everything you need…

I do programming interviews and I found candidates struggling a lot in doing http request and parsing response json in Go while in Python its a breeze, what makes it particularly hard, is it lack of generics or dict data type?

I think it depends on what kind of data you're dealing with. If you know the shape of your data, it's pretty trivial to create a struct with json tags and serialize/deserialize into that struct. But if you're dealing with data of an unknown shape it can be tricky to work with that. In Python because of dynamic typing and dicts it's a little easier to deserialize arbitrary data.

Go's net/http is also slightly lower level. You have to concern yourself directly with some of the plumbing and complexity of making an http request and how to handle failures that can occur. Whereas in Python you can use the requests lib and fire off a request and a lot of that extra plumbing just happens for free and you don't have to deal with any of the extra complexity if you don't want to.

I find Go to be bad for interviewing in a lot of cases because you get bogged down with minutiae instead of working directly towards solving the exact problem presented in the interview. But that minutiae is also what makes Go nice to work with on real projects because you're often forced into writing safer code

Re: Go is my hammer, and everything is a nail

#157
post #111

Earlier quoted context omitted.

Faster on what axis? Go has maybe the fastest compile times, for example. Which is very important when you are iterating on a project. What do you dislike about the tool chain? Seems better than most languages to me.

Java’s toolchain may leave some to be desired in ergonomics, but compile time is just as fast if not faster.

What do you see missing in the Java toolchain? Frankly, I see it as one of the most complete and deep of all languages.

Re: Go is my hammer, and everything is a nail

#158
post #99

Earlier quoted context omitted.

It feels extremely strange to see Go described as a "hype" language. It was somewhat hyped around seven years ago, which is when I started using it almost exclusively. Before that, it had a strong hype peak about fourteen or fifteen years ago, just after it was born. However, it's not a young language any more. At this point I would actually submit the opposite criticism: it is a mature language which is perhaps star…

Count the number of posts with Go in the title, vs any other programming language. It easily beats out everything both here and on lobsters.

Well, it's a very usable language which is strongly typed (by any layman's definition), easy to pick up, easy to get stuff done in, relatively easy to live with and easy to maintain. If it's hyped then it's only in the same way The Beatles and Pizza are hyped.

Re: Go is my hammer, and everything is a nail

#159

Earlier quoted context omitted.

I'm genuinely curious which language you see as having a better development time. I don't mean that as arguing, I'm actually curious. I don't know much about Go but I just began learning it 2 days ago. I'm already 50% of the way done through a really nice TUI app, and I haven't even touched the docs. To me at least, it feels extremely productive so far.

Developing with Python is faster.

Only for small or new projects...

Re: Go is my hammer, and everything is a nail

#160

If all you know is a Hammer… I was searching for reasons why to use the Go-Hammer when there are comparable ones such as Java, C#, etc. but the article left me wanting. It strikes me that Go is riding the peak of hype languages, succeeding Rust and Node.js (which are all good pieces of technology and absolutely have their merit). And like with most hype driven decisions there is little (self) awareness of context and…

Thanks for posting this. It’s an unfortunate choice of “one hammer to rule them all” given Go does not offer necessary coverage at both low and high ends of abstraction (and performance) the way C# does. For me, it’s a similar kind of hammer. (I prefer to think of it as a crowbar ;D)

The problem with C# is its created by Microsoft, even if its a good language its hard to look at it and not think how much its limited while used outside of Windows.
Post reply on HN