Possible Duplicates:
Rails or Django? (or something else?)
Django or Rails?
I come from a PHP background and was planning to try out a new framework. I have never done Ruby or Python before.
Knowing PHP, what language would be easier to learn?
Possible Duplicates:
Rails or Django? (or something else?)
Django or Rails?
I come from a PHP background and was planning to try out a new framework. I have never done Ruby or Python before.
Knowing PHP, what language would be easier to learn?
Rails. Because the community is generating faster than Django. Rails has won the framework game, no matter what people say.
Pylons is the complement of Rails (in Python), but still..it is lagging behind the community of Rails 3 (coming out stable very soon)
This question is likely to generate some terribly subjective answers. My advice to you is to go through the tutorials and introductory material of both python/ruby and figure out what language suites you better. After that decide on and worry about web frameworks (there are a myriad of others for python, at least).
I've just started learning Django, after reading the python tutorial in a few evenings. Things I've noticed:
My take on Django vs Rails, based on what I've read so far:
This is where IMHO the difference between Rails and Django imho really boils down to: Rails does things "by convention". Django requires you be a little more explicit, which in return allows the framework to perform better. Which one you'll like, depends pretty much on what kind of programmer you are. I'm obviously a Python/Django guy ;)
Both allow you to start a development server directly (like VS offers for .NET). Both allow FastCGI for hosting (like IIS app pools), can be run on the JVM (JRuby, Jython) and both have a specialized solutions for running an app pool (mod_wsgi in case of Django, mod_rails in case of Rails).
Some other worth full readings are:-
http://www.ctctlabs.com/index.php/blog/detail/rails_vs_django/
http://mackstar.com/blog/2010/04/23/django-vs-rails
http://superjared.com/entry/rails-versus-django/
http://docs.google.com/View?docid=dcn8282p_1hg4sr9
http://www.magpiebrain.com/2005/08/14/a-comparison-of-django-with-rails/
I don’t think either Ruby or Python are easier to learn coming from a PHP background.
You’ll definitely want to learn one of these languages a bit before using one of their web frameworks. But it might be worth having a look at the Rails and Django tutorials first to see which one sounds more appealing, then learn the requisite language.
Or just pick based on whether you prefer red or green. (You have to write Python in green and Ruby in red, otherwise you’ll get silent but problematic errors.)
I feel Python to be an easier language to learn than Ruby. From a C and C# background, it just feels more "familiar" for some unqualified reason, probably syntax and patterns.
Both frameworks are excellent. The Rails community seems larger. Django has well-renowned documentation. Django provides an excellent automatic admin interface, generic controllers (views), and other really nifty features to help you reduce the amount of code you need to write. Rails has built-in support for database migrations, and seems to be smoother to manage.
Keep in mind that Django was originally built for a newspaper site. It's absolutely excellent for those kinds of interactive, public-facing web sites. I imagine that Django's advantages have less impact when writing a full-on web application, and that Rails is more useful in this field.
I've used both, but my personal preference is Django. Regardless, I'd pick up Rails for a project it suits in a heartbeat.
Number of questions in Stack Overflow with the two tags:
ruby-on-rails: 16915
django: 8965
Number of books on Amazon in the "Computers & Internet" section:
rails: 222
django: 34
This doesn't mean that Ruby on Rails is better, but it has a bigger community.
I had to look at both for my project, coming from no prior knowledge of python or ruby.
I went with RoR first but then eventually got frustrated with it because of its 'programming by convention' design. Instead of just building what I wanted, I had to figure out the magic words to get RoR to do it for me. For me that's hard.
I switched to Django and have been much happier with it. Django has the phrase "No magic" as one of its central design philosophies. Everything is explicit, nothing happens unless you make it happen. Django maintains its programmer efficiency by providing a solid set of well designed tools. I also like the fact that Django was designed to scale from the outset. The fact that Google has chosen Django as their web application framework for App Engine, and python as their preferred scripting language reassured me that Django was quality software.
I'm not knocking RoR, it works great for some people. This is just my experience.
I started playing with both (my brother wanted me to learn Ruby on Rails. He says it's the way forward). However I hit a point where I just didn't understand Ruby on Rails. Django just has a nice feel, and I plan on learning Python which looks amazing. When playing my aim was to create a relational object application, which Python won (lines in the model then add the admin application). EASY.
Don't forget there are plenty of good PHP frameworks. I looked at Rails and Django but have been enjoying learning and using symfony for the last few years.
One thing I think is especially suitable is PHP in the template/view layer. It seems silly to see each framework re-invent its own weird/awkward/limited template sublanguage for including data and display logic in HTML, when PHP was originally made for that?
For the Model and Controller layers, PHP isn't as "pure" as Ruby or Python but it's still possible to write well-designed code.
Learning other languages is fun too though, and I think all the frameworks have been cross-pollinating each other to some extent. Have fun!
I'm of the opinion that all programmers in the world will fall into one of two camps, Python guys and Ruby guys.
Python is all about doing things the simplest, most straight forward way. In Python, there should only be one way to do something, and that way should be clear.
Ruby is all about pushing the language in innovative ways to create amazing APIs specifically for the task at hand. In Ruby, there is more than one way to do it, and you should always strive to choose the most elegant way.
Back when I decided I didn't want to do C# anymore I was pretty much in the same boat, what tipped the scale for me at that point to Ruby was that Ruby embraces functional programming ideas in ways Python doesn't. The creator of Ruby loves Lisp, and borrowed a lot of ideas and philosphy from it. The creator of Python has said explicitly several times that he finds functional programming in imperative languages ugly.
IMO you should choose your framework based on what language you want to go with. The differences in the frameworks are pretty much the same as the differences between the philosophies in the languages. One thing that may give Ruby on Rails an edge is that it is further along in building out a good deployment story, and sharing code/infrastructure with other frameworks on the platform, but that will all come in time with Django.
If I were you, I would pick up The Well-Grounded Rubyist, read through it, find a great Python book and read through that, and then make your own decision. Depending what parts of the Internet you frequent, you will find either rabid Rubyists or rabid Pythonistas trying to convince you the other side is crap.
I think it's more a matter of taste. That's why I'll tell you why I personally prefer Ruby.
Ruby is an equally strong language as Python and I think it is the easiest language you can learn. That's why the productivity matter is number one. The main mantra is to like what you do and to have pleasure when you see the code, it's plain English.
I like its syntax very much (no indentation like in Python which personally bothers me to get these kind of errors), method chaining which I found is very easy to understand even if you don't know Ruby and with the philosophy of "there is more than one right way to do something" which makes me feel more free.
Ruby, I think, is also the strongest metaprogramming language and that's why there are many great tools around Ruby on Rails that can't exist in other languages.
I also love the TDD and BDD philosophy of Ruby on Rails which you will eventually do if you want to be a successful web developer and Ruby on Rails has great tools like RSpec, Cucumber and much more, which I don't know if there are so good tools in any other language (and have that tools due to strong metaprogramming abilities of Ruby).