4 ms·
Controllers and Views in Go
- joncalhoun 12y agoFull disclosure - I wrote this while learning Go, so there is a reasonable chance it isn't perfect. I'm all ears for constructive criticism :D
- rickhanlonii 12y agoCheck out the MVC in https://github.com/elcct/defaultproject https://github.com/elcct/defaultproject
- joncalhoun 12y agoOh cool. I'll have to check this out. Thanks for the link :)
- sagivo 12y agoi know go has it's own advantages (speed etc) but whoever saying the language makes developers happy clearly came from c++/c and not from Ruby/Python. you can write it in much more friendly language in less lines of code.
- joncalhoun 12y agoI coded in Rails for the last 3 years or so and jumped to Go for a new project since it seemed like a better fit. From my perspective, some things are more verbose and others more annoying at first, but overall I have come to love it. I couldn't really pinpoint a specific reason why, but I simply enjoy it.
- damian2000 12y agoFor me being able to compile to an executable with zero dependencies is a big win. And setting up the go dev environment is also trivial compared to my experience with rails.
- rickhanlonii 12y agoI've had an even mix of Java and Python the last 3 years. Go seems to be a solid mix of both: static typing that codes as easy as a scripting language.
- fixermark 12y agoMy single biggest problem with Ruby (really, the Rails ecosystem) is churn. The team in charge of Go maintains full backwards compatibility for both language and core libraries. Rails, in contrast, churns so quickly that if I let a project sit fallow for even six months, the entire packaging infrastructure has been swapped out from under me, the version of Ruby on my shared host is different, and my project no longer runs. Ain't nobody got time for that.
- gtaylor 12y agoAs someone who spends 40+ hours a week working with Python, I really like Go as a whole. I like being able to explicitly declare types, I love channels. It's way easier to deploy my Go apps than my Python apps (statically compile and toss that bin on prod). There's little point in trying to directly compare the two, they are two very different languages. Knowing both leaves you well-equipped to handle a wider range of projects. More tools in the toolbox.
- de_dave 12y agoHaving done a lot of Python web services (and other things) in the past, I much prefer Go. It may be a bit more verbose, but it's fast, the tooling is solid and overall I find it more productive. Everyone's mileage varies!
- nkozyra 12y agoThere are some compromises, for sure. It's fair to look at it as syntactically a middle ground between those comfy scripting languages and the rigidity of c/java style languages. Which is to say that it's scripting language esque. I speak from experience when I say that going from Python to Go was relatively painless and I'm just getting into Ruby and it feels equally verbose to both Python and Go. Probably the only area where "less lines of code" comes into play is error handling, and there are very easy, clean ways to do that in Go as well.
- nvader 12y agoCongrats on front page of Hacker News. I found this article easy to follow and generally well written. You'll probably want to fix the following typos when you have a chance do as not to detract from your message. > The first thing we are going to look at is what we need form our base controller from > This example is using httprouter, as this is my go to router in Go go-to > applicatoin application
- joncalhoun 12y agoThanks! I wrote this a bit hastily and didn't get to proofread it. I'll update it in the AM when back at my comp.
- touristtam 12y agoThanks, that's one of the most helpful post I have seen regarding Golang and web development. :)