6 ms·
As with all of these posts, the big reason is never really written: "I just wanted to learn a new language" Now, the points they've made are valid, Go concurr
by KaiserPro 4y ago
As with all of these posts, the big reason is never really written:
"I just wanted to learn a new language"
Now, the points they've made are valid, Go concurrency beats the pants off python, and with gofmt, there is less of a debate about style.
Te bit about finding a team is pure horse cock. As they point out there are a bunch of C++/C programmers about. There are even more python programmers too. Go is a tiny pond compared to the big three (c, java, python).
- gkop 4y agoFor those of us not deeply familiar with Python vs Go, can you share a bit about why gofmt is so much better than the Python status quo (IE what’s wrong with autopep8 mentioned in article?)?
- snorfalorpagus 4y agoI don't think there is a status quo. There is choice between autopep8, yapf (which itself supports 4 different styles), black, and maybe some more I'm missing. With languages that have a built in formatter this isn't an issue.
- gkop 4y agoWhat’s the material consequence of this lack of uniformity? When a new Python developer joins a team, is it painful or costly to accommodate their stylistic preferences? I see a single standard as a nice to have, but as long as the language has adequate tooling with reasonable defaults and quality linting, this just doesn’t seem like a big deal. Curious to learn first hand experience of those that switched from Python to Go…
- BobbyJo 4y agoThe biggest issue I've felt with Python formatting is you run into build/versioning issues that basically never happen with gofmt. Also, some tools don't do everything you need, and you need multiple, like having to combine isort and black.
- prepend 4y agoI’ve found it’s nice for detecting people who care about unimportant things. I can’t imagine ever picking a language based on this feature and seems weird to even mention it. This has never caused me a minute of headache and the only time I care is when conflicting styles are used in the same file. I always thought it was kind of dumb of Go to care about this but don’t care enough to affect my language choice. I don’t use Go but am open if it’s a fit for a project. I like that Python has that variability and let’s developer make decisions as they see fit. I don’t want to talk to people about tabs and spaces unless we’re already friends and having a few beers.
- gkop 4y agoIn candor I dabbled in Go in 2016 and found the community leaders arrogant and rude. I hope the community has evolved since then to expect more from leaders, but would need to see evidence of this before touching Go voluntarily again.
- theshrike79 4y agoI've used a good dozen languages and I don't know the "community leaders" of any of those.
- deleted 4y ago[deleted]
- sliken 4y agoGo has one, the same one used by the compiler, so there's no arguments, no multiple standards, etc. Python has a few options, and when a new language feature comes out the time to implementation may vary. Think of it this way, if you could all the python code on github and ran it though autopep8, what fraction of the files would be changed? Generally in the go community, contributions, patches, code, etc that's not formatted with gofmt is considered wrong/broken.
- gkop 4y agoThanks! More curiosity: How do humans that disagree with the One Format deal with it? Do they self-select away from Go? > Think of it this way, if you could all the python code on github and ran it though autopep8, what fraction of the files would be changed? How does the format evolve over time as the community discovers improvements (if it does), and what are the implications for code on github?
- theshrike79 4y ago"Gofmt's style is no one's favorite, yet gofmt is everyone's favorite." - Rob Pike This pretty much sums it up. Gofmt isn't perfect, but everyone uses it and deals with it. It's included with the language so there's no point in trying to create a "competitor".
- sliken 4y agoGenerally I think most agree that gofmt makes pretty good decisions and it's better to have one format than competing formats that make it ugly when someone joins the team, or you are importing a library. The more you read code the nicer it is to have it all in the same format. Like much of go, there's the "go" way to do it, and the language simplicity reduces the chance of multiple programmers taking multiple approaches that are all different enough to require wrappers to interoperate. Sure your pet feature from some other language may be missing. The language (and gofmt) have evolved. In particular since the parser is externally usable (by gofmt, IDEs, and other tools) you can actually use that tool to rename variables, functions, etc without having to worry about getting a REGEXP right. So when there's the occasional incompatible change gofmt can parse code into a tree, make a transformation, and then back info code ... including comments. It's relatively common (in my experience anyways) to have commit hooks in git run gofmt on go code. Generally go's been very compatible, none of the issues like Python2 vs Python3. I'm sure some avoid go for these reasons, but I lump them in with folks that reject python because of whitespace/indenting.
- spapas82 4y agoNowadays black is a defacto standard in python formatting.
- throwaway894345 4y agoBlack is awesome for the Python ecosystem, but it's still painfully slow for large files compared to gofmt.
- Spivak 4y agoHow large is large because I don’t think I’ve ever even noticed black’s delay on 10k files.
- throwaway894345 4y agoIt would pause for a few seconds on 1-3kloc files on a fully loaded 2019 macbook pro.
- philwelch 4y agoautopep8 isn't deterministic enough. If you were going to autoformat your Python you'd want to use Black, which has the same philosophy as gofmt.
- tech_tuna 4y agoYou down with RDD?
- BobbyJo 4y ago> "I just wanted to learn a new language" and > finding a team Are connected. More people out there would be willing to work in Go than Python, even if more people know python. First, a large portion of python writers aren't backend devs, whereas pretty much all Go users are. Second, Python has a very bad rap as a backend language, and for pretty good reason. Third, if someone doesn't know Go, then can still get up to speed and use the language extremely proficiently within a few months, unlike any of the other languages you listed.
- KaiserPro 4y ago> if someone doesn't know Go, then can still get up to speed and use the language extremely proficiently within a few months Which combined with a new code base is very stressful. but this avoids the main point, which is > Python has a very bad rap as a backend language, its not a front end language really(discounting the transpiled JS web stuff). I know people dont like it, and that's fair enough, but its as good as virtually any other language for "backend stuff". Its perfectly possible to write low latency high scaling code in python, just as it is in go and rust. Despite what people say, code is just a logic brush, how you hold it, and how toy paint with it determines how pretty the picture is. Yes there are inherent defects that each language has, but once again part of being proficient is know how not to blow your feet off. If Goethe can make wonderful prose in german, you too can make good scalable backend code in python.
- BobbyJo 4y ago> Its perfectly possible to write low latency high scaling code in python, just as it is in go and rust. Depends on what you mean. A tiny and simple HTTP handler brought up on lambda, sure, Python will be as good as anything else. Anything larger than that, and no, it isn't. Python just doesn't have the semantics to do what Go and Rust can at scale. I run a service that uses 4 threads in Python and it's horribly slow and unreliable. I worked on a service in Go that used hundreds of concurrent go routines and it was reliable as hell. > Despite what people say, code is just a logic brush, how you hold it, and how toy paint with it determines how pretty the picture is. That's a great analogy when you consider painters use different paint brushes for different parts of the job. > Yes there are inherent defects that each language has, but once again part of being proficient is know how not to blow your feet off. If Goethe can make wonderful prose in german, you too can make good scalable backend code in python. Sometimes yes. But accomplishing the same in Go is so much easier I don't know why you'd bother.
- throwaway894345 4y ago> Te bit about finding a team is pure horse cock. As they point out there are a bunch of C++/C programmers about. There are even more python programmers too. Go is a tiny pond compared to the big three (c, java, python). If you can program in any language, you can program in Go. There's so much less to learn than even Python (perhaps especially Python when you consider all of the different packaging tools, testing frameworks, sync vs async, decorators, metaprogramming, etc).
- tbarbugli 4y agoco-founder and CTO of Stream here. I did not write the article but I was very involved with the decision process. Your assumption is wrong, we did not pick a different language just for fun or because we wanted to learn something new :) Python was just not the language we needed for our APIs, we tried hard to make it work but eventually we looked at alternatives that would allow us to keep things simple and performant. End result was better latencies, a much simpler architecture (less async/MQ work) and processes that would eat a fraction of RAM and CPU compared to Python.
- distracted_boy 4y agoAre you using Go's http library or are you using some other framework?
- tasuki 4y ago> As with all of these posts, the big reason is never really written: > "I just wanted to learn a new language" Strong disagree. If the actual purpose was learning new things, they'd have chosen a language which does things a little differently than all of the mainstream. At least Haskell or some Lisp... The fact they chose Go shows they care primarily about the practical side.
- MathCodeLove 4y agoThey didn't say they wanted to learn new things, they wanted to learn a new language. I can want to learn how to drive a race car in addition to my Toyota Corrola without wanting to lear how to operate a crane (though that would be pretty interesting honestly).
- tasuki 4y agoWhere is the joy of learning a new language if not for learning new concepts? It just does not make sense to me. Learning a new standard library and build tools and all that stuff? Is that much fun? People want to learn a new language for reasons: perhaps they want to learn new concepts, perhaps they want a language that's faster, perhaps they want a more mature ecosystem, perhaps they want to increase their employability. There aren't people who "want to learn a new language" as their ultimate end goal.
- MathCodeLove 4y agoMaybe go is faster than any other language they've used? I'm not contending the fact that they have a reason for wanting to learn go as that new language. Just that your claiming they clearly weren't interested in learning since they didn't choose some esoteric language is fallacious.
- tasuki 4y ago> Maybe go is faster than any other language they've used? Quite possibly! That would be consistent with my point that they chose Go for practical reasons, rather than to learn for the sake of learning, as KaiserPro was suggesting. If you want to learn for the sake of learning, you'll learn a different paradigm, rather than rehash the same thing with a slightly different flavour. Also probably your productivity will tank.