Live data from Hacker News

Go is my hammer, and everything is a nail

maragu.dev

191–200 of 816 posts

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

#191
post #111

Earlier quoted context omitted.

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.

Only ergonomics, I do actually like most of it (maven central/repository model and gradle). It is one of two truly general build tools (other being Bazel), and being that generic/capable does mean that it can’t be as user friendly as a single-language build tool like Go’s or Rust’s. But these all break down the moment you introduce another language/build step/whatever, while Gradle can build the whole hodgepodge that is the Android platform just fine, which is quite a testament to its power.

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

#192
post #54

Earlier quoted context omitted.

What about the absence of exception handling? Plus OO has its own advantages, even if you don't use it all that much, its one of the best ways to fit problems into neat design patterns. Go seems to be missing those features.

? It doesn't have exceptions, so it doesn't need exception handling. It has an error system / standard that isn't based on exceptions. I only know exceptions from Java myself, and in practice, what it calls exceptions are often... well, not exceptions at all. Files missing, SQL queries returning no errors, division by zero are not exceptional situations, but normal day to day events. And an exception generates a stac…

Throwing prevents the caller's control flow from passing into code that assumes a useful value was returned and ready to be consumed when it wasn't. Handling a success or a failure with exactly the same code shouldn't be a default because it almost never makes sense.

A Java exception can suppress stack trace init if needed, letting an instance be created once and reused very cheaply (though logs will be less useful).

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

#193
post #94

People always under-estimate the cost of properly learning a language. At any given time I tend to have a "main go-to language". I typically spend 2-4 years getting to the point where I can say I "know" a language. Then I try to stick to it long enough for the investment to pay off. Usually 8-10 years. A surprising number of people think this is a very long time. It isn't. This is typically the time it takes to under…

By now I know three major languages: Go, Python, and Typescript. I know tradeoffs at-a-glance, I deeply understand the syntax and its various forms, the full array of tooling and what they do, and lastly (but maybe most importantly) I can estimate more accurately because I can architect in my head.

I can work in a myriad of other languages. I may be able to do some of the things above in Java or Rust but not nearly to the degree to which I can in languages I know. I think the difference is I'm probably not going to be leading a Java project or producing anything really innovative at a code level.

To me, more important than picking a hammer, is knowing a variety of hammers that are good at certain tasks. I don't focus on Rust or Java as much because, frankly, I can build most things that are pertinent to the constraints of my work environment with those tools and most people I encounter also know them. The other considerable factor I have is that most things I work on can be horizontally scaled so my need for Rust is very niche. With respect to Java, I have a lot of workarounds that are cleanly abstracted enough before I need its dynamism and subsequent mental overhead.

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

#194
post #67

Earlier quoted context omitted.

It's not really about Go, I think. But it makes me productive, and I like that. I don't think it's a magic bullet at all. Lots of things annoy me about it. But it's _good enough_ for quite a lot of things IMO. But tying shoes with a chainsaw does sound kinda fun. :D

If someone can't tie their shoes with a chainsaw, they just haven't dedicated appropriate time to their tools :) Side note, this reminds me of a local YouTuber who mostly films himself using a chainsaw and has a remarkably large following (516k followers right now!). He also loves axes. I present to you Buckin' Billy Ray: https://www.youtube.com/@BuckinBillyRaySmith I'm pretty sure this guy ties his shoes with a chai…

Haha, sweet. :D

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

#195
post #103
post #67

Earlier quoted context omitted.

It's not really about Go, I think. But it makes me productive, and I like that. I don't think it's a magic bullet at all. Lots of things annoy me about it. But it's _good enough_ for quite a lot of things IMO. But tying shoes with a chainsaw does sound kinda fun. :D

I completely understand, but the productivity is superficial in my opinion, once you need to dig your teeth deeper into anything not "cloud" and "system engineering" with Go, overall productivity plummets hard. This is from some 10 years of Go experience. But like you say, it is not really about Go; my point is about the illusion of productivity that familiarity brings; it is very deceptive and hurts productivity in…

I don't understand. How can it be an illusion of productivity when it actually produces something that's very easy to see?

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

#196

I can't really disagree with the points the article makes in favor of Go, and it's not selling it over some other language/framework/tool but just celebrating how great of an ecosystem Go has. And it's true -- Go's ecosystem has matured into something very pleasant to work with. By the same token I know professors who still write their simulation scripts in QBASIC because that's what they are familiar with and they c…

You're totally right about CGo. For example, I'm very happy that I can use the insanely well-tested original SQLite C library directly in Go, and sleep easy that it's not some half-ported pure Go library.

(I know there's an auto-transpiled SQLite lib as well, which is probably just as good. But then I have to rely on no bugs in the transpilation process, and I don't like that. That may be superstition though. ;) )

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

#197

I understand the sentiment. My goto hammer is Kotlin, which I like a bit better than Go. But that's a highly subjective thing of course. And I use plenty of other languages as well (including very occasionally some Go). It's not about what is better in general but about what is better for you. Better here means less time wasted with figuring out syntax, tools, APIs, frameworks, etc. Once you know how to do a certain…

Yeah, WASM is interesting! I haven't followed the space at all, but I guess the browser is the new JVM? :D

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

#198

Earlier quoted context omitted.

Because you are attributing things that are common in enterprise environments (Bazel, monorepos, and Protobufs) to Go. It's fine if you hate these things, but saying that these are the defaults of Go isn't right, and I bet that's why people are hating on you. There's nothing default about them in Go. If you work with enterprise-y code, it shouldn't be surprising that a lot of them are going to follow Google's steps.

Go was designed for use in enterprise environments. It was literally designed for Google's specific development problems. Nothing about Go's design should be talked about divorced from the context of it being tailor-built to solve Google-specific problems. All other uses of Golang are basically in the territory of rounding error.

True for the early days of Go but I don't know about now. I think the switch started happening right after modules came out. Generics and the new range stuff seem more for the sake of growing the language than specific needs in Google.

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

#199

> So, what, I’m going to limit my career options? I don't quite get this sentiment. In my experience, the career opportunities come from solving worthy problems, as opposed to using a particular language. Plus, I don't believe that an engineer should be identified by a language, as in a Go programmer, or a Java programmer.

But often, a client needs a developer for an existing stack, and advertising as a Go programmer (for example) gives you an edge over someone who doesn't, in my experience.

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

#200
post #99

Earlier quoted context omitted.

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.

I like that! Go is basically pizza! :D
Post reply on HN