
Has Python killed Ruby? - Pishky
If chosing to learn one or the other why would anyone choose Ruby?<p>Thanks
======
LyndsySimon
I've used Python for about about eight years, and Ruby for right at six
months. It took me about a week to feel competent in Ruby, and about a month
before I was really comfortable with all of the metaprogramming functionality.
Add another month to that before I really grokked ActiveRecord.

I much prefer Python. I thought for a long time that this was because I
learned most of the fundamentals of computer science and professional
development in the language, but I'm at the point now where I'm sure that's
not the case. The Zen of Python really shows the differences between the two
of them - "explicit is better than implicit", versus Ruby's "convention over
configuration". I don't mind writing some boilerplate in Python, because the
boilerplate is itself fairly terse and fully informs you of your system's
architecture in the process.

I hate that functions aren't first-class objects in Ruby. Hate it. The subtle
distinctions and behavioral differences between blocks, Procs, and lambdas are
infuriating.

There are many things I would change about Ruby, but there's nothing _wrong_
with it. It's just not a good fit for my way of thinking.

All that said, the question was "Has Python killed Ruby?" No, it hasn't. Ruby
is still popular, and I think it very much fits the manner of thinking of many
developers. For them, thinking in Ruby is natural and wrangling Python into
submission would feel like writing Ruby does to me.

~~~
bigkm
Python's philosophy of "explicit is better than implicit" kind of dies when
you get to types. Even the docs are quite vague on this too.

~~~
nnq
It's a dynamic languages... what would you expect?

For most boring everyday cases Python's "type system" (it's too much to call
it so, but anyway) is quite ok, catches lots of bugs that would seep through
in Javascript or PHP, plus functions as first class objects to match everyone
intuition and it's quite a pleasant experience.

------
josephorjoe
I use both fairly regularly, and they are very similar.

Where they are different in terms of syntax or capability or philosophy, I
nearly always prefer ruby.

I find bundler/Gemfile/rvm to be less headachy for project dependency
management than pip/requirements.txt/venv.

For me, ruby code is easier and more pleasant to read.

When I need to write a quick bit of temporary code or do some simple data
parsing/file management, I nearly always use ruby if it doesn't matter which
language I use.

But if I had to choose one of them to learn, I would focus on python -- even
with everything I said above and the really long and drawn out (and still
unsuccessful) transition to python 3.

Python has much stronger non-web app libraries and perfectly adequate web app
libraries and is definitely much more widely supported in academia. Ultimately
there are more things you can do with python and more python job
opportunities.

~~~
mercer
Do you have experience with NPM and Yarn (javascript/node) and if so, how do
the package managers and ecosystem compare?

I'm asking because I'm primarily a js dev with a bit of Ruby and Ruby on Rails
experience, and I'm wondering if Python/Ruby are worth investing in at this
point and if perhaps instead it makes more sense to stick with js (Yarn in
particular for package management) and explore more fundamental
(C/C#/C++/Swift/Objective-C) or exotic (Haskell, Clojure)
communities/languages/environments at this point.

~~~
josephorjoe
Yeah, I have worked with js/npm more than ruby or python lately. I've looked
into yarn, but haven't used it on a project yet.

I like npm. For package management, I think npm is on par with bundler (ruby)
and thus a bit better than pip. I like the ease of use of package.json scripts
and find myself using them more and more. They feel lighter and easier to set
up than the ruby equivalent (rake tasks, usually), although when you start
doing fairly complex stuff (e.g., custom asset management), they can get a bit
unwieldy.

As for the ecosystems, I find javascript is more in flux. It is more work to
keep dependencies up to date or to decide what library to use when you need
one, and I've had apps break on minor and patch updates to dependencies fairly
often.

There is also a focus on small libraries that just do one thing. Nothing wrong
with that, but the number of dependencies some projects have is a bit crazy.

If you work with Ruby or Python for web stuff, you inevitably end up using JS
for the frontend, so it is certainly a reasonable choice to use Express as the
server and go full Javascript.

And my company does that a fair amount, but when we need an app to do
something more complicated than serve web pages and talk to the database, we
end up moving over to flask/python to take advantage of python's better
libraries (esp. for math/science/data stuff).

So, I still see some value in picking up python. Nothing wrong with any of the
other languages though, and you can learn a lot from any language. Depends on
your interests and needs really.

~~~
mwpmaybe
> For package management, I think npm is on par with bundler

NPM is non-deterministic and doesn't have lockfiles, so it's a bit of a
stretch to say it's on par with Bundler.

Yarn solves both those problems for JavaScript projects, and it's much faster.

~~~
josephorjoe
Right, you have add on npm-shrinkwrap if you want to lock everything down
(which I do use for some projects).

Yarn may well be better than npm, in fact, as far as I can tell it is, but,
frankly, npm works well and I'm tired of switching js dependencies, especially
really core dependencies like a package manager.

I'm hoping npm just steals whatever yarn does better than it so that I never
need to switch...

Bundler is pretty great.

pip... pip... I don't know what to say about pip. It's probably my fault, but
I can never seem to get pip to fully understand that what I put in
requirements.txt should always always always be used for the project no matter
what system level libraries are installed. If yarn were available for python,
I'd switch to it today...

~~~
chucksmash
> Yarn may well be better than npm, in fact, as far as I can tell it is, but,
> frankly, npm works well and I'm tired of switching js dependencies,
> especially really core dependencies like a package manager...

Yarn still uses your package.json. I think it will definitely win out over
directly using npm since it is better in a couple of ways and, from a user
perspective, is just a thin wrapper around the things you're already used to
doing. Ways my workflow has changed:

npm install . -> yarn

npm save --dev pkg -> yarn add --dev pkg

npm save pkg -> yarn add pkg

npm run command -> yarn run command

If you start using it and dislike it, just npm uninstall -g yarn, rm the
yarn.lock file and bam, you've still got a normal npm dependency management
setup.

> If yarn were available for python, I'd switch to it today

Project worth keeping your eye on:
[https://github.com/kennethreitz/pipenv/blob/master/README.rs...](https://github.com/kennethreitz/pipenv/blob/master/README.rst)

------
rudyonrails14
If going with the web, I'd go with JavaScript, to a degree you have to learn
it anyway. Python and Ruby are both relevant for web as well. Rails vs
Flask/Django - both will get the job done, plenty of use cases of major
corporations using one or the other.

If you're doing DevOps, you should probably learn both.

Everything else, which is more backend, APIs, data, data science, AWS, Google
Cloud, Big Data databases, etc - Python over Ruby. You may want to consider
Java here tho depending on how much performance is required due to many of
those aforementioned Big Data platforms having the JVM underneath the hood.

So all things being equal, Python, and then for all things not being equal,
Python.

~~~
mercer
To add to that in regards to web development: you're going to need JS anyways
much of the time, so learn it. You Don't Know Javascript and Eloquent
Javascript are respectively good starting points and good but tough starting
points.

But as of yet there's nothing in the JS ecosystem that compares to Ruby on
Rails or Django for back-end stuff, so it's worth learning one or both those
two as well.

For finding work: learn both, or pick the one that is more popular in your
desired field, geographic location, etc.

For improving yourself as a programmer: go for Python first but learn both
(good introduction to how programming languages are both different and alike).
If you can't be bothered by or interested or learning both, reconsider your
field of work, because both are _fun_.

For anything else: if you're capable of weighing the pros and cons of either
in regards to support (hiring coders), project size, level of complexity
needed etc.: Python strikes me as the slightly safer / more robust choice,
especially in academia, but I'm not confident about recommending either one
primarily.

------
dasdhrub95
Ruby is commonly used by programmers along with Ruby on Rails for Web
Development so it's scope is very limited. Python on the other hand has been
widely adopted by the academia and has become pretty much essential to
startups in the big data/AI sector, additionally Python can also be used with
Django for web development (Instagram's website is built in Django). The pip
library is vast and the Django community is on par with the Ruby on Rails
community. I dont see any reason to stick with Ruby.

~~~
bdcravens
> Ruby is commonly used by programmers along with Ruby on Rails for Web
> Development so it's scope is very limited.

Not correct. Its primary use case doesn't limit its scope, and there's tons of
utility programming done in Ruby. (for example, Chef and Puppet are written in
Ruby)

------
dkarapetyan
Ruby is a much simpler and more aesthetically pleasant language. Python has
all sorts of sharp corners. You really should learn both but I think Ruby is a
much easier starting point.

Also, a lot of research on dynamic languages is being done with Ruby, e.g.
TruffleRuby, JRuby, RubyOMR, and probably a few more I'm forgetting. Each of
those projects is an impressive body of work in and of itself that points to
Ruby being very alive and well. Oh, almost forgot about MRuby. I don't think
there are similar efforts for Python. In some sense Python is much more
stagnant these days in terms of innovation at the language level.

~~~
mamcx
> Ruby is a much simpler and more aesthetically pleasant language

That is open to disagreement. I will say the same, but of python.

HOWEVER, among the languages that put "aesthetically pleasant" as part of the
charm, I think is safe to say that python/ruby are from the top 5.

Any of both will be a good choice using that criteria (and even considering
the troubles with BOTH), so in my mind is hard to go "wrong" with any of them.
Both have other features that could weight in the choice, but at level of
language are more brothers in spirit than enemies.

\---

I don't see ruby "killing" python, (I'm more a fan of python, ok?); just for
the look of it the niches of both are more defined now.

SADLY, js is what is killing all the other languages in the web space. _I
wish_ a better language was the cause, but not, must be the far worse, more
terrible, but the NON-choice.

~~~
mercer
Without any strong feelings for or against a particular language, I suspect
Ruby is hurt more by this than Python, at least in the future, on account of
being more web-focused. Can people in both communities confirm or deny this
(and as I said I'll happily use Ruby in many of my use cases)?

As for JS; what with TypeScript and ES6 (despite the worry of clutter) I can't
help but wonder if it's the best non-choice we could have hoped for.

~~~
mamcx
I think that is a side-effect that ruby in rails was ruby in the mind of many,
and python was weak at first in web (before django).

In the meantime, python get a lot of love for scientific computing and other
stuff, but ruby (and others, I think no even java or .net) not and then get
behind in this area.

So now, when the web side have more viable options and ruby is just one of
many, the effect of web on ruby is felt more, but python have a good fallback
on the rest.

Python have a more diverse portfolio of options ;)

~~~
gspetr
> I think that is a side-effect that ruby in rails was ruby in the mind of
> many, and python was weak at first in web (before django).

Django was actually released first.

~~~
mamcx
Yeah? Ups!

But Ruby On Rails was more popular, no?

------
erkose
Actually, Ruby failed to kill Python.

------
allan_wind
No.

I wrote a small Rails project a while back and along with it small non-Rails
utility that made used a couple of generic modules (mail, config). Both the
Rails project and the utility bit-rotted faster than anything anything that I
ever written. Ruby, the language, is pleasant, and you can write beautiful,
terse, expressive code. Functional constructs are nice, etc. Soured me on
Ruby, I am afraid. I liked Perl too, and Ruby is not that different.

Python... I don't care for the significant whites space. lambda is crippled
because it has to fit into a single line, tertiary operator is weird, and
compressions reads backwards to me. Haskell has the same problem. It is nice
how you can start with a class, then wrap attribute access later. Writing a
simple new style class is verbose. The version 2 to 3 was rough, not sure if
it's done by now. There is a lot of libraries, some parts of the standard
library are nice.

JavaScript to me is mess with classes being bolted on, different ways to build
an object, different ways to handle errors, different ways to handle
callbacks. The write it once and run it either in browser and server ignores
that version differences (i.e. what is the crappiest browser you have to
support), and in general that environment is different. node.js with the async
is an interesting experiment. To me it becomes difficult to read and reason
about. To me, it was surprisingly difficult, to write a small sync util in
node.js. There is a metric ton of libraries. I quite like JavaScript, but to
me its becoming complex (as in C++) instead of burning off the bad parts (as
in C). The language will be around "forever" due to the web, so that is what I
use if possible.

~~~
mercer
While I'm nowhere near a 'fan' of JavaScript, I do feel like defending it by
pointing out that there's a difference between the language and the browser
issues. The latter are maddening and the former is less bad when you separate
the two.

That said, while I personally fell JS is _decent_ with the ES6/ES2015
additions, I do share your worry that it erred on the side of complexity by
adding a shit-ton of stuff that maybe should have been more carefully
considered. It appears modern JS is and will become the kitchen-sink language,
which I suppose is fitting.

But once again, that's still pretty cool. I love how I can introduce someone
to programming using JS nowadays and actually be able to teach a whole bunch
of different syntactical concepts. I also love how what you can do with JS
directly impact the one thing most of us are constantly staring at (web
pages). All in all I think things turned out better than I expected as far as
the web ecosystem goes. Programming wise. Don't get me started on my worries
about the increasingly walled-garden world we appear to live in...

------
thescribe
I've never had a language click with me the way ruby has, I use it for
basically any task that isn't low level. I have never liked python at all
despite them being quite similar. Do whatever makes you happiest and most
productive.

------
SwellJoe
Either is fine as a learning language. I'd pick Ruby if I wanted to learn how
to make web apps, and Python if I wanted to work on scientific or AI projects.
But, either is a very good learning language with excellent resources.

------
mamcx
As a fan of python -and think python is overall better-, but also as someone
that have learned (and used professionally) many languages, learn both. Even
take a look at erlang/elixir or any other you think is interesting.

Ruby on Rails was a eye openner (my exposure to web was ASP classic (auch!!!)
and ASP.NET (auch!!)) and the tutorial of

[http://poignant.guide/](http://poignant.guide/)

Was something _good_. I choose later python just because I think is a better
overall language, but I have always read what the other side have to say. I
will not hate to work on ruby, in contrast to, let say, js or java.

Not hate a language is probably a more nice thing that just like it ;)

\----

You must balance much more that just the superficial aspect of the syntax,
despite that I agree syntax MATTER A LOT. With time the superficial syntax
will become a more deeper aspect of the experience (when you truly understand
the language and see the semantic behind the words), but the ecosystem, the
thing you plan to build, how well you absorb the knowledge, etc are also
important.

Even when 2 languages look "nice" is possible that down the road one be
"better" in your mind and other "harder" or the opposite. For example I get
lost reading C-like languages and get easy Pascal-like language for the same
thing and the same level of difficult.

For example, I read

[http://learnyouahaskell.com/](http://learnyouahaskell.com/)

And I loved it, but I can't make haskell work for real (to me). The language
look nice at first, but it not "connect" to me. Instead I get F#.

------
jampa
Answering directly to the question: no, both languages coexist for so long. I
don't see "Python killing Ruby".

Learn Ruby if you want to get started in web development, most of Ruby
development projects is based on Ruby on Rails, and as a beginner is VERY easy
to get started, you will get things done very quickly once you set it up.

Learn Python if you want to do... well, between the two of them python is way
more popular in everything but web development. There's web frameworks with
Python but I wouldn't recommend them for someone who is starting now
(personally, I gave up on Django for Rails).

Nowadays it is better to start with javascript. It's not "beautiful" like
those two languages, but is very forgivable and node.js is all the hype right
now.

------
rudyonrails14
If going with the web, I'd go with JavaScript, to a degree you have to learn
it anyway. Python and Ruby are both relevant for web as well. Rails vs
Flask/Django - both will get the job done, plenty of use cases of major
corporations using one or the other.

If you're doing DevOps, you should probably learn both.

Everything else, which is more backend, APIs, data, data science, AWS, Google
Cloud, Big Data databases, etc - Python over Ruby. You may want to consider
Java here tho depending on how much performance is required due to many of
those aforementioned Big Data platforms having the JVM underneath the hood.

If you know exactly what you want and it's web, then Ruby, otherwise, all
things being equal, Python, and then for all things not being equal, Python.

------
ndesaulniers
Node.js killed Ruby IMO.

------
coltonv
Ruby still has significant use in web development due to the huge popularity
of Rails. Startups and established companies continue to start and maintain
projects in Rails.

Beyond that Ruby isn't used much. But a language that's extensively used for
one very common purpose is very very far from dead.

------
ahmgeek
One doesn't simply choose a language, language choose person.

~~~
wayn3
wrong meme. you should go with "in soviet russia.."

------
athenot
From a devops perspective, both may be needed depend on your approach to
configuration management.

\- Ruby is used for Chef.

\- Python is used for Ansible.

~~~
im_down_w_otp
Not much of Python is exposed through Ansible. Almost none in fact. Unless
you're deciding to write your own modules, and even then you don't have to use
Python. From a user's perspective Ansible is mostly YAML and Jinja2 filters.

Chef on the other hand is Ruby. Pretty much fully exposed as such.

------
al2o3cr
Which version of Python? _ducks_

------
amerov
Ruby created to build a DSL and accordingly allows to patch all that is
possible and it sometimes causes a long search for bugs.

Python quality libraries seems better. for Example: I have not found a good
HTTP client like Python's Requests or Guzzle from Php

~~~
obstacle1
>I have not found a good HTTP client like Python's Requests or Guzzle from Php

Have you tried HTTParty?
[https://github.com/jnunemaker/httparty](https://github.com/jnunemaker/httparty)

------
sairamkunala
Its like Rock, Paper, Scissors. One beats the other all the time. Its like a
loop of Programming languages.

A programmer chooses a languages which is convenient for the task at hand.
Ruby/Rails are amazing to lift off projects in hours.

------
gremlinsinc
if anything kills python or ruby it'll be golang or erlang/elixir ..my money
is on Phoenix Framework / Elixir eclipsing a lot of the ruby on rails
environment -- a lot of core rails devs have already begun building all new
apps in Phoenix. I haven't really grokked elixir yet, but it's on my todo list
someday when my day job eases up a bit.

------
Grue3
Python 3 killed Python. Ruby died by itself.

------
nnq
No, but JS will kill them both :)

</not the answer you/anyone wanted to hear>

------
iLemming
No. I think Clojure and Elixir slowly "killing" Ruby.

------
NoCanDo
No, but hopefully soon-ish.

~~~
thescribe
Is there a reason you want fewer languages instead of more?

~~~
gspetr
Yeah, this:

[https://xkcd.com/927/](https://xkcd.com/927/)

------
vgy7ujm
Between those two Ruby. But always Perl first if using dynamic programming
languages. Never Python.

------
kapauldo
Who flagged this?

~~~
gspetr
HN tends to be SF-centric and SF is RoR-central, probably the reason why they
flagged it.

