10 ms·
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
by lairv 2y ago
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 personal projects, I get no fun out of using it
- Spartan-S63 2y agoI agree with this take. I find Rust a more exciting language from a personal project perspective—and it's what I go with even when it doesn't make 100% sense. Go is fine, though, and works well in a team environment. It's just clunky, but clunky in a productive way.
- HKH2 2y agoRust-script + cmd_lib = scripting using shell, and converting it to Rust when I want performance. I know it might sound dreadful but it works well for me, especially without an internet connection.
- stuff4ben 2y agoDamn, everything new really is old again. Everyone said the same thing about Java. Yet it still works and gets the job done. Go does as well. I'd rather poke my eyes out with a nail than use Python.
- the_gipsy 2y agoDo you write Go for fun as hobby, or do you agree with the OP?
- stuff4ben 2y agoI don't program as a hobby or for fun anymore. It's my job and I do it, then I go home and do non-programming there. I use Go and Java and occasionally Python if I have to. I do agree with the OP though.
- matwood 2y ago> I'd rather poke my eyes out with a nail than use Python. Glad I'm not the only one. Every time I'm forced to use Python I cringe. What version disaster and I'm going to run into today? The 2->3 transition happened a long time ago at this point and I still run into lingering effects. Also, for short 'script' like things Python doesn't feel any quicker or easier to write. Go is my Goto (hehe) for short scripts. And while I'm ranting, I'll also say that modern/latest version Java is also really nice.
- quibono 2y ago> The 2->3 transition happened a long time ago at this point and I still run into lingering effects. Interesting. I read about this a lot and I feel like it's a gimmick at this point. What lingering effects of the Py2->Py3 transition do you run into?
- maccard 2y agoI would rather go had real enums, and I would _prefer_ if there were sum types. I agree it's more verbose, but I don't find that that verbosity really bothers me most of the time. Is res= [x for x in foo if "banned" in x] really actually more readable than var result []string for _, x := range foo { if strings.Contains(x, "banned") { result = append(result, x) } } ? I know it's 6 lines vs 1, but in practice I look at that and it's just as readable. I think go's attitude here (for the most part) of "there's likely only one dumb, obvious way to do this" is a benefit, and it makes me think more about the higher level rather than what's the most go-esque way to do this.
- aaomidi 2y agoThe new lines were eaten so it does make the python version more readable but I agree with you.
- maccard 2y agoThanks - updated!
- randomdata 2y agoGo has real enums. All an enum does is count. You're probably thinking of value constraints? Or, perhaps, exhaustive case analysis? Go certainly lacks those future. And, indeed, they sound like nice features, but, to be fair, not well supported in any popular programming language. At best we get some half-assery. Which always questions if the popular languages are popular because of their lacking type systems?
- maccard 2y agoThis topic has been beaten to death, and being pedantic about the definition of an enum to say "actually go has them" isn't helpful. There are dozens of articles from the last decade which explain the problems. Those problems don't exist in plenty of programming languages. No language is perfect, but go's particular set of bugbears is a good tradeoff
- kjksf 2y agoSo 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.
- lairv 2y agoclass A: def __init__(): pass def f(self): pass def g(a: A | None): a.f() (edit: I don't know how to format code on HN) If I activate type-checking in VS Code this will highlight an error, although the python interpreter will indeed try to run it without compile time error As I said, for my side projects this is enough for me to model my problems properly without having to resort to multiple hacks And I took Python as an example, I also enjoy using Ocaml and Rust
- steveklabnik 2y ago> I don't know how to format code on HN two spaces: https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc
- mapcars 2y agoMypy supports those for like 3-4 years already
- xigoi 2y agoPython is dynamically typed, so everything is a sum type.
- RandomThoughts3 2y agoThat's why I love Go so much. You want to write a very clever library using elegant abstraction and generics to have a cool innovative interface to solve your problem? Tough luck, you can't. So instead, you will just have to write a bog standard implementation with for-loops and good old functions which you will have to copy and tweak as needed where you really need something more complicated. It will work perfectly fine and end up being very readable for you and for the other persons reading your code. Go is basically anti-Haskell. It forces you to be less clever and that's great.
- GaryNumanVevo 2y agoTake a look at a JSON parser or ORM written in Go. It's god awful the things they have to do to work around Go's type system. The average developer won't see these things, they're typically just writing glue code between Go's great stdlib (which also contains wild things if you take a look) and other 3rd party dependencies.
- lpapez 2y ago> The average developer won't see these things, they're typically just writing glue code between Go's great stdlib (which also contains wild things if you take a look) and other 3rd party dependencies. This is what most of us are doing every day, and exactly what Go excels at.
- kamov 2y agoSum types allow for more robust modeling of the API boundary in libraries, so in fact having a better type system is desirable even when "just gluing libraries", because it can make incorrect program states physically unrepresentable.
- mplewis 2y agoSum types are great – but Go manages to be unreasonably effective even in their absence.
- deleted 2y ago[deleted]
- georgeecollins 2y agoI feel like autocomplete has reduced the problem of verbosity for all languages. And if I am writing something that is going to have to be supported a lot I want something that is very explicit and easy to read. For me that is the "verbose" languages.
- cortesoft 2y agoThis is exactly what I was going to say... ever since I started using Copilot, verbosity bothers me a lot less. It isn't painful when I don't have to type/copy/etc most of it.
- robinsonrc 2y agoI feel the opposite way about this, and find this kind of verbosity reduces the signal to noise of the intention behind the code
- AtlasBarfed 2y agoFor personal stuff I use use groovy. Has the jvm and jdk and all the associated jars /library ecosystem? Has tons of really good stuff from python/Ruby Typing is optional so you can get full speed, static typing, but you can go dynamic when you need it. That said, it's basically a deadend language career wise.
- _xiaz 2y agoI'm in the same boat. I believe it's a matter of taste mostly. We prefer expressiveness and power, other prefer simplicity of semantics and verbose code
- cies 2y ago> lack of proper enums, lack of sum types, no null safety etc I miss the same for work. I wonder how long it will take for Go to be the new PHP. Zealotism is through the roof. I read here people say "lack of proper enums, lack of sum types, no null safety" is a good thing. I read here people say "you can do anything with Go". It's simply not true, and very uninformed. I wish everyone a good experience with their lang of choice.