5 ms·
Ask HN: RubyOnRails or Django/Pylons?
First of all, I know this has been asked to death here, but after searching a lot, the most recent post is more than a year old, and a lot has changed in these frameworks lately.
I'm a fairly experienced developer (Java, C#, Objective-C) and I want to try my luck with some webapps. I've used python for small things, but nothing that you wouldn't learn in a week, so basically, I'm new to python or ruby.
So, assuming I'm already a programmer and want to learn web programming with any of the above, which one would you recommend based on their functionalities and ease of learning?
- idontlikebacon 16y agoI chose Django because I love working with Python, and it still can provide a lot of value without the framework. Django is also less cumbersome when you first build a project (a handful of files vs multiple directories and files form rails.) Django also provides a lot of useful stuff out of the box -- like an admin interface. Besides that, everything I've seen built in RoR can be built with Django, and vice-versa. The frameworks and the languages are pretty similar, so it's mostly a matter of taste.
- meric 16y agoSeconded. It really comes down to whether you like Ruby or Python best.
- gte910h 16y ago>I chose Django because I love working with Python, and it still can provide a lot of value without the framework. Ruby on Rails folks hate when you say that though, cause it makes the language half of their equation look less good. It feels like a "Oh No You're going off topic no fair". They should just say "Yup, python is better for that other stuff" not "But we're talking about webdev!". To me, it agains feels like a community thing. Rails community does stuff like that, Django people seem to care less if you like what they do too. The fact my rails apps can't as easily control hardware, do math, or call C++ or Objective C code with minimal glue actually is a problem for some solutions I do. So I like python (my actual preferred solution right now is GAE, not Django, but that's more economics/scaling based than technical. To be honest my latest rails dalliance is because of the characteristics of heroku, not rails itself
- jph 16y agoRails 3 is such a major improvement that I recommend it highly. The new modularity is enabling all kinds of interesting developments, like nesting apps within apps, authentications among multiple frameworks, and speed improvements. Ruby 1.9.2 is also a major improvement in speed, and JRuby is icing on the cake especially for large scale projects, integration with legacy code, and detailed debugging.
- gte910h 16y agoPython will be more useful if you decide to do something with the language other than ruby on rails. People do all sorts of very powerful math with it as well (SPSS, SciPy, NumPy and various other things). ROR is NOT for those who are willing to just get it done. You have to be the type who's willing to find the right way, or risk things blowing all to hell on you (Off the rails, as they call it). I'd also say, the devs you hire between the two schools seem different. Can't explain it. Django seems to win it for me, both on a scalability ease and learning curve. (I work with both as backends pretty daily, iOS developer). Ruby feels cooler, but IMO, python lets you go home and see your kids faster.
- nwmcsween 16y agoAre you trying to troll? ROR doesn't have a 'right way' it's far from that rails 3 has switchable ORM's, template engines.. etc. Ruby was inspired/designed with elements from perl which itself was designed as a rapid scripting language, your arguments are badly biased.
- gte910h 16y agoThey're opinionated, not biased. Bias would imply there was something impartial asked for. Know what else is opinionated? Ruby on Rails. (This is quoted widely on the web, by Rails devs!)[http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=ruby+on+rails+is+opinionated#sclient=psy&hl=en&q=%22ruby+on+rails+is+opinionated%22&aq=f&aqi=&aql=&oq=&gs_rfai=&pbx=1&fp=c378ea192fa222ae http://www.google.com/search?sourceid=chrome&ie=UTF-8...] I'm not criticizing ruby, I don't have any issue with it (I'd still go python over ruby, cause I'll take libraries over pretty close but slightly better syntax any day). But ROR can get in your way when it's times to ship as I've explained several times in this thread. Its opinions get in your way when you want to do something it thinks is bad. This is an issue when you want to get work done sometimes. I don't think the guy is damned to hell if he uses ROR or anything, I just think unless he's a guy who can't make himself (or his teammates) follow the rules when he doesn't have to, he has a stronger product more adaptable to development realities with Django.
- 16y ago
- ianp 16y agoThe best way to pick a framework is the same as the best way to pick anything-- make a simple app like a blog or a forum with both frameworks and decide from there which one you like better.
- danieldon 16y agothe most recent post is more than a year old It gets asked every month or so, the last time I remember was just last month: http://news.ycombinator.com/item?id=1830063 http://news.ycombinator.com/item?id=1830063 And I'm going to refer to my comment from that discussion: http://news.ycombinator.com/item?id=1830895 http://news.ycombinator.com/item?id=1830895
- orlandop 16y agoSorry for that, seems my GoogleFu is in need of some work.
- patrickaljord 16y agoYou won't get a non-biased answer here. Both of them are good and similar. If you are looking for something different, give node.js+express.js a try, it's good too though a bit less mature.
- maheshs 16y agoPython vs Ruby - Both are great. I tried ruby first for a week or so and then move to python; I love python simplicity. According to my learning experience you can learn python faster then any other language (I am a ASP.NET/C# developer in my day job.) Django vs Rails - I don't have any experience with Rails because you must know ruby first. Django is a natural choice for me because of python. Till now it seems good to me (around a month experience). It is seem not so cool in comparison to Rails but its good (I also know little bit of ASP.NET MVC). Note: I am not an expert in both language/framework, so you can ignore my suggestions.
- tptacek 16y agoYou have a week of Python. Spend 2 days with Ruby. If you fall in love with Ruby, go with Rails. Otherwise, stick to Python. It's that simple. They're basically the same thing.
- gte910h 16y agoThe differences between python and ruby aren't the important thing in this question. The languages are different (ruby: better syntax, python: better libraries). The important thing is "Are you the type of person who will excel with very strong strictures on your work" (Do rails) or "Are you a person who sometimes disregards the rules to do work more expeditiously" (Do python)
- danieldon 16y agoYou have that completely backwards. If you are coding your Python like that, you are doing it wrong and almost certainly drawing the ire of the people you work with.
- gte910h 16y agoI mean, they get really pissed off when we hack a view 2 days before a deadline instead of just not delivering it. I mean people LOVE when you don't deliver. Hacks are not good. Hacks should not be done all the time. But sometimes, shipping is more important than beauty and elegance. Hacks you put up while you get the real, good code in place is next to godliness when working in multicomponent systems under tight deadlines. Rails just isn't as good when you need to do that sort of thing. It doesn't have that flexibility, by design! When I write the hacked up glue code first so they can do their stuff while I write mine, they f-ing love that. It lets them do their job! I do things "the right way" 99% of the time. That buys me incredible flexibility to use utter crap code that's otherwise functional that other 1% of the time when required by the job.
- danieldon 16y agoI don't presume to know your work environment, but personally I work on my own projects and do contract work and, in my experience, taking on debt is usually a sign that there's a problem with the requirements and estimates, so I usually change those before making the code less maintainable (which, IMO, is usually a case of treating the symptom). Regardless, I'm weary of claims that controller-level (django view level) code is a major pain point in Rails. In some ways it's actually easier since you can make fewer decisions by making them resource centric, but even deviating from that is as simple as map "/path", :to => "controller#action". Rails/Django controllers/view and routing/urls aren't as elegant as micro-frameworks like Flask and Sinatra or not-so-micro-frameworks like Padrino, but they aren't anything close to serious stumbling blocks (though maybe routing to a very small degree in resource-centric Rails 2). Every blocking issue I've had with either framework has been on a deeper level. In Rails pre-3, it was usually configuration-related when trying to do something too unconventional. In Django, it's when trying to deviate from the overall Django philosophy and use something other than the included batteries.
- nwmcsween 16y agoI use rails, I can only comment on pylons and turbogears from around 2006 when I gave up on it. I gave up on both turbogears and pylons due to 1. no community and 2. nearly no updates. Rails has a huge community, lots of plugins, etc as does Ruby. As for Ruby itself the language just meshes with my way of thinking if Python does that for you then go for Django
- cies 16y ago(opinion warning) ruby is more nice to the programmer. python has more corporate backing. django is a pain-in-the-ass compared to rails, pylons is better but still not the collection of power tools that is rails. i feel the python community is tail chasing the ruby community now-a-days. catching up will be hard as the python language misses the "principle of least supprise" that is a guiding principle for ruby. python (like c++) managed to supprise me after year of coding with it.
- barnaby 16y ago:-) More people should use the opinion warning (Opinion warning) They're basically the same level of overall goodness. Django may be better at some things, Rails on others. The whole penis-size-measuring contest between both camps is kind of annoying actually. Having said that, I REALLY enjoy Django, a lot, and recommend it to everyone when they ask which of the two they should chose.
- gte910h 16y ago>(Opinion warning) They're basically the same level of overall goodness. Django may be better at some things, Rails on others. You try to state that opinion around here, even clearly stating the stuff Rails is better at, but you get railed on when you say the stuff it ain't better at is why you prefer the other. See what happens.
- gte910h 16y agoAs a person who talks with people at corporations about stuff like this (heroku vs gae vs ec2 vs corporate data center is a huge discussion these days in the business community, even for non-consumer facing sites and backends to non-web projects): They hate 2 features of rails in the conversations I've had: The fact rails devs seem unwilling to take shortcuts that Django/other python webdev guys will. They also hate "It is just broken", which seems to come out of rails guys in their experience more. Note these are entirely non-technical and come from a open ended menu. Also, my particular town has a pretty large python community (we hosted pyCon in 2010 if you went, I wrote the initial bid).
- jtchang 16y agoI like the python community better than the ruby one. So I ended up going with python. That said, I really like Pylons. I wish I could find more people who use it. It is one of those frameworks that gets more powerful and makes things easier as your webapp gets more and more complex. This is opposed to rails or django where if you didn't design it at the get go and try to bolt it on you tend to be fighting the framework.
- pdelgallego 16y agoWrite this applications in both languages: - a url shortener. - a easy blog system. - a naive twitter. Pick whatever feels more natural to you. If you wet stuck in any of this applications, you can drop me a line, I will try to help you.
- orlandop 16y agoThanks for the great suggestion, and unbiased answer. I think that is the path I'm going to take.
- clyfe 16y ago(Opinion warning, as in "this works for me", not an absolute truth) I like Rails better because: * I like Ruby more than Python (no "self" in methods, Ruby's list.map(func) vs Python's map(list, func), usable as a template language (ERB), open classes -> easy hacking) * Rails `Books#has_one :publisher` vs Django `models.ForeignKey(Publisher)` * Rails migrations + db reflection vs Django attr declarations `models.CharField(max_length=300)` (Yes I know about south, you still declare the attrs tough) * Rails has Bundler http://gembundler.com/ http://gembundler.com/ , dunno about Py ... * Django router http://docs.djangoproject.com/en/1.2/topics/http/urls/ http://docs.djangoproject.com/en/1.2/topics/http/urls/ vs Rails router http://guides.rubyonrails.org/routing.html http://guides.rubyonrails.org/routing.html (ie. declarative regexps vs executable well tought semantics) * rails erb (haml etc) views vs django's-template-language because python can't do templates because of the indenting * the list goes on but I'm bored Ruby is beter at web stuff than Python. Python has more science stuff (NumPy etc). So I vote Ruby on Rails
- lukeinth 16y agoI'm happy using Ruby and Python and have built sites with Rails and Django in the past. These days I mostly use Flask (sorta like Sinatra in Python) as its lightweight and has templates that don't drive me insane (sorry Django). For a large app with lots of models and mixed developers I would likely choose Rails.
- zachinglis 16y agoI would personally say Ruby. But then again; given a longer answer I would say the same thing I say about camera brands. Pick both up, which feels 'right' to you? Ruby and Python are both great languages. I prefer Ruby as I see it as the current front runner.