14 ms·
I don't share some of the opinions I see in the comments here. I've recently started programming in Go and I am having a blast. Plus, I am making my systems fa
by joaodlf 10y ago
I don't share some of the opinions I see in the comments here.
I've recently started programming in Go and I am having a blast. Plus, I am making my systems faster and simpler with Go. I love concurrency in Go. I love the concept of Goroutines, the simple and intuitive use of Select. Channels still present a few mysteries here and there... But I'll get it at some point.
But the n#1 thing for me in Go is: It's written in Go. It's refreshing to drill into the language details, I feel like I have learned so much from seeing the Go source code (and having it readily available with a Ctrl+click in VS Code).
Maybe it's because I don't have the "depth" of some of the HN users, but Go feels great to me.
- jrs95 10y agoEspecially when compared to working with something like Spring Boot every day it's fantastic. Getting rid of all the bloat is a bigger win than any of its unique features in my opinion.
- Scarbutt 10y agoComparing Go directly to Spring Boot? ;)
- hepta 10y agoWhat are your problems with spring boot? What bloat are you referring to?
- jrs95 10y agoI suppose most of my negative experiences with it are specifically in the context of using it to build microservices. The memory usage alone created a bit of a problem, I ended up using nearly all of my 16GB of RAM when I had to run many services simultaneously. And because the functionality of any given service was fairly minimal, there really wasn't a need for a framework like that. The autoconfiguratuon was also a bit dangerous. Since any dependency could cause any other dependency to reconfigure itself, it made it difficult to determine why things would break at times. At one point one of our libraries that used RabbitMQ behaved differently in some other services because another dependency saw RabbitMQ on the class path and started trying to use queues that didn't exist. Someone spent a day and a half figuring that out because the error was being swallowed by something else so the application was just failing to start with some crypic error. And when autoconfiguration wasn't enough, you'd sometimes find yourself needing to write dozens of lines of Java to do something as simple as connecting to a second database. In general I found we tended to have less predictable or obvious behavior in our Spring apps, and they tended to be more likely to fail at runtime than I would've liked.
- deleted 10y ago[deleted]
- Qerub 10y agoI usually get rid of @EnableAutoConfiguration and then selectively import the auto-configuration classes I actually want with @ImportAutoConfiguration.
- twic 10y agoA Spring developer once mentioned, on a mailing list post i have long since lost, that the autoconfiguration stuff is pretty much demo-ware. It's good for getting a simple app up and running fast, but for anything serious, you should import the configurations manually, exactly as you say. Fortunately, that's an easy enough transition to make at any point in a project's lifetime.
- jrs95 10y agoI don't think I'll be working with it again in the near future but I'll definitely have to keep that in mind in the future.
- cs02rm0 10y agoFor me, I imagine the dropwizard guys sat round asking each other what the best servlet container is, web MVC tool, ORM, DI framework, etc, etc. and they choose the very best they can think of for a dev to work with. Then a couple of years later that company comes along where they ask the same questions and but there's a guy with Tourette's in the corner and Every. Single. Time. the answer to the question is SPRING!! SPRING!! SPRING'S THE RIGHT ANSWER!! SPRING! From the moment you boot spring boot and discover how much longer it takes to boot it's a struggle not to question the motivations of a place where the answer's the same no matter the question. Sorry. I know some people love it!
- twic 10y agoActually, in that company, the answer isn't always Spring Boot. Sometimes it's Cloud Foundry.
- johnydepp 10y agoI love spring boot. And I like golang as well. Spring might look bloat in the start, but it's powerful. At present there's no framework in golang which has so much power and freedom...
- rhodysurf 10y agoYeah i love go and i am a C++ and Fortran dev by day. For me go just gets out of the way, and its just so easy to build actual things quickly. AND you get a static binary out of it which gets rid of the deployment issues with python.
- rpercy 10y agoI'm with you. IMHO, Go's simplicity is its biggest virtue. It has fostered a community that values consistency and clarity over syntactic sugar. And, as a result, I find each new codebase extremely accessible.
- IshKebab 10y agoDefinitely. Simplicity, and fantastic standard library. Go is like a much faster and more reliable version of Python. People comparing it to C++ and Rust miss the point.
- vvanders 10y agoNormally it's the other way around, Go gets compared to other "Systems Programming" languages because somehow services got lumped in with that name over the last few years. To me they're very discrete things, if you can't manually manage memory(raw pointers and the like) then it's not a System Programming language.
- niftich 10y agoGo gets compared to "systems programming" languages because its designers specifically intended it to be used as such [1][2], albeit the definition of 'systems' they are using is deliberately evolved from the original shade of meaning as suggested by low-level languages that are sometimes deemed to be for 'systems programming' to illustrate that the nature of environments has changed, and a new approach is advantageous. [1] https://talks.golang.org/2012/splash.article https://talks.golang.org/2012/splash.article [2] https://golang.org/doc/faq https://golang.org/doc/faq
- vvanders 10y agoIf its a "new environment" doesn't imply that it can't be systems programming? I totally agree that Go is fantastic for services and networked things.
- 10y ago
- cyri 10y agoSame here! I code Go for ~3 years in my spare time and PHP only for hard bucks
- deleted 10y ago[deleted]
- bmurphy1976 10y agoGo is a really good git-r-done tool. There's nothing wrong with that despite what some would have you believe. Our internal dashboard is Elm but the back end is mostly Go. Both have their pros and cons but both work. That's more than I can say for many other dev tools.
- thewhitetulip 10y agoI agree with you, I didn't know how to build a webapp, two years ago, I learned the basics and implemented a fully working webapp in Go along with the REST client, all without having to buy a single book, the docs are amazing, the community is amazing and the language made me build things fast, I love GOPATH, I love gofmt. Apart from the tooling, I felt as if I have been writing Go since a long time, even though I was just a newbie, my app: http://github.com/thewhitetulip/Tasks/ http://github.com/thewhitetulip/Tasks/ I also wrote a tutorial for newcomers like me: http://github.com/thewhitetulip/web-dev-golang-anti-textbook/ http://github.com/thewhitetulip/web-dev-golang-anti-textbook...
- spraak 10y agoI am really glad for that guide. I came across it last week and really appreciate the methodology (i.e. an anti-textbook) thank you for that.
- thewhitetulip 10y agoThank you for your kind words! I am happy that you like it, I am writing a series of guides on vi, python, git and probably bash along with their YouTube series, you can find them here http://github.com/thewhitetulip/multiversity http://github.com/thewhitetulip/multiversity
- pythonist 10y agoI completely agree. Go made me enjoy programming again.
- chimeracoder 10y ago> Maybe it's because I don't have the "depth" of some of the HN users, but Go feels great to me. I've been writing Go full-time as my primary language for nearly five years. Before that, my languages of choice were Lisp[0] and Python, with R as a very distant third choice[1]. I have always been a polyglot and enjoyed experimenting with any new language I could try out - you'd be hard pressed to name a non-esoteric language that I haven't written more than a "Hello, World" in at some point. I still write other languages and appreciate them for what they are, but Go is what I reach for when I need to crank something out. The language gets out of my way and doesn't distract me - and as an added bonus, I can be reasonably confident that I can quickly refactor the code 6 months later and still have it run[2]. Go is not a scripting languages, but I sometimes even write small applications in Go that I would have previously written as shell scripts, just because it's easier and less thorny than remembering to avoid all of the pitfalls of shell scripting. You might say that this is because I've been writing the language for so long - and yes, I'm definitely more comfortable with it today than I was in 2012. But everything I just said was still true even when I was only a few weeks into learning the language. It was like putting on glasses for the first time in my life - yes, I could "see" before, but somehow everything was just a little bit crisper, and I felt incomprehensibly more powerful and capable when writing Go compared to Lisp, Python, Scala, Java, Perl... despite having far more years of experience in those other languages. If some people don't want to use Go, that's fine with me. But I strongly reject the criticisms that Go is meant for "mediocre" programmers, for programmers without experience in functional languages, or somehow an inferior language because it lacks feature X or Y from language Z. [0] Common Lisp (via SBCL) or Racket, depending on the project and collaborators [1] It's a language with a lot of warts, but even Python couldn't touch R for completeness in statistical libraries. [2] Seriously, I have never found a language that made refactoring as easy - or, dare I say fun? - as Go.
- maehwasu 10y ago> Seriously, I have never found a language that made refactoring as easy - or, dare I say fun? - as Go. Sounds like someone's ready for Haskell.
- cookiecaper 10y ago>If some people don't want to use Go, that's fine with me. But I strongly reject the criticisms that Go is meant for "mediocre" programmers, for programmers without experience in functional languages, or somehow an inferior language because it lacks feature X or Y from language Z. I think such complaints are the predictable backlash that's correlated with the final stage of its hype-cycle. Tech hipsters always need a hot new thing to tout so that they can pretend to know what they're talking about. Now that we have a new iteration of hyped languages in Swift, TypeScript, and Elixir, Scala, Go, and node.js are on the hipsterdom downtrend (which often also means they're on the mature user uptrend). That prior generation of languages are now at least semi-widely known, so they no longer serve the purposes of the talentless hipsters, who base their self-worth on the esoteric nature of their preferences and need something that most people don't yet know much about to hide their ineptitude. I think Python is a great example of a community that built a real niche for itself and legitimately earned the respect of mature, senior engineers by repeatedly proving and improving its utility and stability for many years. Giving Go the opportunity to develop this same type of sustainable, consistent, healthily growing ecosystem without a flood of 0.1x programmers and other hipsters is really the best thing for it. I'm optimistic for Go in the long term.
- sametmax 10y agoI don't know. I feel like if I need something productive, I would go very high level like Python. In the VERY rare case Python is too slow, I would go really low level like rust. I don't see the interest for something that not really low level, but not realy high level either like Go. If concurrency is the main issue and is the niche I'm targeting, I would go Erlang or Elixir. I have a hard time finding any use case for Go.
- oscargrouch 10y agoFor me Go is the goto language for usecases where Python and Java were used. Python is great for tooling, and Java was the primary language for the backend. So now, whenever i think about tooling or backend, Go is the primary answer, because its good in both paradigms. The other languages i use is C++, and Swift, each one with their own niches. C++ for complex machinery, that requires more control and integration with other libs, and Swift for general applications, specially the ones that are user focused. In my case, i cant find a niche for Rust. And thats because C++ is already covering that ground for me. I can see why i would use Rust instead of C++, but in the majority of cases where i use C++, there are huge complementary source code already in C++, making the effort to code everything in Rust from scratch, a complete nonsense. So for me the language in "limbo" right now is Rust. (and i dont think that people with big C++ codebases would rewrite in Rust, because there's little advantage, at least compared to modern C++)
- steveklabnik 10y agoOne nice thing about the "rewrite C++ in Rust" is that oh can do it incrementally; we're taking the same approach for Firefox, for example. Out of curiosity, what are the libraries in C++ that you miss in Rust, or would have to re-write?
- oscargrouch 10y agoFor me C++ (or Rust) would be the languages to go for Browsers, VM's, Compilers, Game Engines, Glue Code for a OS(platform layer to prepare things for a app to run) etc.. The problem is, there's a lot of code in C++ already for all of this. V8, Dart, Java Vm's in C++, Webkit, Chrome, Firefox in C++, great game engines in C++. Is not that i wouldnt use Rust.. on the contrary. But the problem is, for the usecase i think Rust would be very good, there are a lot of code in C++ already, that would require a effort of years to port in Rust. For instance i work in Chrome C++ source a lot.. and the codebase is a beast. Maybe if, in the future, things that are starting now in Rust, will be the the successful cases for this kind of machinery. But given that, at least i, wouldnt use Rust to make a webserver backend (the same way i wouldnt use C++ for that), because i think its overkill. While i like Rust, i cant see a opportunity to use it, and the great impediment for that, is the C++ codebase legacy, and both languages basically competing for the same paradigm. But theres a great thing in favor of Rust, because its the only modern real contender to C++. But i think it will be a slow and harsh competition (albeit a necessary one).
- markwolfe 10y agoI really enjoy programming in golang, having recently taught quite a few people the language I am forever thankful for its simplicity. This paired with vscode + click to see other peoples code is a great platform to get started with systems programming and tools development. Can't thank the go developers enough.
- AsyncAwait 10y agoI also enjoy it, but just wanted to note that Go is not really a systems programming language, unless you mean "cloud/network systems".
- tejasmanohar 10y agoYeah, systems programming != distributed systems. I think Rust is a better example of a modern "systems" language.
- seagreen 10y agoMaybe it's because I don't have the "depth" of some of the HN users, but Go feels great to me. I doubt I have any more depth than you as a programmer, but I've gone one step farther than you down the language safety progression, so maybe my thoughts from here will be interesting. When I moved from Python to Go not only did my code become more safe, I actually became a better programmer. There are a lot of silly things that you can do in Python that you can justify saying "just this once!" or "it's only temporary!" that are much harder to do with Go. I started writing a lot less complicated functions that did different things with different types, and moved to writing simpler, single purpose functions whenever possible. This was great and I learned a lot. Then I moved from Go to Haskell, and the same thing happened again. Haskell makes you specify whether a type can be null or not. It has referential transparency, so you can't mutate variables as a side effect of a function. It has sum types, eg: data User = Unauthenticated | Normal UserId | Admin UserId .. that make it really easy to enforce invariants and are also super convenient to use because of pattern matching. I write a lot less "stringly typed" code now than I did when using Python or Go. Now there are downsides -- Go has a great standard library, and it's tooling is fantastic (even down to little things like gofmt). I'm not saying you'd have a better experience with Haskell, just that there are real reasons why someone wouldn't want to go back after trying a more featureful language than Go.
- hota_mazi 10y ago> When I moved from Python to Go not only did my code become more safe, I actually became a better programmer. This is probably more due to the fact that you moved from a dynamically typed language to a statically typed one rather than this new language itself.
- chias 10y agoNot sure why this is being downvoted without comment, considering that it is what accounts for the example that the parent comment chose.
- dvirsky 10y agoBut Go really does encourage good practices. I came to Go after programming in C, C++, Java and a bunch of dynamically typed languages. After a couple of years with Go I returned to C (and a bit to Java). And I'm writing better code in those languages now. Now, part of it is natural progress probably. But especially when I'm writing C, I can tell that I'm writing it much better than before because I'm adopting back some idioms that Go encouraged me to adopt in the first place. Also, because Go's standard library is so well written, you can learn from the best very easily, and understand what's going on. It's certainly not the case with other languages I write in.
- niuzeta 10y ago> and having it readily available with a Ctrl+click in VS Code I haven't used VS Code since the beta, but it can do that now? Wow. I should give it a try.