3 ms·
You either "get" Go or you don't. Which shouldn't be surprising given that it is a very opinionated language. A diagnostic indicator is whether you gravitate t
by bkeroack 11y ago
You either "get" Go or you don't. Which shouldn't be surprising given that it is a very opinionated language.
A diagnostic indicator is whether you gravitate towards things like Martini or Gin, which aren't idiomatic Go and seem designed to ease the pain of using Go for those who don't actually care for it much.
- lobster_johnson 11y agoBut it's possible to "get" Go and also disagree with its design decisions.
- spotman 11y agoCurious your opinion on what you would advise if not Martini or Gin? I love martini (and lately gin) and definitely love and use go every day. What about these frameworks is not idiomatic go? Is there another framework that is? Or you suggest just rolling your own using net/http by itself? Cheers
- kornish 11y agoHere's a great blog post by the author of Martini about why, after he had gained experience in Go, he came to realize that Martini isn't very idiomatic: https://codegangsta.io/blog/2014/05/19/my-thoughts-on-martini/ https://codegangsta.io/blog/2014/05/19/my-thoughts-on-martin... tl;dr - Martini doesn't have a strict, type-safe API. Overuse of reflection leads to a small performance loss but a much larger, much more important cognitive tax.
- jonesb6 11y agoI remember awhile ago Martini used to have a large performance hit that Gin didn't. I think it had something to do with the url multiplexer, wouldn't be surprised if it's since been fixed but it was the reason I initially chose Gin when I first started writing Go.
- elithrar 11y ago> I think it had something to do with the url multiplexer "Slow" in the case of a router/mux is entirely relative though. There's been this strange focus on routing speed/allocations, when its the smallest slice of your total request-to-response performance. Martini's router won't make your application noticeably slower than any other.
- Meekro 11y agoAfter a day of writing Go, I certainly gravitate towards martini and gin!
- matthewmacleod 11y agoI see what you're saying, but I absolutely "get" what Go is doing – you're right that I don't care for the idiomatic approach that much! I have enjoyed the gin API. In maybe 10 lines of code, I can build a fast HTTP service that can serve up a small single-page app. The same thing using e.g. Negroni feels like I'm writing more boilerplate for no apparent gain – and I'm a great opponent of writing boilerplate code.