

Ask HN: why most startups use ruby and rails? - alouanchi

Hi, I would like to understand why ruby and rails is used heavily in startups? Thanks.
======
hkarthik
It's because Rails is essentially a "batteries included" full stack framework
which helps a startup focus on building a business and not on building
technology infrastructure. Outside of Rails and Django, you're left to make a
lot of decisions to get the same level of functionality before you can start
building even an MVP.

Here's what you get out of the box with Rails:

1) Database schema management via Rails migrations which work great with
mature RBMSs like Postgres and MySQL.

2) A solid ORM (ActiveRecord) which makes CRUD super easy and intuitive.

3) An active community with lots of open source libraries (gem) to do just
about anything you want.

4) Highly productive ways to work with frontend (CoffeeScript) and backend
(routing, controllers, active_record, etc).

5) Great documentation and ecosystem around it.

Contrast this with Go, Node, and other OSS ecosystems and you're often left to
make a lot of the decisions on your own with immature libraries. Often to get
to the same place, you'll be inventing a lot of your own infrastructure.

Node is probably the closest to approaching a "batteries included" status with
the MEAN stack, but it's not quite there yet.

You can certainly get all of what Rails comes with out of the box on any
stack, but unless you know it really well, there's a lot of decisions to be
made. With a startup, the kind of analysis paralysis that often comes with
technology decisions can really kill an idea in its early stages.

~~~
csense
What does Rails do that Django doesn't? It seems like Python language is much
easier to learn, with very clean syntax.

And Django's architecture is usually simple and easy to understand as well --
e.g. the official tutorials have you do a lot of things "by hand" before
showing you parts of the Django standard library that automate them.

~~~
xtracto
> It seems like Python language is much easier to learn, with very clean
> syntax.

This is the kind of stuff that used to start flamewars on Usenet ha. I respect
your personal opinion, but just to put a different opinion (mine) out there: I
find Python very opinionated and feels kind of "old" (like, when was the last
time an OO language required you to provide a reference to the object as a
parameter within the methods?).

Also in my opinion, even now in 2014 it is still not clear what version of
Python should people use 2.x or 3?, given that there is still a bunch of code
out there that is not compatible with 3 (granted, there are tools to convert
that code, but that makes just an additional step to do compared to just using
Ruby).

All in all, these are just opinions. Both of the stands are very respectable,
but I wanted to put this out to compare with your opinion. I don't use Rails,
even though I use ruby a lot, so on those frameworks I cannot comment.

------
sigvef
Maybe it's a regional thing? Where I live, Python and Django is much bigger
than Ruby and Rails.

~~~
midas007
Unless you're in SF, it's easier to find Pythonistas than Rubyists, hipster
jokes notwithstanding.

But the stats show the giant, kitchensink frameworks are pretty even in
measurable terms, but Rails had about 5x individual committers.

[https://www.ohloh.net/p/rails](https://www.ohloh.net/p/rails)

[https://www.ohloh.net/p/django](https://www.ohloh.net/p/django)

~~~
alouanchi
"Unless you're in SF". isn't there where most startups are? so if many of them
use ruby and rails in SF why it isn't the main framework outside SF.

------
midas007
Bias: I'm mostly a Ruby dev, compile OpenSSL and Ruby from source.

For greenfield apps, node has the advantage of being mostly the same language
back- (node) and front-end (browser). Hence why Asana and others use it.

Python is more popular than Ruby, but they're roughly equivalent sans
religious wars.

The other thing is that Rails is a mature, well-defined architecture with tons
and tons of gems.

The bower asset packages can be used straight via

    
    
        # Gemfile
        source 'https://rails-assets.org'
    

It's also not hard to get gulp and phantomjs setup.

General advice though...

Build outside-in. (Frontend first, backend later)

Building inside-out can lead to wasting time building things that just aren't
needed.

~~~
alouanchi
"Build outside-in. (Frontend first, backend later)

Building inside-out can lead to wasting time building things that just aren't
needed."

I will keep it in mind.

------
gesman
Because for startup to survive it needs to take minimal time from paper napkin
idea pitch to production deployment. And RoR has all the bells and whistles
packaged together. The quicker the time - the quicker VC's gets return on
their investment.

Having said that, please note that ruby on rails is one of the slowest
performing frameworks:

[http://www.techempower.com/benchmarks/#section=data-r8&hw=i7...](http://www.techempower.com/benchmarks/#section=data-r8&hw=i7&test=query)

------
AJ72
To understand Ruby, and why anyone including a startup wants to use it, you
need to understand more about its founder, Matz. He is a truly amazing
individual.

Here's a recent interview with Matz from RubyConf13 (Miami Nov 2013)
[http://multifaceted.io/2013/rubyconf-13-a-chat-with-
matz/](http://multifaceted.io/2013/rubyconf-13-a-chat-with-matz/) that may be
of interest.

It's about making developers happy…

~~~
midas007
Matz's prefecture business folks are awesome and supportive. I think I still
have a pile of their postcards somewhere.

------
sandwell
It's quick to get started with (and it's not PHP). It runs on *nix/Mac
OS/Windows. Tools like scaffolding let you move on from simple CRUD stuff to
business logic.

I'm not a rails dev but these seem like desirable properties, especially if
you are working with limited resources to get a prototype or mvp going asap.

~~~
umren
do you sure it can be run on windows server or windows desktop with all
additional gems that can be used for development?

------
andretti1977
I think because it's easier to learn and require less code so startup may
focus on product instead of code. This should be true especially if you
compare RoR to java technologies, but i'm working on a project where Grails
was the requirement and i think Grails has a good future because thank to
Groovy it requires a lot less code but has its foundation on java frameworks
(hidden to the developer) which are very stable, solid and mature (and
obviously complex!)

------
voiduser
Well its as heavily used as other technologies I think it would be safe to
say. RoR, Django, Synphony are some of the frameworks I am constantly hearing
about for start ups. Just depends on the programming language preference.

------
teemo_cute
Your question has already been answered at Quora:

[http://www.quora.com/Ruby-on-Rails-web-framework/Why-do-
so-m...](http://www.quora.com/Ruby-on-Rails-web-framework/Why-do-so-many-
startups-use-Ruby-on-Rails)

P.S. You need to sign-in with your Google or Facebook account to view the
page.

~~~
mahouse
> Rails developers often use Macs. For some people, this means nothing. For
> others, this means the difference between getting hired or passed over.
> YMMV.

I must say this made me laugh. Is the tech scene getting too stupid?

~~~
fractalcat
What? I must say, this is the first I've heard of this trend. Personally, I
might be a little querulous when interviewing a dev who used Windows by
preference (though this would be irrelevant once they'd demonstrated or failed
to demonstrate technical skill), but I've never worked with a hiring manager
who'd discount a web dev who used a Linux-based operating system.

~~~
mahouse
Do you feel the same about Windows?

------
csense
Because they don't mind using garbage tools, as long as they are hip and
trendy.

~~~
donkeeswitch
I can't stand answers like this ... why is it a "garbage tool?"

~~~
csense
My main complaint: The syntax is awful [1].

The runtime is also extremely bloated. To run one fairly simple web
application with a handful of users, Rails uses well over 500 MB. I have no
idea what it could possibly be doing with that much memory -- is it trying to
make a separate object for every pixel? Startup for Ruby apps often takes over
a minute.

Ruby is Rails. It's hard to find information about using Ruby for non-Rails
projects. So as a beginner, not only do you have Ruby's weirdness to deal
with, you're often fighting the number of moving parts in a modern web
application.

Also, "magic." I haven't used Rails enough to know about this, but I hear
"magic" is common, e.g. (I've heard) Rake uses some horrible hack to monkey
patch the lexer or somesuch so it can have its own syntax. This kind of thing
leads to code that's even harder to understand because you now have non-local
dependencies. To be fair, Python also allows monkey patching, but also has a
strong "don't-do-that" cultural norm.

[1]
[https://news.ycombinator.com/item?id=5872899](https://news.ycombinator.com/item?id=5872899)

~~~
dham
Rails is not bloated, it just comes with a lot of features. I'd suggest
watching these videos.

[http://www.youtube.com/watch?v=2Ex8EEv-
WPs](http://www.youtube.com/watch?v=2Ex8EEv-WPs)

[http://www.youtube.com/watch?v=uUNdKVG2W-8](http://www.youtube.com/watch?v=uUNdKVG2W-8)

A typical Rails instance will use 100 - 150mb, and does not take a minute to
start up. Have you actually used Rails? I have several large projects and none
have ever taken that long to startup.

I use Ruby for non Rails projects all the time and had no issue finding how to
include Active Record and Action Mailer into a Ruby CLI application.

