10 ms·
Get Your Development Team Started With Go
- dominotw 12y agoI setup my vim according to plugins described here[1] and go development has been a breeze ever since. 1. http://0value.com/my-Go-centric-Vim-setup http://0value.com/my-Go-centric-Vim-setup
- jzelinskie 12y agoYou can basically throw a bunch of that complexity away. This plugin[0] is and one-stop-shop for Go development in vim. [0] https://github.com/fatih/vim-go https://github.com/fatih/vim-go
- luka-birsa 12y agoGo Lang was a huge win for us in our server infrastructure. All high performant but hard to maintain C stuff got migrated to Go in 6 months and we never looked back. Code is much more managable, less debugging for memory management, much more readable and shorter by 60%. All that at negligable performance penalties. For us its a freaking story of awesome success. Go = ROCKS!
- easytiger 12y agoSo if you had started again in c or cpp you would have ended up with more maintainable shorter code too.
- chc 12y agoProbably, but also probably not on the same level. This doesn't seem like a very useful objection, both because it's obvious and because it's very weak.
- codygman 12y agoI wouldn't be so quick to dismiss something as obvious just because it is obvious to you.
- shurcooL 12y agoThis statement is only true if refactoring is not allowed.
- luka-birsa 12y agoProbably true. But it would take us longer, code base would be larger and still harder to maintain and more error prone compared to Go. It's a very old project and super important core technology - we did refactors before and I was somewhat scepitcal when lead devs on the project suggested to use Go instead for the next "refactor". I was blown away by the quality, speed and productivity. If you're building server infrastructure that needs to be performant, consider Go.
- pjmlp 12y agoPossible in all languages that offer native code compilers and are more developer friendly than C.
- general_failure 12y agoNot sure why you are getting downvoted. Without any more context by grandparent, the parent makes total sense.
- curiousAl 12y agoI wasn't aware you COULD be downvoted on HN? Is it just my Tampermonkey script hiding the downvote button or something?
- skrebbel 12y agoI believe that these days you need some secret threshold of karma (HN internet points) to be able to downvote. Now that you mention it, I have indeed seen way fewer power displays of the infamous "downvote mafia" recently, so I guess it works.
- libria 12y agoYou need 501 karma to downvote.
- wk_end 12y agoDid not downvote them myself, but because of the seemingly kneejerk cynicism, I would imagine. OP is simply praising Go and sharing a success story - there's no need to jump in and point out (with a somewhat condescending tone) that other languages offer similar benefits as Go. While (maybe) true, it doesn't exactly take away from Go's accomplishments or how it's helped OP. It's kind of like if I excitedly told my friend I'd run an eight minute mile, and she replied, "oh, so what? Lots of people can do that". Technically true, but unnecessary.
- libria 12y agoI didn't read that he was claiming this was exclusive to Go. I prefer we not require a dissertation defending language choice each and every time we have a short anecdote about our experience with it. Now if he said they had no such luck w/ Java/D/Rust, then perhaps I could understand your ultra defensive fanboi position.
- deleted 12y ago[deleted]
- mooreds 12y agoPretty good article on some of the challenges of getting started with Go. Certainly the package management issues point to Go's youth. I would have loved a more detailed explanation of why they chose Go for a particular problem space rather than C/C++/etc. What problems is Go particularly good for, and for which problems is it a poor choice?
- eliben 12y agoGood article! HN's reaction to Go reminds me of Stroustrup quote about C++: ..."There are only two kinds of languages: the ones people complain about and the ones nobody uses" So much complaining about how Go lacks this and that features of shiny new (and sometimes unfinished) language X. In the meantime, as time goes by it seems that more and more real companies use Go code in real production and are quite happy with it, despite all the shortcomings frequently listed here.
- deleted 12y ago[deleted]
- eudox 12y agoThanks for contributing to the gradual destruction of computer science.
- ecnahc515 12y agoGood thing production software deployment and maintenance has a much smaller focus on computer science theory than real world use cases. If all business decisions were based on pure computer science we might very well have much better software, but im inclined to believe we wouldn't have so many different and great products out in the world.
- pjmlp 12y agoNo, nowadays business decisions are taken where and what to offshore.
- emeraldd 12y agoThese are all considerations that should really be part of computer science in the first place. There's too much focus on the "Spherical Cow" part of writing software and not enough/any focus on how that software actually behaves at a modern scale/style of deployment. (At least in the curriculum I remember).
- eliben 12y agoHuh what? Care to elaborate?
- melling 12y agoI'm using DO to hack together some web pages to help me verify data for my mobile app. I'm thinking about building out the pages. However, at the moment I'm using a simple shell script to start. #!/bin/sh export PORT=8080 go run go/spanishdb.go go/Html.go Any good blogs on using Go in a production ready server? Should I run behind Apache?
- hedgehog 12y agoYour best bet is probably to put it behind nginx and use something like supervisord to launch the server itself and restart it if it panics (supervisor will also handle log rotation etc).
- MoOmer 12y agoHere here for supervisord watching Go behind nginx. I have this set up in production; even using the nginx tcpproxy plugin to reverse proxy some RPC servers.
- voidlogic 12y agoIf you want to run Go directly you can use setcap to run it on port 80, without having to run it as root. http://stackoverflow.com/questions/14537045/how-i-should-run-my-golang-process-in-background/14573592#14573592 http://stackoverflow.com/questions/14537045/how-i-should-run...
- NateDad 12y agoFYI, you don't need to run go behind anything, the http server can handle thousands of requests per second. Of course you can if you want.
- deleted 12y ago[deleted]
- knodi 12y agoPeople have been poopoo-ing Go lately on HN but let me tell you after using it in production for over a year. It really makes developers life easier. Why? 1) Error handling, Give you ability to impose defensive practices making network or another other I/O failures or unexpected responses from external or internal calls easy to handle. 2) A lot of errors can be caught at compile time. Which means less errors in runtime. 3) It so simple that all of the build in functions and syntax can be expressed in less than 16 lines. Makes reading your code and anyone else code very very easy. Also FMT is sick. 4) Dead simple concurrency. But all this has still not helped me push Go as the goto lang at the company I work for, why? Sometimes you work with people that just don't want any change. Give Go a try you'll be shocked how well its designed.
- Kiro 12y agoWhat's the goto lang at your company?
- Touche 12y agoGo is often judged (and praised) based on it's concurrency. But I use map/filter/reduce, etc. far more often than I use concurrency. So no matter how great the concurrency story is, having to use for loops all over my code makes my life much worse.
- kyrra 12y agoThis was actually fairly heavily discussed on the Golang mailing list a few months ago[0]. For now I believe the designers of the language would rather keep things as simple as possible. For something that can be done with a fairly simple for-loop, they would rather have you write that out. If there is certain functionality that requires a complex amount of code, the would consider adding either a package to help or changing the language if needed. [0] https://groups.google.com/d/topic/golang-nuts/RKymTuSCHS0/discussion https://groups.google.com/d/topic/golang-nuts/RKymTuSCHS0/di...
- Touche 12y agoThey make a very poor argument against functional programming. They completely miss the composability it enables.
- jzelinskie 12y agoI think the bit on managing dependencies could be improved with a bit more information about what other people have done. For example, SoundCloud maintains one monolithic $GOPATH in a single git repository that they can then selectively update. My personal preference to any flavor of the month Go dependency managers is gopkg.in[0], because it doesn't fool with the official tool chain (i.e. "go get", "go build"), but still allows for the versioning of packages. [0] http://labix.org/gopkg.in http://labix.org/gopkg.in
- sagichmal 12y ago> For example, SoundCloud maintains one monolithic $GOPATH > in a single git repository that they can then > selectively update. No, we tell developers to use a single $GOPATH on their machine, and check out/edit code directly in the canonical location, e.g. $GOPATH/src/github.com/soundcloud/foosvc
- emeraldd 12y agoHow do you handle a single developer working on multiple features/branches/issues at the same time?
- NateDad 12y agoThis is what source control is for. You switch to the branch and hack on it. In the rare case you need different versions of dependencies, you use a tool like godep (but if you have to resort to that, you're doing something wrong, your dependencies should have stable APIs). Don't use multiple spots on your hard drive for code in source control. Use source control for what it's made for.
- sagichmal 12y agoWhat NateDad said: > This is what source control is for. You switch to the > branch and hack on it. We're also running a microservice (SOA) architecture; each repo represents one service, with one (hopefully) tightly-constrained purpose. It's very rare that we're doing more than 1 or 2 feature branches in a repo at one time.
- tkubacki 12y agoI considered both Go and Dart for my new web projects - but as a former C# dev I'm too lazy to live without IDE (debugger intellisense etc) and ended up with Dart. Would love to see more tooling for Go to make it appealing for 'VisualStudio like devs'
- pjmlp 12y agoAt least Dart is a kind of modern Smalltalk with more respect for modern language features.
- voidlogic 12y agoCheckout LiteIDE: https://github.com/visualfc/liteide https://github.com/visualfc/liteide Binary downloads http://sourceforge.net/projects/liteide/files http://sourceforge.net/projects/liteide/files
- jalammar 12y agoCheck out IntelliJ IDEA with the Go Plugin. http://www.jetbrains.com/idea/ http://www.jetbrains.com/idea/
- cridenour 12y agoI recently documented [1] my efforts to get a great experience with VIM and Go. It uses vim-go of course, but also supports tags and neocomplete. [1] https://gist.github.com/cridenour/74e7635275331d5afa6b https://gist.github.com/cridenour/74e7635275331d5afa6b
- sytelus 12y agoThe problem with Go is that it wasn't designed to implement any large projects like C was. So the designers would typically make trade offs on perceived beauty and elegance rather than utility and potential pain in the real world. Another side effect of this is optimizing for compiler simplicity rather than optimizing for expressiveness of the language. It's easy to forget we build compilers not for compiler's sake but for its target user. Here's the quote from Go's history: we started off with the idea that all three of us had to be talked into every feature in the language, so there was no extraneous garbage put into the language for any reason. I would also argue C++ started in similar fashion but it went exact opposite route. The balance between minimalism and feature creep can only be achieved if you are designing language as a side effect of building your own large scale project combined with a sense of urgency. Go is currently a lucky language. There is a huge vacuum that Java has left after Oracle acquisition plus its prolonged stagnation. People who need compiled languages for their relatively new code base, Go would end up becoming their choice regardless of its shortcomings. People will enjoy its minimalism until code base grows to be monster and features starts becoming sorely missed. This is nothing unusual in world of programming languages. We have seen COBOL become a gold standard at one point and PHP is still pretty hot.
- NateDad 12y ago"The problem with Go is that it wasn't designed to implement any large projects" What? Uh no. That's exactly what it was designed for. Big projects at Google. It has been stated by the creators of Go multiple times. The simplicity of Go helps in many ways that are not immediately obvious. You always know how memory is laid out in a struct, so you know how much memory you're copying with every instruction. You always know when you're generating garbage, so you can take steps to avoid it when it matters. In general, everything your code tells the computer to do in Go is very obvious, so you can actually reason about what your code does on the small scale and not just on the big scale. And yet, it does this without the added unsafety of C, and without all the enormous complexity of C++. And it does that in a way that you just can't achieve with Java's "everything is an object". That's why people are flocking to Go. Because it has Java's ease of writing with C's ease of tweaking, and yet fixes a lot of the inherent problems in both languages.