Hacker News new | past | comments | ask | show | jobs | submit login

Can someone help this old (2^5 years) developer out? I've worked with a number of programming languages over the years, and have never found a combination that brings me such joy and productivity as Ruby and Rails. However, I've always felt that Python and Ruby were very similar in style & goal.

Can someone who is experienced in both Rails & Django explain why Python & Django are trending up so quickly, while Ruby & Rails are ranking on the "most dreaded" lists? I don't want this to become a holy war, I am just genuinely curious what I'm overlooking.




You asked about why Python but it has a lot to do with JS too. But first lets compare against Python:

Ruby is a delightful language, but it's dominated by one niche (web development) and one framework (Rails).

Over the last 10-20 years Python has become the main teaching language in Academia. This has greatly contributed to it's ecosystem for math and science, which in turn has contributed to its rise in Data Science and Machine Learning. It also gets a lot of support from Google.

All of these things combined mean that the broad rise of Python is lifting up Python for web development, but if anything I'd say web dev in Python is lagging behind those other uses.

There's one more thing that I think is the root cause of why Rails - the framework - has faded somewhat in the minds of web devs. Rails has always been an opinionated framework, and early on they came up with "The Rails Way" to do front-end assets. The combination of Sass + CoffeeScript + Asset Pipeline with built-in concatenation, minification, and asset hashing was pretty neat compared to the old world of a bunch of es5 files loaded via script tags.

But this hit before the rise of NPM and being able to `require('foo')`.

The JS packaging wars went on for a while and none of those asset solutions are as simple and "just work" as the Rails Asset Pipeline -- but the asset pipeline doesn't hook you into NPM. Rails dragged its feet for a long time on that before adding webpack support.

So I think during that time you had a TON of the trendy hipster open source people moving into Node first on the front end, and then eventually losing interest in Rails because the framework wasn't making it easy for them play in the very latest js ecosystem.

And I think there quickly became some saltyness among Ruby devs about Javascript, that people were overdoing it and that really you only needed "sprinkles" of Javascript to make a great app.

So (1) Python has risen a ton overall, lifting Django, and (2) Rails was slow to embrace the JS craze and that held Rails back.

Those two trends pretty much tell the story as far as I can tell.


Yes, one of the biggest drawbacks in the Ruby world is the lack of strong libraries outside of web dev. Python has scrapy, numpy, pandas, nltk, beautifulsoup, matplotlib, etc. Basically if you want to do almost anything (except high performance real time stuff) you can do it in python. it is an excellent general purpose language.

In ruby, the world isn't so great. When I was in the ruby world, I would always hit roadblocks on my side projects. There were so many times where I wanted to do something not web dev related and I couldn't find a popular and well supported ruby package. For example, I wanted to do text analysis of some sites I scraped and python's nltk was perfect (but there wasn't a perfect ruby library).

The ruby world needs to expand beyond web dev if it wants to grow.


There is only a shortage of scientific libraries, you can do others tasks than web development with Ruby. Ruby is great for sysadmin tasks too for exemple. Many configuration tools was developped in Ruby.


>The ruby world needs to expand beyond web dev if it wants to grow.

I mentioned this in my other post. Ruby is the only language on the top list that doesn't have a major cooperate backing. Basically Ruby community are really lack of resources.


This is a great answer, and to expand on one particular point regarding "lagging behind", Django is not the most popular web framework in Python, Flask is, and by a lot. 24.8m downloads for Django, vs. 58.0m for Flask in the past year.

Additionally, neither Flask nor Django support ASGI, which is the future of how web frameworks will be written in Python. Quart is "Flask for ASGI", and Django has roadmap plans to start moving vaguely in that direction, though they're still a long way off.

Python has also struggled mightily with package management, and how to do it "one right way", which is one of the mantras of Python. Pipenv is a step in that right direction, but it's taking time to get people to adopt, and it's got warts of its own still (though it's getting better every day). I think it's still technically in "beta" (for whatever value that has these days, I am sure plenty of people use it in production).

Let's also not forget the python2 vs. python3 migration problem that I think we're finally now starting to get over. With python2 set to depreciate in 2020, the clouds are starting to lift on the major problems in Python, so naturally you're seeing a rise in converts.

https://asgi.readthedocs.io/en/latest/

https://hugovk.github.io/top-pypi-packages/

https://pipenv.readthedocs.io/en/latest/


You're probably going to get a lot of responses with "this is why rails is bad" and "this is why django is good".

Though having worked extensively on both and not having a particular love for either, the simple answer is this (IMO):

Python skills transfer to other industry disciplines far better. Picking Django (vs Rails) is just a good career move. Data scientists use Python heavily (scipy, numpy). Many universities teach Python as the first scripting language. Python has a much stronger foothold outside of web frameworks.


I switched from Python to Ruby because I wanted make my own hobby website and Ruby on Rails looked great. And 14 years later, my website has long gone, but I still use and love Ruby for all my scripting needs while my Python skills have faded.

And it's a real problem when I want to do hobby signal processing or deep learning stuff.

Python has won that segment of the market and I better get with the program.


Heck, I'm looking at this survey and wondering if I should put Python on my learning queue. It does seem to be in use across a lot of disciplines, including some of the most popular emerging techs.


and honestly. You'll be 60% competent within a week or two. There's a long tail of language features and idioms, but that basics get you so far in python.

I'd contrast this with say Java, my other mainstay and Scala which I'm picking up in pieces right now. Java is quite explicit and has quite a bit less built-in so you don't feel very capable or productive for quite a bit longer. Scala has so many syntactic variants and features that the volume of stuff I have to learn is relatively vast. Every third block of code I read uses a new unheard of language feature or concept. ... and I have some functional programming background.


I have no hard evidence, but from a business perspective I have figured that one of the main appeals of Python is the combination of simple and strict that defines the community. Some languages (cough Perl cough) are practically art, and that frequently translates to a steep learning curve for new developers to a project, which in turn means cost to the business. Bringing on a new developer to a Python team feels like it involves a much shorter time-to-productive transition period. As a manager that makes me biased towards Python for workloads where a scripting language makes sense.


Given that students are probably learning Python in university, I could see this being a strong reason for its growth. I hadn't thought of the "manager" angle - it makes sense that it's easier to plug a new developer into a Python codebase than it is a Rails codebase.


To me, Python's rise in growth centers more around its appeal to the Data Science community and the ease of non-programmer types to pick it up and use it effectively with a much smaller investment of training time. Ruby, although much more flexible of a language is much more difficult for a non-programmer to pick up easily.


I also don't understand this. Even today, Rails is, by far, the most productive environment that exists for developing a web application. I speak this as someone who also wrote a ton of backends in Node.js, Java, and many other languages (never tried Django though, so I don't know about that). Almost all of those applications would have been 10% of the effort if they were just Rails apps.

A sibling comment here mentioned that Rails' power came from other gems, but that's not really true. Rails is still actively developed, and just Rails, by itself, gives you more functionality out of the box than whole 1000+package Node stacks.


Django and Rails achieve a very similar productivity, with similar high-level ideas, implemented by completely different low level architecture.

While Rails has an inclination to apply code generation and convention, Django tends to use introspection and monkey patching to get the same results. Both are amazing on similar ways, but horrible on their own different ways. Maybe Django developers just go into a different framework when they get some project that isn't a good fit, so they see less of the bad.


IMO Spring boot is definitely more productive than Rails; it's basically all the nice things about Rails except more mature and more comprehensive. The JVM is also much more performant than Ruby and Kotlin/Java is a better language in terms of long term maintenance (a proper type system).


Authn/Authz needs to be integrated into code already.


That's a fair point. Devise is pretty much standard so it's easy, but you're right that it would make more sense for it to be part of Rails to begin with.


This, I asked about this a year ago and most of the Rail Core seems to be against it.


In what way is it better than other frameworks, like Laravel?


`rails generate scaffolf products name:string` generate models, views, controller, migration and even controller tests. I dit not seen this anywhere outside Rails.


You can do that with the Symfony console, Phoenix mix tasks and I would guess a lot of other frameworks.


I use Python extensively at work for one main reason: Tensorflow. We're an ML shop, and Python has the most well-developed tools for ML. Ruby doesn't have anything that even compares to numpy in quality, let alone all the things built on top of it like scipy and pandas. It will take a huge amount of effort for Python to catch up.

Personally as an infrastructure engineer, I'd be incredibly happy to drop Python, and almost everyone on my team agrees. When you're building complex data processing pipelines that have to support the hundreds of features that scientists ask for, having static types (especially ones that differentiate between different dimensions of tensors) is a huge win over having to write a unit test for all the possible combinations of things that can happen.

Unfortunately from a solid infrastructure perspective, Ruby is even messier than Python due to the rampant metaprogramming culture. This doesn't matter so much in web dev where the layers of complexity are not that thick, but in other types of development it becomes a real burden very quickly. That might be one reason why Python is preferred over Ruby.


Separately from my other comment, you said Python and Ruby are very similar in style and goal, and what are you overlooking?

As someone who has done a decade of Rails development and works in a Ruby + Python shop, I'd say you haven't overlooked anything.

Ruby and Python are so similar in style and tradeoffs that it's quite difficult to make a case for one _language_ over the other for any particular task.

So then it comes down to (1) ecosystem and (2) personal preference.

For a long-time Ruby has had a better web ecosystem. I'd argue this is still true, but I don't know if it will last. The reason is that Python's overall ecosystem has developed a lot more than Ruby's and the overall larger community is really valuable.


I can speak to the RoR dread side, as someone who is now in Django-land coming from RoR.

RoR is ridiculously opinionated. If you don't know The Ruby Way then you'll be fighting the framework for every inch of productivity. It also has a lot more magic than any other framework I've ever used. It hides so much of what it does behind abstractions on top of abstractions that it's hard to do a simple thing and understand what's happening. (This ignores the fact that Ruby is Perl in better clothes, both a huge strength and weakness, depending on your past experience.)

Django is better in that it's slightly more obvious what's happening and why. It still has some magic to it, but not to the same extent. You can also do whatever you want, and it'll be a little harder or a little easier, but it doesn't fight you nearly as hard if you're not doing things The Django Way.

I think if you're a RoR dev and know RoR and like how it works then you're golden - stick with it and be productive. If you don't drink the kool-aid then you're not going to be happy.


Over the years I've ramped a couple dozen engineers onto Rails. The very first thing I have them do is follow the full rails tutorial front to back, no matter how many years of experience they have. It usually takes a day or so.

I've found that after doing that, people (1) get it easily, (2) don't feel it's "magical", and (3) enjoy the environment.

Conversely, SENIOR engineers on other teams who did not go through this process often express sentiments like you did. At this point I can pretty much guarantee the people who are salty about Rails are people who don't normally need to read the manual. They didn't read the Rails manual, and they're confused, and they're not used to being confused, and so they get grumpy and bitter about that over time.

Personally, I like Rails. But I do think that the "convention over configuration" approach has this major tradeoff - you really shouldn't just dive in and figure it out, you should read the manual first. And I get it why some people don't like that and don't think it should be necessary.

So yeah, it's opinionated, and thus it's polarizing.


I have learn Rails and Ruby some years ago with only Mickael Harl Tutorial. It was better than learn Python/Django at the same time.

Python popularity is rised thanks to academic . But it is not the better programming langage so far.


There's a saying I'm fond of that goes something like, "Python isn't the best language for anything, but it's the second best language for almost everything."

But if I had to pick one thing to point at to explain its rising popularity, it would be data science, as others have mentioned. I wonder if Travis had any idea the impact he would have when he made numpy.


Whilst I'm pretty heavily experienced in Rails I'm less-so in Django. If I had to guess Rails being dreaded is down to experienced Rails veterans wanting to move onto the new hotness, and the rise of Python / Django being simply down to the fact that people newly getting into web development are far more likely to know Python than Ruby.


Django is likely rising because Python is rising. Most people are learning Python as their first language, and Django is a logical tool for them to try to build web apps.


I seem to recall that Matz, creator of Ruby, once said (paraphrasing) that he didn't try to create a popular language, he tried to create a beautiful language.

Python's creator, on the other hand, worked at Google for a while, and like Sun, Oracle, IBM, and Microsoft before them, schools and beginners are naturally drawn to things used by the big companies.


Personally I choose Python over Ruby and Django over RoR just on syntax and readability. There’s absolutely nothing about the way Django names and structures their framework that has me guessing but RoR is full of them.


I personally prefer Django because everything is more explicit than in Rails.

Explicit imports, no magic file locations or configurations...


The main reason why Python is trending is mostly because of the data science community. Things like Pandas, NumPy, Jupyter Notebooks and Tensorflow all are built on python, mostly because of its simplicity and ease-of-use more than anything.


There's nothing rising about it, Django been around and very popular for years.

Python is just a great confluence of all of the things that other languages lack, and the Python language is adapting to include more and more of the things people actually want. I don't think the Ruby language has been nearly as responsive (some would even say that Python has been too responsive, and certain language features are going too far outside of what the core of the language should do).

Also, Python is notorious for its excellent documentation (Django follows in those footsteps) and gigantic helpful community. I don't know how comprehensive Ruby's docs are, however.

Python hits all the notes, from "I want to write a random script to do a thing" to "I want to develop enterprise level software with hundreds of thousands of lines of code". You can probably pick Python as a default for nearly any baseline business-method problem and be in pretty good shape.


IMHO, I find python increasingly lacking in features, especially its lack of enthusiasm in adopting functional features, including immutable data structures, pattern matching/ destructuring, python lambda functions are restrictive. To my eye a strong imperative flavor pervades most python code. After some time spend dabbling in Clojure, I find python rather primitive.

Generally it is true that learning a new language, will give one new tools to reason about problems. I find Kotlin and Python amongst the languages I have used, to offer the least new insights and ideas to the student.


> To my eye a strong imperative flavor pervades most python code. After some time spend dabbling in Clojure, I find python rather primitive.

Likewise here (except Rebol instead of Clojure). I've never been able to explain it well, but something about Python feels really limited in a very similar way as Java (like, 1.6ish) does.


Not all languages need to be functional, or grow in their functional support. Functional programming isn't the future, and Python is very opinionated about how you use it, so adding functional features would further muddy the water in terms of how a new user gets started in the language.

Adding functional features would make Python materially worse.


If that opinionated manner is the usage of a plain imperative form, then it isn't leveraging the advancements made more popular in the upsurge of interest in functional methods in the last 10 years.

I am not saying python should grow these features, but merely that for any new work for which python is being considered there could be a strong case made for choosing a more modern, more safer, more functional language instead.


Functional isn't safer or modern, and Python is about as safe as they come. Try out type hinting if you're scared of duck typing.

Besides, safety for its own sake isn't all it's cracked up to be. I'm happy to take on additional risk in my development process if it allows me to move as fast as Python does. I can account for that risk in other areas, like how I deploy changes and how I do redundancy/failover.


One of the main findings of the SO survey was that Python is indeed rising, overtaking other languages as one of the most popular and desired, so although it was popular in the past, it's definitely rising.

Most everything else you said could also be said of Ruby - docs, helpful community, flexibility from scripting up to massive webapps. That's what perplexes me - what are the "more of the things people actually want" specifically that drive Python's growth?


It's degrees. Sure Ruby has those things too, but Python's is better/more comprehensive.

Go look at the releases up from 3.4 of Python. The features that have been added since then are pretty specifically what the community has been asking for. asyncio being integrated into the language, type hinting, f strings, just to name a few.

But yeah, it's not about "does it check the box" at this point with language like Python and Ruby, it's about how they check the box, and to what degree. Simply having a feature isn't enough.


It's really sad that those smart people can name a programming language as 'Go' and I get confused whether you've started talking about it or was just a verb...


I think Python is trending up because it’s a general purpose language that’s easy to learn.

Django basically does what Ruby on Rails does, not exactly but close enough. Flask does what Node.JS does, to the extend that we’re talking about building quick prototypes, not running Netflix. So you have most of your web-based needs covered. Python also does data though, and is to ML and BI what NPM is to web-development, and lastly Python does systems scripting. Basically Python does most things, well enough. By comparison, ifyou’re a .NET house like we have been, you’ll use C#, Microsoft SSIS/SSRS, Powershell and probably Python to do what you could do with all Python.

So I think that’s a big part of it. The other big factor is that Python has replaced JAVA in most of Academia. JAVA was great and all, but being something a very high percentages of CS majors learned surely helped it.


> Flask does what Node.JS does, to the extend that we’re talking about building quick prototypes, not running Netflix.

Flask is better at Netflix scales. You don't want opinionated frameworks making decisions for you in the endgame. That's only good in the beginning to get off the ground


As an outsider to both: I think a lot of it is new/shiny. ruby on rails has been popular enough for most people to have seen the mess bad coders can make. Django never got as popular (I think it is older, but it for long has been an also ran).

The other half is ruby/rails got a reputation of being a language where some write-only code was encouraged. Djanjo and python have long encouraged writing maintainable code. This is a culture thing - there is no reason you cannot write unmaintainable code in python or maintainable code in ruby, but the reality is people didn't. This is part culture, part rails encouraged getting something working fast even if it wasn't maintainable while Django has also said take a little time to get it right in the first place and it will pay off.


If it wasn't for Rails, Ruby wouldn't have had half the success it did. This is not the case for Python which is used for things besides Django.


Calling yourself old at 32 doesn't really help the problem of ageism.


According to the developer survey, I'm in the upper 50% in years of experience. I know I'm not old by any reasonable metric (it was mildly a joke), but relative to the industry I'm above-average in age, which is wild but true.


> which is wild but true.

Not really. I would take SO survey results with a grain of salt. The respondents always skew towards the younger, less experienced crowd (68% had less than 10 years experience in this last round). It's not representative of the industry.


more young people are also likely to engage in online surveys, since they've grown up with this type of stuff.


Maybe language does not matter that much in many cases. Modern languages have become so good that I don't find myself wrestling with them very often. When it comes to the point that I do need to fight my programming languages, well, let's just say there are way more serious stuff for me to worry about first, like system designs, algorithms, underlying platforms, ecosystems, and team dynamics. Really, language is the least concern at certain point of your career.

Or maybe great engineers just pick whatever that suits their job, and create amazing things. After all, Guido uses Python, Katz uses Ruby, Linus uses C, Odersky uses Scala, Jeff Dean uses C++, and the list goes on.


I agree but strong typing surely helps with a decent editor linting.

Recently, I had a moment to code in MQL4 language and boy, I needed a break for just fighting against the language. Not even associative arrays and no proper NULL with magic variables that changes behind the code all over.


Rails' power came from the gems, once the development shifts from there, Rails became a problem to maintain.

I'm liking React more now since you get the full power (and clusterfuck) of npm.


Rails 5 has webpacker embedded, you can use npm packages in your projects.


Correlations. Language and framework preferences are driven heavily by the environment in which those languages are used. My hypothesis is that firms which still use Rails are likely to be less responsive to their developers' demands and interests in exploring new technologies and thus "working in Rails" has an association of "working somewhere which makes me use Rails."


Python is really simple and easy to read, and macros can make it really hard to switch from code base to code base in ruby. Python is also the #1 intro teaching language in boot camps.


if it makes you feel any better, many of the YC companies are looking for devs with Rails experience




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: