6 ms·
My Anecdotal Experience: Golang is great for spinning up new services and tools with very little overhead, the language is well designed for the backend - and
by lumost 5y ago
My Anecdotal Experience:
Golang is great for spinning up new services and tools with very little overhead, the language is well designed for the backend - and the lack of <insert programming language feature here> avoids "odd" decisions which other engineers will dislike in the future. If your job is building lots of new things using relatively common building blocks, then Golang looks fantastic!
However on mature services, engineers often need <insert programming language here> because they are dealing with something extremely complex. The author of this blog post digs into the scenario for a package which needs to support different non-nix operating systems, but the same can be true of an app which has to manage many different kinds of objects (Kubernetes, or any service with many DAOs). Alternately there are engineers building all kinds of weird software which may do new things in novel simplified ways. Golang occasionally makes expressing these types of applications more difficult.
Overall I enjoyed my time writing go, until I tried to write a statistics based application for a startup idea back in 2016. The project didn't get very far, and that was partly due to me getting bored having to deal with all of the different numeric data types, at the time the lack of generics made it so that you either had to use reflection - or implement the same function N times over to support the different numeric data types. This tedium killed my love of the language (I'm sure it's a better experience in 2022).
- oversocialized 5y agoSeems too many devs use go for something it is not meant for. Tried doing math calculations in go - not a good a idea. But for backend stuff like rest api, web servers, networking, sysadmin and devops tasks, it shines.
- Cthulhu_ 5y agoI mean, a lot of developers have or look for a golden hammer, coerce their favorite language in doing a task. And since every programming language is turing complete, it CAN work, but whether it's the most elegant is not guaranteed. I mean for math, similarly, Java and co wouldn't work very well either.
- astrange 5y agoJava is solidly mediocre at math, like everything else, but it does work. At least if by math you mean numeric/arithmetical programming, not an algebra system. I think I'd prefer Julia though.
- jitl 5y agoThe Kubernetes codebase is huge, but in my (limited) experience I really felt like it was delivering on Go’s promise: that I can read any given file and understand what’s happening. At least when I needed to debug Kubernetes issues 4 years ago, I could grep around, dive into a file, and command-click to “go to definition” and quickly build a local understanding of the code around my problem. No spooky action. Everything explicit, verbose but plain spoken. Yes there is a lot of code, but I would be very surprised to be able to dive into a C++, Java, Python, or TypeScript project of the same scope and be anywhere as near productive. > partly due to me getting bored having to deal with all of the different numeric data types […]. This tedium killed my love of the language (I'm sure it's a better experience in 2022) That’s the very tradeoff Go is designed to make. It is not expressive. It is tedious. But it’s objective is not to make you as an individual fast. It is to make large programming projects cheaper over the long run, and to reduce the variance between the best programmer on a project and the worst.
- reedjosh 5y ago> It is tedious. > to reduce the variance between the best programmer on a project and the worst. In my experience the only way this can be done as with trying to level anything is to bring down the level of the best. I find this awful.
- AnimalMuppet 5y agoIt may be awful to the best programmer. But if you're looking at the team as a whole, well, how many of the best do you have on the team? It's really hard to create large teams where the average programmer on the team is better than the average programmer in the country. If you can bring up the lower half of the team, that may be a net win, even if it brings down the best one on the team. The effect of that may be that the best programmers leave the team, though...
- gmfawcett 5y agoIf the skill difference among your devs is really high, it may be preferable to have the best programmer leave, or at least change roles (architect, team lead, trainer), as this may increase productivity of the median workers. At least the skill difference should be treated as a risk and properly mitigated.
- zasdffaa 5y ago> or implement the same function N times over to support the different numeric data types Did you consider using a preprocessor or suchlike
- lliamander 5y agoThen you wouldn't really be programming in Go. You'd be programming in whatever franenkstein's monster of a language your preprocessor is using. Preprocessors are a code smell, and indicate that the language you are using lacks the right abstractions for productive programming.
- zasdffaa 5y ago> and indicate that the language you are using lacks the right abstractions for productive programming. Indeed go did not have generics, in fact that's explicitly stated in the post I was responding to: "at the time the lack of generics made it so that you either had to use reflection - or implement the same function N times over to support the different numeric data types" So, you unthinking prat, what do you recommend he should have done, carried on coding much near-duplicate code by hand or get the computer to do the repetitive job infinitely faster and more safely? HN is riven with plodders who just spew out memes like "Preprocessors are a code smell" or "correlation is not causation" with a relentlessness that would make Sisyphus say, 'well, you know, at least I'm not him'.
- lliamander 5y ago> So, you unthinking prat, what do you recommend he should have done, carried on coding much near-duplicate code by hand or get the computer to do the repetitive job infinitely faster and more safely? No, my recommendation would be to use a different language that doesn't need a preprocessor. Use any more insults and I'm just going to flag you.
- zasdffaa 5y agoYou don't get always to choose your language, and even then there will be stuff that needs automated cut & paste at a level that the language can't provide (even down to the lexeme level). Which is why I use generated code for my C# work. I use python rather than a preprocessor but either would do. Prepros and code generation in general are just tools, no more nor less, and not good or bad intrinsically. There is no code smell from using these. The bad smell comes only from misusing them.
- lamontcg 5y agoIf you need to use Vectors and Quaternions then Go isn't really for you either. The lack of any ability to do any operator overloading or writing arithmetic types along with the lack of parameteric polymorphism means you wind up doing stuff like Q.VectorMult(v) instead of just Q * v. Somewhere there's one of those "Go Koans" about how languages should allow programmers to easily express their intent, which I think the latter covers much better since nobody writes mathematical texts/articles using method notation. Meanwhile Go has that whack and almost useless complex type built into the language because Rob Pike pulled it out of the ANSI C book and figured that was all the Engineers at Google would ever need to use, or something. But users can't write types like that because they can't be trusted with that much power I guess.
- usrn 5y agoI kind of like making that a method since matrix products are not associative.
- lamontcg 5y agoYou can determine that by the ordering of Q * v vs. v * Q though just like on paper or in any book. The method syntax isn't doing anything for comprehension. (Although it could really use a transpose operator as well and proper row and column vectors, but gamedevs are filthy savages)