6 ms·
As someone who doesn't do enough web dev to justify learning Ruby just for Rails: how does it compare to Django? That's the only batteries-included web backend
by rich_sasha 2y ago
As someone who doesn't do enough web dev to justify learning Ruby just for Rails: how does it compare to Django? That's the only batteries-included web backend framework I'm familiar with...
Asking out or curiosity.
- sethherr 2y agoOne place that I think there is a big difference in developer experience is in testing. Rails, as described in the article, comes with CI setup and corresponding tests are automatically generated when using rails generators.
- WD-42 2y agoThe biggest difference is python vs ruby. Python’s ecosystem is massive, so if you want to pull in any third party libs you have plenty of choices for whatever you may need. Django also has auth and the admin interface built in, both of which are very nice.
- tyre 2y agoRuby and rails’ ecosystems are also massive. Devise and ActiveAdmin are options for those two, though I haven’t used either in years. With much of the AI development happening in python and typescript, you might be right about those areas.
- WD-42 2y agoRoR's ecosystem is indeed massive - for web apps. But if you want to make an app that integrates with an existing domain, Python is just so far ahead. Numpy, SciPy, Pandas, basically the entire field of astronomy and biology, data science and FinTech... the list goes on. But if you are sticking to basic web/database stuff it's hard to go wrong with RoR.
- theonething 2y agoa best of both worlds solution might be to have a Rails web app and Python services. Of course if you like Django/Python better anyway, then just use those.
- wmoxam 2y agoAll of that extra stuff can still use Python and integrate easily with an RoR app. Typically your astronomy/biology/ata science stuff isn't needed in the context of a request and is done asynchronously
- WD-42 2y agoThis is just not true. I’ve worked with many scientists, none of them want some complicated micro service architecture they have to deal with. They just want a page that displays their data or whatever, and that means using Django or flask and using whatever library they write directly. Most people haven’t even heard of ruby.
- wmoxam 2y agoOk
- realusername 2y agoPython might be bigger outside of the web but for any Web app, Rails wins hands down on the amount of battery included software that exists in my opinion. I've done both and I find that in Django I had to resort to more manual steps than what I'd do in Rails. The testing story is also better in Rails compared to Django, that's not even close.
- dismalaf 2y agoRuby doesn't really have a learning curve... Maybe block syntax but that's super easy. Rails gives you way more structure than Django.
- delichon 2y agoYou may be overestimating the rest of us. It took me years to get fluent and I'm still learning after 12 years full time in Ruby. Sure you can learn the basic syntax in short order, but for us muggles, not the quirks of the standard libraries, let alone the whole ecosystem.
- dismalaf 2y agoThere's always things to learn. Ruby does have enough features that you can take years to memorize things, sure. But to learn enough to make a program that does useful things doesn't take long. If you already know how to program in a different language, maybe a weekend at most. Ruby was my first language and it didn't take me long (maybe a week of very part time tinkering) to learn how to make a basic 2D platformer game, or scrape the web for financial data and throw it into a database. The first time I made a Rails app it took maybe 30 minutes, to go from nothing to a basic CRUD app that does things and is online on Heroku. In a professional context, I've heard of non Ruby devs getting up to speed pretty quickly. And as much as there might be to learn mastery, it's still a dynamic language that takes away most details for you (like managing memory) so you can definitely be useful far quicker than if you were to learn C, Rust, Haskell or shudders C++.
- shepherdjerred 2y agoRuby _definitely_ has a learning curve
- hombre_fatal 2y agoEspecially reading other people’s code.
- hatsix 2y ago
- Glyptodon 2y agoHistorically, Django Admin is better (in terms of ease of use and flexibility) than anything equivalent in Ruby, but Rails has better conventions for tests and routing. (Or at least that's my opinion.) I also like ActiveRecord + Arel more than the Django default ORM, but that's more so preference driven by like the Ruby AR syntax more than the Python. (And a general unsupported opinion that Ruby is a slightly better/more pleasant language for writing code than Python.)
- aantix 2y agoI would say that Avo is by far the best Rails admin-like solution out there. It's beautiful. https://avohq.io/ https://avohq.io/
- sroerick 2y agoThis is my go to line and nobody has challenged me on it thusfar: If I was building a web ‘app’, consumer facing product, I’d reach for Rails. I think scaffolding up to ‘market ready’ seems easier in Rails. I say this having never really done this in production. For internal tooling (using the admin panel), data based work, or geospatial work, stick to python
- Lutger 2y agoHaving years of experience in both, though not recently in rails, these are some of my thoughts: Obviously Django ties you into python and its ecosystem while Rails means ruby (and its gems). The ecosystem is more important than the language. This can either impact your project a lot, or not much at all, depending on context. Rails doesn't have the equivalent of Django's admin CMS. There are gems but Django is still much stronger. A lot of orgs have their entire CMS / administrated-by-staff part of the product written in it. Rails, otoh, has a very powerful scaffolding cli. If you are proficient, you can generate some basic crud stuff in minutes from A to Z. In general, I think Rails is at an even higher level of abstraction than Django. A lot of the architecture or structure is more or less given with rails, whereas you need to make a lot more choices with Django yourself. Routing is a good example. The 'batteries' that are included are also a bit bigger and seem to be in much more active development than Django. Also a generalization: rails/ruby seems to value brevity and the DRY principle a lot more than is common in django/python. There's a split in taste on this, often python devs find the 'magic' of Rails rather frivolous and unreadable - even though django has a fair bit of metaprogramming itself, whereas Rails devs think the 'pythonic simplicity and straightforwardness' is actually rather crude. Or to be a bit more precise: in the rails world, code duplication seems to be thought of as a greater evil than semantic coupling. I realize these are all quite subjective, and probably reflecting my own development experience more than being an accurate feature-by-feature comparison.