
Replacing Ruby on Rails: Let's Go - zgryw
http://madebymany.com/blog/replacing-rails-part-1-lets-go
======
colbyh
I like Ruby/Rails, I like Go. I like frameworks that make your life easier
when starting a new project.

I don't think Go is anywhere near the list of languages to build a Rails
successor on top of. Rails can do so much of the cool stuff it does because
Ruby is an incredibly flexible language.

Go, on the other hand, could be described as "inflexible as a feature". You
have a beautifully simple language that optimizes for concurrency and other
issues that simply aren't considerations in the Ruby world.

The two languages are worlds apart and designed to solve vastly different
problems. I support new tools for Go, but I just don't see a monolithic web
framework being high up on the list of "must haves".

~~~
higherpurpose
I for one would like to see a serious Go-based alternative to Wordpress.
Virtually every major CMS out there uses PHP, and all of them are highly prone
to hacking.

~~~
vec
I don't think you're going to see a serious competitor to Wordpress in
anything but PHP for a long time. The core target audience for a CMS is
content creators and designers without strong compsci backgrounds. The things
that make it hackable (trivial to modify in-place, extremely forgiving of type
errors, no internal sandboxing, etc.) are the very things that make it
attractive to non-developers.

Nothing is going to dethrone Wordpress unless it's at least as easy to cargo
cult, and anything that does will more or less by definition annoy experienced
developers more than what it replaced.

~~~
nine_k
The beauty (which can also be seen as a disadvantage) is that writing Go does
not exactly require comp sci skills. I suspect that Go is even simpler than
modern PHP as a language.

You can of course go full comp sci implementing clever algorithms in Go, but
you could do that in PHP, too, and none of content creators is usually
interested in this.

~~~
cheald
Go requires knowledge of types, which already puts its cognitive complexity
ahead of PHP for the typical content creator.

~~~
Grazester
Are data types that complex a concept to grasp? When I started programming in
VB I don't remember it being.

~~~
vec
Data types aren't the bottleneck, the deployment model is. Editing a Go
application requires the following steps:

    
    
      1.  Edit the project's files.
      2.  Open the (scary and alienating) command line.
      3.  Run `go build` and hope it works right.
      4.  Find and stop the old running server process and start the new version
    

Oh, and you'd better hope step 3 goes smoothly, because a tiny mistake
anywhere in your application will cause this weird thing called a "compiler
error" that means that the entire thing will break. Editing a Wordpress site,
on the other hand, looks like this:

    
    
      1.  Edit the project's files.
      2.  There is no step 2.
    

As developers, we're comfortable with the first workflow. We happily accept
the added complexity because of all the other nice things it gives us and
because we're probably using other tools like version control that end up
making our experience much more uniform between the two. But to a user whose
primary experience is with editing Word documents there is a huge jump there.

------
tptacek
I've had nothing but bad experiences trying to do things I'd ordinarily do in
Rails in Golang instead (and I really like Golang). Writing "Rails apps" in
Golang feels a like like writing them in Sinatra used to feel: good at first,
but halfway through you realize you're just wasting time reimplementing a
buggier version of half of Rails.

On the other hand, I've had very good experiences factoring subsets of Rails
apps out into trivial HTTP/JSON services, and frontending them with Rails.
That's how Microcorruption.com works, for instance.

~~~
jlhonora
Why use Rails as a frontend? One of the reasons I'm using Go for service
decoupling is to get rid of Rails long startup times. I just route the
requests using Nginx and skip Rails altogether.

~~~
tptacek
Because it's much faster to build functionality in Rails than in Golang, and
not every feature of an app has the same performance requirements.

~~~
rapind
I think jlhonora just means to proxy from nginx directly for the services that
aren't powered by rails. Like 90% of the site served from rails and the high
performance services are just different nginx backends.

Potentially what you're already doing.

~~~
jlhonora
Exactly

------
jweir
I like Go, and I am replacing aspects of Rails apps with Go, but for a lot of
web app uses, Rails is really, really good.

Hashicorp, who has a very high Go competence, migrated away from Go to Rails
for their web service.

[http://blog.gopheracademy.com/advent-2014/atlas/](http://blog.gopheracademy.com/advent-2014/atlas/)

> Once we decided to evaluate other technologies for our web service, we had a
> few choices. Based on having Rails experience and the maturity of that
> tooling we saw it as the most pragmatic option. As we began our initial
> port, we realized that over two weeks worth of work in Go had been replaced
> in just a few hours in Rails. We were sold.

~~~
czbond
I commented above that I felt dirty taking the Rails for web applications, and
Go for "Other" approach. But it was the best I had come up with. Thanks for
the link - It was helpful and mirrors my experience.

------
BringTheTanks
Odd. RoR and Go address entirely different app domains.

The only thing that connects them is that RoR was trendy yesterday, and Go is
trendy today.

If this is the rationale for replacement, the author will be writing plenty of
"replacing" articles in the years forward.

~~~
iends
What do you see the app domains of Rails and Go as?

~~~
thibaut_barrere
I've worked (as a freelancer) on a number of apps recently using Rails for the
"front back-end" and either Erlang or Go for the "back back-end" and it's been
working great.

Rails works great for things like authentication, creating a nice and
maintainable UI, handling billing code, sending emails, managing the database
schema, and all the web related stuff.

Erlang and Go work nicely for all the "heavy work", think sending tens of
million of push notifications quickly, crunching data etc.

They can communicate using a shared, Rails-maintained database, and things
like Redis to trigger updates or orders.

You can even do Erlang-backend processing of Sidekiq payloads, pushed from the
Rails side etc.

All in all: use each tool for its own strengths.

~~~
aikah
> Rails works great for things like authentication, creating a nice and
> maintainable UI, handling billing code, sending emails, managing the
> database schema, and all the web related stuff.

Nothing that Go cannot do. The only difference between Go/web and Rails is the
maturity of the libraries.

Of course Go libs are way less mature for various "business tasks".

~~~
thibaut_barrere
You can do that in Go, yet like pointed out in [1], it tends to take more
effort (well, this has been my experience at least).

But well: do what works for you, really :-) I'm not commenting to persuade
you, I'm just sharing one data point.

[1]
[http://blog.gopheracademy.com/advent-2014/atlas/](http://blog.gopheracademy.com/advent-2014/atlas/)

~~~
aikah
Did you write Gopher academy (fellow french?) ?

~~~
thibaut_barrere
No I didn't! Yet I felt exactly the same. Sorry if my message was confusing
:-) (I'm french indeed).

------
shah_s
Rails is still the best framework for building CRUD applications. It shouldn't
be used for every scenario but if you want to build a traditional CRUD app,
nothing is better than Rails in my opinion.

~~~
camdenre
I think ASP.NET MVC is as easy as Rails for CRUD apps.

~~~
beat
i dont use .net, but i'm impressed with the number of smart people praising it
(and Azure) these days.

------
hkarthik
I'm surprised he chose to use Martini for the web component since the author
himself has chosen to discontinue development of Martini in favor of a
different approach with Negroni.

These days most people I know that use anything outside of the Golang stdlib
seem to reach for Gin.

~~~
shocks
I was also surprised. Here is the relevant article:

[http://codegangsta.io/blog/2014/05/19/my-thoughts-on-
martini...](http://codegangsta.io/blog/2014/05/19/my-thoughts-on-martini/)

------
buro9
One of the things I still think Go is weak at is the internationalisation and
localisation.

There is nothing as feature-rich and widely adopted as the Django equivalents
for translation
[https://docs.djangoproject.com/en/1.8/topics/i18n/translatio...](https://docs.djangoproject.com/en/1.8/topics/i18n/translation/)
formatting of dates and times
[https://docs.djangoproject.com/en/1.8/topics/i18n/formatting...](https://docs.djangoproject.com/en/1.8/topics/i18n/formatting/)
or for handling timezone conversions
[https://docs.djangoproject.com/en/1.8/topics/i18n/timezones/](https://docs.djangoproject.com/en/1.8/topics/i18n/timezones/)
.

Ideally the Go core, or the Go community, would provide a great experience
(consistent, idiomatic, documented, supported) for developers coming from
Rails, Django and other platforms.

Right now I recommend Go for backend and APIs, but I stop short of
recommending replacing your Rails or Django with Go. There's still an enormous
amount of work you would have to do to come close to the kind of web app
support you'll find in platforms that are already mature and focused on
delivering front-end web experiences.

------
eranation
If you come from RoR, Go is the last language/ecosystem I would think of.
Elixir, Scala/Play seems to me so much more naturally fitting the Rails
paradigm and the Ruby language flexibility. Go is so much different, it's not
replacing Ruby on Rails, it's replacing your programming style and philosophy
completely.

------
knodi
I like Ruby/Rails I like Go. I use Go for all backend stuff but as a web
framework Rails is miles better than anything on Go currently. E.g: templating
in Go...no thx

------
deedubaya
There is a tool for every job, and not every tool is a hammer.

"Framework XYZ can't do ABC, I'm switching" never holds any water.

------
Freaky
So what's around that has a chance of replacing Wordpress? Java!

Sigh.

~~~
Omnipresent
Working with CQ5 gives me the chills.

~~~
bshimmin
Great dayrates as a contractor doing CQ5 in London. I'm almost certain it's
not worth it, but hey, you never know.

~~~
Omnipresent
Thats because the Adobe sales people have jammed the product down a lot of
enterprises. In my opinion a COTS product is never good enough to solve
complex problems.

------
CookWithMe
> Simply "not using Rails" anymore however is, well, not that simple!

After the OP has described why he likes Rails ("good toolset", "Ruby gems
cover everything"), I would've really liked to know why OP wants to switch
away from Rails.

> so what's around that has a chance of replacing Rails? Go!

Again, the OP gives no reason why he switched to Go instead of looking at
another web framework for Ruby, and also not why he chose the particular Go
frameworks to replace Rails.

That's what would've really interested me, after the introduction I didn't
quite see a Go-tutorial coming...

------
minaandrawos
If you are set to learn Go. Martini -though powerful- is not the most
idiomatic. Why not try the gorilla toolbox instead?
[http://www.gorillatoolkit.org/](http://www.gorillatoolkit.org/). The maker of
Martini wrote an interesting post last year:
[http://codegangsta.io/blog/2014/05/19/my-thoughts-on-
martini...](http://codegangsta.io/blog/2014/05/19/my-thoughts-on-martini/)

------
wukerplank
When talking about Rails, you can't take Ruby out of the equation. To me, the
joy of coding Ruby is unmatched by any other language. And it does have a very
mature ecosystem.

Ruby and Go are both awesome, I could write you a love letter about both of
them. But in my mind they have way too different use cases and coding styles
to be brought up in the same sentence.

------
kaushikt
the author has not written a single good reason why he has moved from Rails to
Go. Could you please enlighten ?

------
tinganho
I don't know why this post got so many likes? Many Go fans here?

I personally think any language that compiles to JavaScript and are quite
similar are the perfect language for web. Since you can re-use code from
client and the server. Right now my bet is TypeScript.

------
whateveracct
Go seems like a terrible choice for any programming problem that requires data
modeling/manipulation. Basic structs, slices+maps, and loops are all you have.

Go is good at plenty of things, but building abstractions is not one of them.

~~~
0xdeadbeefbabe
Sorry, I'm not from around here I guess. What do you mean? Have you seen etcd
[https://github.com/coreos/etcd](https://github.com/coreos/etcd) or sync.pool?

~~~
wukerplank
I read your posts and I don't know if I just don't understand you or if you
are trolling.

I believe what the parent post refers to is that Ruby - being a dynamic
language - is way more flexible with types and data structures. On top of that
it has very convenient methods for data manipulation. This allows you to
express solutions in a fewer lines of code compared to lower languages (with
the added downside of slowness of course).

------
matt2000
I never personally learned Rails so I'm just an interested observer, but can
someone explain the problems with Rails currently? And why the switch in
language rather than just making fixes to the framework? After looking through
the article it doesn't seem like there was a very strong case made for Go.
Thanks!

~~~
BSousa
In a nutshell: Rails isn't shinny anymore. By migrating from (now) old Rails
to new shiny Go, people can write these kinds of articles and pretend to be
cutting edge and forward thinking.

~~~
karmajunkie
its a bit more complicated than not being shiny anymore. For a lot of
veterans, what's touted as best practices in the Rails community lead to
maintenance headaches and performance issues in large scale long-lived
applications. Rails apps tend to have a high degree of coupling internally and
to gems that Just Work™ (except for when they Just Don't™).

~~~
socceroos
Also, as the industry has shifted away from monolithic web frameworks to
tightly controlled 'microservices' then the relevance of something as heavy as
RoR wanes.

~~~
karmajunkie
Right, although personally I think there'll be a heavy backlash against
microservices (that's already begun in some circles.)

~~~
socceroos
Yeah, the whole industry cycles between ideals; each generation rediscovering
the benefits and drawbacks of each. Hence the renaissance of event driven
applications.

It's all good. Go with the flow and learn. ;)

------
seanschade
The library author for Gorm should have done a quick Google search first.
Grails has had Gorm has an ORM for years.

~~~
vorg
There's a similar problem with the name "GVM" being used in both the Groovy
and Golang ecosystems, with Golang using the name first. So perhaps the
library author for Gorm _did_ do a Google/Baidu search. The Groovy/Grails
project manager started the tit-for-tat by changing the meaning of "Groovy"
from a language spec used for building implementations, to a specific
implementation used by his Grails software.

