7 ms·
In the last 3 months, we have built the new version of our API in Golang, the old one was in rails. The api serves a mobile app and a web app. Despite taking l
by pcx 8y ago
In the last 3 months, we have built the new version of our API in Golang, the old one was in rails. The api serves a mobile app and a web app.
Despite taking longer to build, it's a treat to work on Golang. The explicit error handling and static typing have made our code much more reliable, with a lot less unit/integration tests required. Concurrency is dead easy to understand and build over. We are OK with using dep, definitely miss a debugger or an REPL. Having generics would make it much easier to write code. But overall it was worth it. Our response times are much lower now with a lot less server nodes required.
- iends 8y agoDid you consider Java?
- vthallam 8y agoNot op, but I don't think people would want to go from Ruby to Java. I was working on Java before I was a Go dev, feel, Java is too verbose. Go is so simple to start with and you don't need "frameworks" for deploying a production quality microservice.
- oblio 8y agoModern Java is pretty cool. You can you use a mini-framework inspired by stuff like Sinatra/Flask, for example Dropwizard.
- brianwawok 8y agoI moved dropwizard to Django. Life is too short to generate setters.
- letientai299 8y agoWhy generate? Why not Lombok?
- brianwawok 8y agoWho cares, that is the least of the problems with Java ;)
- vthallam 8y agoI haven't used dropwizard, but used Spring boot extensively. While it definitely helps me move faster and write less boilerplate, it's still way too verbose relative to Golang. And talk about the build size, time and the fact that you could generate a build and run it bare metal anywhere.
- pjmlp 8y agoCompiling Java to native code has always been an option since the early days, via GCJ which sadly never got much love, and all major commercial JDKs. Nowadays there is Graal and SubstrateVM for those that rather not pay for compilers.
- deleted 8y ago[deleted]
- emluque 8y ago>We are OK with using dep, definitely miss a debugger or an REPL. I personally use Visual Studio with the go extension and delve and the debugger works quite well.[1] I believe that the Goland IDE also has an integrated debugger.[2] [1] https://github.com/Microsoft/vscode-go/wiki/Debugging-Go-code-using-VS-Code https://github.com/Microsoft/vscode-go/wiki/Debugging-Go-cod... [2] https://www.jetbrains.com/go/features/ https://www.jetbrains.com/go/features/
- justinclift 8y agoGoLand comes with Delve too, very well integrated. :)
- Tempest1981 8y agoDebugging in VSCode on macOS works too, using Delve.
- emluque 8y agoYes, I actually meant VSCode, hn doesn't let you edit comments after a while and I wasn't completely aware of the differences between Visual Studio and VSCode. I checked and I'm actually using VSCode (in ubuntu).
- purple_ducks 8y ago> definitely miss a debugger or an REPL Bizarre that a programming language designed by non first time language designers, backed by a multi-billion dollar company and used extensively throughout that company(by "new" engineers), doesn't have a world class debug story.
- weberc2 8y agoComing from Python, I've scarcely missed it, and I certainly wouldn't trade it for the myriad gains from switching to Go.
- dnautics 8y agoComing from python is somewhat of a low bar, compared to more modern and sophisticated PLs.
- weberc2 8y agoMaybe. I just meant that the debugger is a pretty big deal to Python developers, yet I don’t really miss it in Go.
- AlexCoventry 8y agoThe python debugger is great...
- weberc2 8y agoIt’s _fine_, but I rarely (almost never) find myself reaching for it. If I need the debugger, it’s probably a sign that I should be improving the logging so I can troubleshoot production issues. This is especially true in Go where the type checker gives you a lot of confidence that your code works before you run it.
- networkimprov 8y agoCould you define a view of "world class debug story"?
- hi41 8y agoHow are you able to write code without being able to set breakpoints, stepping in a function, do mouse over to see the value of a variable? Do you print values of variables when you need to?
- sdenton4 8y agoIt helps to write small functions with good interfaces and plenty of tests... The better your fundamentals, the less you need the debugger. (But, also, there's gdb and delve for debugging. So, do what ya wanna.)
- dana321 8y agoMany people write code fine without a debugger. Break your software down into smaller components and write tests for each of them.
- coder543 8y agoI personally almost never use a debugger with Go (or Rust), but it looks like you can get all of that functionality with VS Code using Delve: https://github.com/Microsoft/vscode-go/wiki/Debugging-Go-code-using-VS-Code https://github.com/Microsoft/vscode-go/wiki/Debugging-Go-cod... I found a video of someone debugging Go code in VS Code, and I saw them set breakpoints, step around in a function, and hover over a variable to see its value, in addition to the sidebar containing all of the values of all of the local variables and the stack traces.
- AsyncAwait 8y agoHuh? https://github.com/derekparker/delve https://github.com/derekparker/delve integrates nicely with many editors, including [1] and [2] and allows you to do exactly that. 1 - https://www.jetbrains.com/go https://www.jetbrains.com/go 2 - https://github.com/Microsoft/vscode-go https://github.com/Microsoft/vscode-go
- tigershark 8y agoImagine how much better would have been using a language with a proper sound static type system and ADT instead...
- tagrun 8y ago> definitely miss a debugger gdb works well with Go: https://golang.org/doc/gdb https://golang.org/doc/gdb