
Ask HN: Ruby or Python for 2018? - methochris
I&#x27;m having a really hard time deciding between sticking with what little Python I know and using Django or switching over to Ruby&#x2F;Rails for developing my side project. I&#x27;m hoping anyone could jump in and voice their opinion on either side.<p>Clearly the Ruby community is experiencing some kind of event where the numbers are shrinking and some of the more prolific bloggers&#x2F;contributors are talking trash and moving on and i&#x27;m not sure what to make of this. There is alot of tutorials and information already out there but it&#x27;s getting dated and i&#x27;m not sure how much of it that was written in several-versions-old Rails will still apply and there&#x27;s not ton of new stuff coming out. There seems to be a gem or tutorial for anything I could need to do but it&#x27;s growing more stale by the day as their creators seem to be off to greener pastures.<p>Python has it&#x27;s moments for me but after doing some tutorials I&#x27;m really finding Ruby&#x2F;Rails to be just fun and exciting to use. I like how thorough the framework is and the development experience in general, with console commands for everything and automated tests re-running on save, and it seems they are adding greatly to the rails core, as opposed to Django&#x27;s big 2.0 feature was basically copying Flask&#x27;s URL system. I also like the community having a vocal figure like DHH kind of &quot;leading the pack&quot; with alot of methodology I agree with.<p>Is ruby really as bad as people say and is on it&#x27;s way out? Is leaving Python for it, if my only interest is web-application development, a dumb idea? it seems like i&#x27;m standing at this cross-roads looking out and seeing on one side, Rails is awesome but people hate Ruby, and the other side is people love Python but Django is a big limp dick and I don&#x27;t have time to program the kitchen sink with Flask. choosing between either is very confusing...
======
busterarm
Ruby, PHP, Go, Python, Javascript & Elixir developer here:

The #1 rule that trumps all, no matter how small or big your project: Use
whatever facilitates your work.

Sometimes you need to get things done quickly, sometimes you need to hire a
lot of people cheaply/easily, sometimes you need a project to scale. In each
of these cases, you may want to use a different tool. For something that's
your side project, you probably just want to be able to get work done
effectively and enjoy what you're doing. Pick that tool that you most enjoy
working with, in that case.

For me, I default to Ruby (and I haven't touched Rails for work in 2 years!).
I find it to be a joy to work with. I expect that later, as a I grow as a
developer, this will become Elixir and/or Erlang. Sometimes I have to work in
Python, because that makes sense for the project. I find it a bit of a slog,
but it gets the job done and lets me move on to other things.

If you are a developer learning the ropes, I couldn't recommend a better
language than Ruby. Your skills will translate. You will find work. The places
that hire junior developers that only care that you know their stack aren't
worth your time.

Most of the people that have publicly roasted Rails were wrong, for one reason
or another, by the way (especially that Twitter blog post...). Too often,
people are trying to fit a square peg into a round hole. The best advice I can
give you after that first rule is that you should ignore what people say and
just get your work done. That's the thing that differentiates people who stay
working in this field and those who don't.

------
git-pull
Python

Django, a highly competitive web framework. With great extensions like Django
REST Framework. Assets with django-webpack-loader. So on. It may not be as
good as Laravel or Rails, but they're all really active.

But the thing that makes Python best is the web framework is where it begins,
not where it ends:

Want text analysis? NLTK or spaCy

Data? Pandas, numpy, pytables

Want more analysis? scikit-learn, tensorflow, theano.

Solid language standards? PEP8 and PEP257 makes most python code you see in
open source very conformant

Test framework? pytest. And its plugins. tox for testing against a matrix of
python versions/settings (kinda like Travis).

Handling environments + packages easily? pipenv

Multiple python versions? pyenv

Editor integration? Jedi + python-mode for VIM, VSCode, Atom, Python

Images / Graphics? pillow

Super-powered REPL? ptpython

Deployment? Fabric, Ansible, Saltstack

Documentation? Sphinx, Docutils

Want C/C++ integration/performance? pybind11, cython, CFFI, swig

Mobile dev? kivy (though I wouldn't say it's the best yet, when I tried it,
setup was easier than react-native)

And that's just scratching the surface. Python has high quality, permissively-
licensed libraries, with solid documentation. A lot of the plugins I mentioned
above for handling data use C-level speedups. Of these, tensorflow, and Theano
can use GPU speedups.

Rails is fantastic. I like guard and the asset pipeline. But I just learned to
use GNU Make's "$ make -j task1 task2" and django-webpack-loader. I also hear
good things about Laravel in PHP.

~~~
gesman
+1

with so many supported libraries available i keep finding that adding more
functions to Python code does not actually add much to the amount of code.

------
lastofus
You seem overly concerned with Hype Driven Development.

There's not a lot of new stuff coming out of these frameworks because of how
mature they are.

Both languages/frameworks are comparable. Your end product will not be very
different regardless which route you take. Both languages and frameworks will
be maintained 10 years from now. The job market for both will exist 5+ years
from now.

Pick one you like and get to work!

------
haskellandchill
Python is a good career move. Ruby is more fun. There's no right answer :)

I program in Ruby right now for work but am comfortable switching to Python.
There are plenty of Ruby positions available, we've hired 5 or so Junior
Engineers out of Rails/JavaScript bootcamps. It's just that Python has the
data science and machine learning positions in addition to web development.

------
phren0logy
Have you looked at Elixir / Phoenix?

[http://phoenixframework.org/](http://phoenixframework.org/)

It has some Rails roots, so you might like it.

~~~
thedoops
Elixir and Phoenix are amazing. I use them any chance I get. The problem now
is that the ecosystem is still in early stages. You're gonna end up writing
some more libraries whereas in an ecosystem like Ruby there are gonna be
plenty of gems handling the typical things like Api wrappers.

------
chrisfinne
I can't recall ever hearing anyone say they "hate Ruby".

Ruby is designed to make programmers happy.

Ruby and Rails are "boring" because they are mature and do their job extremely
well, so the cutting-edge devs that helped get them there got bored and moved
on to other newer ecosystems.

If you are more interested in getting the project done fast and efficiently
and you don't mind doing it someone else's way, then RoR is a good choice.

If you like to do things your own way, then Rails will probably frustrate you
because it is very opinionated on how things are done. You can override
everything, but some people's personality is more suited for the node.js world
that is far less of a framework and more of an ecosystem of libraries.

These are 2 popular posts that will help you figure out if RoR is a
personality fit for you:

[http://david.heinemeierhansson.com/2012/rails-is-
omakase.htm...](http://david.heinemeierhansson.com/2012/rails-is-omakase.html)

[https://medium.com/@timbuchwaldt/rails-is-boring-thats-
great...](https://medium.com/@timbuchwaldt/rails-is-boring-thats-
great-f896e9ab2cb)

~~~
thepratt
I agree, it's more I hate x gem, or the community as a whole.
[https://news.ycombinator.com/item?id=5157886](https://news.ycombinator.com/item?id=5157886)

------
harry8
There are 2 choices of language for any side project.

1) the language you know best

2) the language you most want to learn

Only you can decide on which has a higher priority.

~~~
graystevens
This. If it’s a side project that is intended for self-development and
learning, try it in a new language and see how you get on. If it’s something
even remotely important or think might turn into more than just a side-
project, go with what you know or are comfortable with.

------
h1d
I have almost come to regret learning Ruby because it is a beautiful language
that I wish it would be my main language but unfortunately I think it has lost
scripting language race by the look of its popularity among competitors.

Part of the reason I suspect is the development cultural difference brought by
language barriers. Without sound development, it surely will struggle to
become better than alternatives.

[https://www.ruby-forum.com/topic/4570470](https://www.ruby-
forum.com/topic/4570470)

~~~
busterarm
I feel your pain. Beautiful language with no real peers in that regard, as far
as I can see.

------
brudgers
For what it is worth, I think you will probably learn something from trying
Ruby, even if you wind up sticking with Python. The community and language
design are just very different from Python's: MINSWAN v BDFL, many ways versus
Pythonic PEP's, everything is an object versus some things are objects, etc.

All this with the caveats that: I think both languages have advantages and
disadvantages and I think knowing more languages is better than knowing fewer
or one.

~~~
mixmastamyk
If you are going to learn something different, learn something really
different, not another dynamic unix scripting language.

~~~
brudgers
There are languages I find more interesting than Ruby. Suggesting them however
would have required deliberately misreading or ignoring the actual question.
Ruby was on the table and in use. The alternative? A regression to Python. At
least as much encouragement as advice.

------
matt_s
Programming languages are just tools. People that are finding they are
productive with a language/tool are out building things and not complaining.

I'm personally not someone that likes to look at new languages and compare
them for the sake of it. There are folks that like to compare compilers or
interpreters and the internals of how those work and debate them.

I'm more interested if something new can help me in delivery of working
software. Having moved from a Java world to Ruby/Rails, I find it not just
helps me deliver, it pretty much gets out of my way (most of the time)
compared to Java.

I haven't done much more than read about Python/Django/Flask. If they are
mostly similar to Ruby/Rails it doesn't sound like there would be benefit to
learning them outside of curiosity (and an affinity to Monty Python).

I suspect that big name bloggers and people that talk a lot about things may
find a need to keep viewers coming to their blogs/channels. If there isn't a
lot of new stuff to write about but it is still a solid delivery platform,
that isn't too exciting to draw viewers.

------
aregsar
I would take a look at Laravel which is php on rails with less magic and more
built in features such as authentication and background jobs. The most
important thing is that its community is growing rapidly and it has a BDFL ala
DHH in Taylor's Orwell. Also there are really good fresh resources such as
latacasts Codecourse and the Laracon conferences

~~~
acomjean
I still like php for web development, although it seems to be falling out of
favor somewhat. The new version 7 is quite fast, and its quick to get up and
running. I've not used Laravel, (I use a lighter framework called Silex) but
it is PHP's version of Rails.

I've found php is somewhat slightly more verbose and fewer data structures
seems to make php code easier to maintain for other people than perl and java
(which I also maintain...).

~~~
busterarm
Having had to learn PHP to work on some WordPress stuff, I can honestly say
that I find PHP 5.6 and onward to be a competent, usable language. It has its
quirks, but so does JavaScript. In fact, I'd say PHP and JavaScript are now
close cousins. The array methods are a bit annoying, but you can definitely
write effective, clean code in modern PHP.

------
wasted_intel
Ruby’s beautiful object model alone is worth learning. “Metaprogramming
Ruby”[0] is a great introduction to that. Its flexibility is what makes things
like DSLs so easy. The language also includes functional programming
influences. I wrote Django apps in Python for the better part of two years,
and for what anecdotes are worth, I didn’t learn nearly as much as I did
writing Rails applications in Ruby. I’d pick Ruby every time.

[0] [https://pragprog.com/book/ppmetr/metaprogramming-
ruby](https://pragprog.com/book/ppmetr/metaprogramming-ruby)

------
madhadron
If you're already comfortable in Python, don't bother with Ruby. You won't
find anything new there, and a lot of frustrating language design errors. I've
written about this in more detail at
[http://madhadron.com/posts/2013-02-25-a-criticism-of-
ruby.ht...](http://madhadron.com/posts/2013-02-25-a-criticism-of-ruby.html).

------
rajangdavis
I love Ruby, but Python is super simple to learn. I haven't spent enough time
with Python to do anything super cool with it, but it does seem to be more
consistent in terms of the code you will read.

I also think that once you learn Python, a lot of other languages' syntax
(such as Go and C# for me) becomes more approachable.

------
mastazi
> Rails is awesome but people hate Ruby

Is this sentiment common? It might be just my personal echo chamber but I've
often heard the opposite stance, i.e. people saying they hate Rails because of
all the "magic" but at the same time they like Ruby as a language because of
its flexibility.

~~~
busterarm
The Ruby job market outside of Rails is tiny, unfortunately. Most folks never
bothered to look. DevOps and InfoSec folks tend to know better -- Chef,
Puppet, Capistrano, Vagrant, Logstash, Metasploit, Homebrew, Sass... all
written in Ruby)

All of my ETL pipelines are built in Ruby and I wouldn't have it another way.
From a development, support and deployment persective, Jekyll is hands-down
the best "web framework" I've ever worked with. If you need to build websites
that don't need sessions/accounts, there isn't a better tool. NGINX's SSI
module fills in some (tiny) gaps.

Ruby's a great language with a healthy set of tools. It's just not popular
among people making CRUD apps right now.

To most folks though, unless they're already Ruby developers (AND not a Rails
shop), Ruby and Rails might as well be the same thing.

~~~
flowardnut
we use Sinatra and sequel for a few apps and it's great (and puma to run it
all)

we have switched to python for our FaaS but only because of lack of Ruby
support from AWS lambda.

------
cmclaughlin
I understand your concerns about Django and Flask... as someone who doesn't
work with either on a regular basis, getting reacquainted with Django feels
very heavy... and Flask seems too minimal.

Anyway, I just started using CherryPy for a new project and would like to
recommend it. I had actually used it around 10 years ago and hadn't given it
much thought until recently, but it's quite simple and nice for REST APIs.

------
nickjj
I would say try out both and use the one that makes you happy and is the best
tool for the job.

Personally, I'm a big fan of Rails and Flask and use both on a regular basis.

You may also want to give this a read:

[https://nickjanetakis.com/blog/it-doesnt-matter-what-web-
fra...](https://nickjanetakis.com/blog/it-doesnt-matter-what-web-framework-
you-use-just-pick-one)

------
epynonymous
i have a simple suggestion, you should learn both, we live in a polyglot world
now, you need to be able to learn multiple languages and to do so quickly. i
started with php then moved to python/tornado/sqlalchemy, ror,
ruby/sinatra/activerecord, nodejs/expressjs, and lately golang/gorilla
mux/database/sql. just start with one, suggest ror, i’m sure you’ll have
multiple projects in the future. ruby was built for web app development,
django’s a bolt on for python that then added web functionality. dont worry
about the community issues, ror has enough great libraries out there that you
could put together a pretty slick website quickly. a side note, if you need to
use some scientific packages, python might be better supported like numpy etc.
fyi ruby language is much nicer than python imho (insert flame war). dont
dwell on this decision too long, either should be able to get you what you
want which is a slick website, get a move on it

------
assafmo
It's your side project, do whatever you want! You said ruby is fun for you
then go with it.

------
qume
If you code alone, use the best available which generally I assume people
would say Ruby.

If you are intending to collaborate then python might be a better choice as
its more popular.

Just a different take. Either one is great.

------
nunez
I used to hate Ruby until I had to learn it two years ago. Now, I wish that
this is the only language I'd ever need to use. It's beautiful, and testing
stuff with it is a BREEZE.

------
mixmastamyk
Python’s more broadly applicable, easier to read and maintain, installed by
default on distributions. Pyramid is another good option if you have something
against Django.

------
pknerd
I would prefer to pursue Python further for data scraping/analysis or bot
development related things, PHP for Web apps and Go just for heck of it :>

------
ksec
Recently someone asked what worries you about future of Ruby on reddit.

[https://www.reddit.com/r/ruby/comments/7jiq6k/what_worries_y...](https://www.reddit.com/r/ruby/comments/7jiq6k/what_worries_you_about_the_future_of_ruby/)

I will post my answer here, but it basically sums up a lot of things that were
said in the replies here as well. If you want to be happy, just use what you
are happy with, if you want a career out of it, choose sensibly.

We need to define a few things up front.

When people say Ruby is dying or dead, what dying or dead actually means is
Ruby is not growing. Lot of people left Ruby, even the prominent ones, but
there are also lots of new faces, as DHH likes to mention.

Languages dont die, especially when they are open sourced. Perl is still not
dead, nor PHP. But consider if a languages is slowly moving towards
irrelevant, then it is certainly considered dead. In this case Perl is an
example, while PHP still has vast majority of the Web programming. In any
case, the Job Pool is an easy indication, and no matter how you spin it, the
Job Pool for Ruby Rails is definitely shrinking.

The problem is Ruby at its 1-2% low level of usage, should really be growing a
lot. You dont see large web scale company using it, Python has Google,
Dropbox, for example, using it as well as contributing to its development.
Ruby doesn't have any of that, and it isn;t trying to get being used for large
corporate either. Its whole ecosystem is bond to Rails. Even the Release note
of Ruby often mention Rails and nothing else. It seems at the moment Ruby is
an Rails languages rather then vice versa.

When people say Ruby Rails dont scale, what they really meant was Ruby Rails
dont scale cheaply compared to all others. Cookpad does close to 20,000 RPS,
Shopify manage 80,000 RPS, and there were once information about China's
Railway ticketing system using Rails that does 400,000+ RPS, it was basically
the whole China DDOSing the system. So Ruby Rails scales, but at what cost?

The Web is largely divided into two camp, one is the pay by user and SaaS
model, much like Basecamp which Rails originate from, the other is Ads to user
which needs to reach a critical mass before it starts to paid itself. The
latter is the one much more popular and which Ruby Rails is having problem,
because scaling to that critical mass requires substantial investment into
infrastructure, and its cost structure is not very attractive. DHH used to say
Moores law is helping them to grow, but that has no longer be true for recent
few years, not to mention the Goal post of sustainable advert or per user
revenue on a freemium model is getting larger then the speed of Hardware
improvement. For example, on Stackoverflow Engineering blog, shows a fully
optimize ASP.NET could do 10x more then Ruby at 10x Faster Speed while using
1/10 of Servers.

There was a talk sometime ago about Go Vs Ruby, where Ruby was likely 30%+
more productive up front, it was 10x slower, 300% more maintenance work
afterwards.

To put this simply, the maths and scale of economy doesn't work very well for
Ruby And Rails on many applications.

If you watched some Conf Video, Matz has went from Ruby is fast enough, good
enough, to Ruby needs to be faster, Ruby needs concurrency. From Ruby is my
languages, to Ruby is communities languages. The closed development circle of
Ruby means it has seen much less contribution from outsider compared to
Python. When Ruby needs all the help it gets, not having the conversation and
development in open and easy to follow doesn't really help. Although I
understand the resistance to GitHub, but certainly GitLab is an alternative.

I also dont believe backward compatibility is the most important factor for
3.0. Ruby has quirks and in some cases far too many choices, and if MJIT is
really faster, it should be used as an incentive to move the ecosystem
forward. Making breaking changes at the MJIT support level. Taking the chance
at changes to fix and improve things. While Matz have said they dont want
another Perl 5 / 6 and Python 2 / 3 problem, but i believe this is different.
Perl 5 / 6 is literally a completely different languages they might as well
call Perl 6 something else. While Python 3 offer changes while giving no
immediate benefits to its users. JIT is a very good chance to use as bait and
rethink what Ruby in the future should be.

The biggest problem often is Ruby as a communities dont see any of these as
problem until it is too late. People flock to Go not only because of its
performance, but because it can be easily deployed, and deployment isn't
something even on Ruby's Roadmap. Ruby on Windows still isn't as easy as any
other counterparts. And it is too late to join the Data Science race. Sidekiq
developers gained their success using Ruby has has now moved to Go, the same
as Hashicorp.

I know this may be a little harsh, of course Ruby dont owe us anything, you
are free to use and move on as you like, but it is sad that Ruby doesn't grow
bigger, it doesn't need to take over the world, but it should have a slightly
larger presence and usage across different domain. Luckily Ruby will always
live on in the form of Elixir and Crystal.

~~~
methochris
dang, i feel like i could read you talking about the state of programming all
day. so, can i ask, what is your current language/framework of choice and what
would you recommend to someone in my position (just starting out, interest
mainly in working on personal project that could eventually become saas
products and only interested in web application development)? do you have any
words of wisdom on python?

------
grover_hartmann
Stick to Ruby, Matz will give us new Ruby this christmas, and he's the best
mormon I have ever seen so that's a plus.

