70 points · by notdarkyet · 18y ago · 112 comments
EDIT (To elaborate a little on my project, without giving details):
The project is relatively simple and provides a service to an area for a small fee. For now, the area would be specific to one geographic location. As the site grows and progresses, the site will need to scale by adding more locations (organized similar to how craiglist is specific to each location).
Steve Yegge has made a good write-up on languages: http://steve.yegge.googlepages.com/tour-de-babel. Steve is a top notch programmer with brains and eloquence. He was one of the first hackers at Amazon. Now he works at Google, and Google has chosen Python and JavaScript as company languages. Which has pissed off Steve quite a bit, because he has firmly decided that Ruby is more powerful and rewarding than Python. But he's not allowed to program in Ruby at work.
So, Steve has engineered a kind of 'JavaScript on Rails' in order to fit into Google. All to avoid programming in Python. JavaScript is more powerful and elegant than Python, as he sees it.
This gives you two clues. One about Ruby and second about the Rails. To be brutally honest, Lisp is the most powerful and beautiful language to approach a programming problem. But List is not the most practical choice because of lack of libraries and dialect balkanisation. Ruby is considered to be an 'acceptable Lisp'. Almost as powerful and much more practical. And very very elegant. You may hear a lot about Ruby being slow. That is true, but that is also changing fast. Make your own research. You'll hear some interesting thoughts about what 'programmers' time' is worth vs. 'processor time' etc.
Finally, the frameworks. Rails has been mercilessly hyped, but the fact remains -- it is a framework for programmers. It has digested lots of 'theorizing' from Java and Smalltalk space. It tried to answer the question: "What an ideal MVC framework would be?" The answer turned out to be surprisingly good.
Django is a clever framework, but it has arisen from a particular website (Lawrence Journal-World) and it still has roots in website page design. Nothing wrong with that, but programmers talk less about Django (just check IBM tech articles), there is less programming 'meat' in there. There are also much lesser number of plugins and hacks for Django. You do not have the same amount of books and general enthusiasm about Django platform, comparing to Rails. Not by any objective measure.
Now let Python fanboys kill me, but I went through the same analysis a couple of years ago and I came firmly in favour of Ruby and later in favour of Rails. And I have not been disappointed a bit ever since.
The result? Ruby has the syntactical consistency and beauty of Perl, and the blazing speed and low overhead of Lisp. There are roughly six dozen different ways of doing everything (including really simple things, like delimiting blocks), and bizarre inconsistencies in basic use cases (e.g. most String functions return copies, whereas nearly everything else works by reference), and plenty of long-term code maintainability nightmares lurking in the corners.
It can be fun to code in Ruby, and it's certainly a language you should check out someday, but I'm still not sure it's the language you want to choose for a project involving a team of programmers or long-term project maintenance. My advice, if you know neither Ruby nor Python, is to learn Python, unless you've got some particular reason (i.e. a job) to learn Ruby first. Rails is an okay framework, but Django is okay too, and Python is the more elegant language.
(Now...if you'll excuse me, I'm going to go put on my asbestos underwear....)
I'm not sure your argument about Python/Django being better for long-term use really holds muster. There are a lot of very passionate Rails hackers, and I can see Rails taking over the web application development sphere over the next few years. This isn't because it's necessarily better, mind you, but because Rails has a hell of a lot of mindshare.
So, you should be as worried about finding competent Rails hackers as you should be about finding competent Python/Django hackers. Or should you?
Rails is the web development framework for Ruby. There are probably others, but nobody has ever heard of them, so they don't matter. Python has Django, and Pylons, and TurboGears, and so on. Your hypothetical future Python web developer, then, has a lower chance of being an expert in The Best Web Framework than does the Ruby hacker, because with Ruby, you only have one choice.
It's not finding the coders that's hard (any smart coder can pick up Ruby quickly); it's the quality of the code that any new person will inherit. My experience is that the syntactical looseness of Ruby leads to write-only code. Lots of people complain about the readability of Perl, but Ruby is really only nominally better. In Python, readable code is the rule, not the exception.
Simply untrue. You, and your opinion, are grossly misinformed.
I disagree vehemently. I myself have started using Ramaze, and like it better than Rails. In any case, it's more important to me to know Ruby well than a particular framework.
Actually, there are some Lisp implementations that leave Ruby in the dust. (Not saying much, I'll grant you that.) There are some Lisp implementations that let you compile code to machine language.
sigh yet another clueless spreader of programming urban legend and old prejudice!
How did you conclude this?
In all honesty, I think both are perfectly fine web languages, and it doesn't really matter which you choose. Pick one and get good at it. Either will be light-years better than, say, Java or PHP.
If only it were true.
Steve wrote Rhino on Rails while working on a project that requires the JVM. At Google this infers a choice of Java, Python (Jython) or Javascript (Rhino).
Steve chose Rhino over Jython for reasons you can read about here: http://steve-yegge.blogspot.com/2007/06/rhino-on-rails.html
But I somehow feel I'm not far from the truth, knowing his history of gentle Python bashing. After all, he chose not to make 'Django on Rhino'.
I'd say you're far from the truth.
It depends on what your experience you have. If you know Python, use Django. If you know Ruby, use Rails. I know Python, so I use Django. Since you have no experience with either, this one is moot.
It depends on what you're building. A lot of people on the net seem to take the position of "Django is good for content publishing sites, and Rails is good for web apps", but that has more to do with the applications the two frameworks were derived from than the frameworks capabilities. Realistically, anything you can build in Rails you can build in Django, and vice-versa.
Personally, I love Django. It lets me develop quickly and I know how to deploy it properly. I tried setting up Rails no more then three days ago (on Ubuntu), and it wasn't as much fun. I had issues installing the correct version of Ruby, and then Gems didn't want to work.
As for you, I'd recommend spending a few days with each framework. Get them both installed and just tinker around. Build a quick CRUD app. After that, you'll have a pretty good idea of which one suits you (and your needs) better
Or maybe I'll setup a new debian slice to toy around with.
It's fair to say that Python is a more "general purpose" language in that it has more extensive libraries and is faster.
It's also fair to say that for people who are language nerds, those who enjoy the power and elegance of particular languages, the kind of people who dick around in Scheme, Haskell, Factor, etc., Ruby is the better language. It has more interesting ideas (expressional syntax, open classes, the best case statement of any language ever) and significantly more powerful metaprogramming and DSL capabilities.
Both languages have blemishes, let's call that a wash.
There are certain features, that really come down to personal preference. Ruby has mutable strings, python doesn't. Ruby has a complex grammar, and there are usually several (readable) ways to express the same thing: for exmaple:
unless smelly?
eat!
end
and also, eat! unless smelly?
Python is very minimalist grammatically. Python has significant whitespace, Ruby doesn't. The grammatical maximalism/minimalism is the most contentious issue. I used to be a minimalist and I feel like I have seen the light, but I respect those who disagree.Now when it comes down to web frameworks, I don't think it matters so much... What is Rails? It's an ORM, a powerful Routing layer, a bunch of helper libraries for doing views, and a mostly useless controller layer. As a very advanced Rails user, I use very few of the view helpers anymore. I kinda like the way Django does forms better than Rails, though I've never really used it. Rails does REST really well. To be honest, the best framework out there right now is Merb.
so youa re not a minimalist now you mean?
I like Python because it forces people to write code that is relatively easy to follow. Hell is other people's code. Python will help get rid of some bad habits you may have picked up from PHP (though Ruby might do this as well). As far as jobs go, I've seen far more Ruby web development jobs than Python ones, especially among startups, so it's definitely a language I'll be learning soon, but I think I'll still prefer Python.
Another plus for Python is that Django's documentation is excellent and free. From what I've heard, you have to pay for all the good Ruby books, and printed documentation ages poorly. Django's documentation is religiously updated to reflect new changes.
I host my sites on a Linode VPS. They did obliterate my VPS when my credit card expired which would normally make me never use them again, but I didn't actually lose any data and they're cheap. You get what you pay for. For DNS, which you'll need if you host off of GoDaddy, I use ZoneEdit, which is free for your first five domains. I've used up my five free ones, and when I removed one domain so I could add a new one, they told me that technically, only the first five domains are free, but they let it slide anyway. I'll definitely be sticking with them.
That said, I've been doing all of my work in RoR and I'm very satisfied. The end-to-end toolset for Rails is pretty hard to beat.
Instead of asking here, I suggest that you pick a subset of your project that can be put together as one program and try to write it in both Ruby on Rails and Django. When you've seen what's required for either, you'll then be able to go back and build the rest of the system in your framework of choice.
That aside, this debate is like emacs vs vi. Get good at one, because in terms of productivity and getting things done it makes no difference.
I will be using a hosting service so the ease of use in implementation is also a big issue, not just the framework itself.
Personally, I chose django, but only because I was a python programmer before ror and django took off. If I were to do it again, I might look seriously at Pylons, as I consistently read good things about it.
I learned more from launching a demo application in both (I used a blog and a poll as an example) than I could have by asking other people. I found what suited my tastes.
If your first impression with Python was good then why force yourself to something else? In my opinion Ruby on Rails is better, completely object-oriented, fast, and there are lots of documentation out there as well.
I should say that I have more concern over the framework itself rather than the language. It would probably be expected that Python would give off a good first impression because of its syntax.
Sorry to add an option.
its also worth mentioning that django has a development (wsgi) server thats simple to run and great for working locally, deploying globally:
http://www.djangoproject.com/documentation/django-admin/#run...
I tried Rails first as Ruby is a lot closer to lisp than Python. Personally I find Python a bit restrictive, but fairly easy to read.
If you don't have a lot of experience with Rails/Ruby, Django is the clear choice. It's very well documented and it just works.
I was able to get Django in the first 10 minutes of using it and after that over the next day most of the concepts became clearer.
I found with Rails, the lack of familiarity with some of the advanced Ruby features made it very difficult for me to read the code. So I was coding blind a bit.
Someone's done this already:
http://www.vaporbase.com/postings/Evaluating_Web_Development...(part_1/15)
Thanks that is a great resource and will definitely read it to help with my decision, but after skimming he only speaks of installing on his iMac, and one of my main concerns is usage with a hosting service.
The main reason I asked this question is because I have more trust in hearing as many diverse opinions from this community as possible rather than a reliance on what a few individuals wrote on the topic. This community helped me so much on my last question and I hoped I could get a definitive result again.
As for hosting, Heroku is a good start.
Rather than spending time on both though as some have stated, I think you're much better off just flipping a coin and digging in head first, fully commited, and concentrating on the more important thing... your app design.
One of the great things about full-stack frameworks like Rails and Django is that you don't have to agonize over all of the components, so why agonize over the framework itself?
Just do it. Switch for your next webapp if you feel like it.
Really answering this question comes down to what your application needs are and what you and others working on this application is most comfortable in. I prefer RoR, I can develop quickly in it - I've got experience with that technology but it doesn't mean it will be the best solution for you.
I'd take a look at slicehost for hosting, I think for something like this having full control of a (virtual) server is a benefit and a great learning experience.
Ruby and Rails does seem to be better targeted for web development, both because (as some here have said) Rails is more meaty than Django and because there seem to be many more web development jobs out there requiring RoR.
Python on the other hand seems like a much better general purpose programming language, with a far richer set of libraries (ScyPy and NumPy on which Sage Math is based, bindings for wxWidgets and other toolkits etc)
Catalyst is a framework that does what you want instead of telling you what you want. This means a steep learning curve, but more productivity in the end.
Regardless, it's a shame to ignore Perl.
One reason to choose Rails is that there are many excellent libraries. Want to have tags on your models? Just install acts_as_taggable_on_steroids... Though there's something to be said about the rails plugin & gem landscape being in very rapid development. (acts_as_taggable doesn't do proper caching so you have to dig around to find the better version etc.etc.) On the whole I think that there are really kick ass plugins for rails available.
Like I said, Perl is far from a perfect programming language, but the community and CPAN make it all worthwhile.
I must say that I am pretty new to web development, so it is somewhat hard for me to determine both the feasibility and what will be needed to perform certain tasks, but people have asked if I could elaborate on what issues I will need to tackle, but please excuse me if these are unrealistic demands.
These are some of the things that I need to accomplish:
-Manage a numerous amount of small credit card transactions
-Create an algorithm that would self manage the database for certain areas based on date (delete data past a certain date or data that has expired)
-Allow the uploading of images, but also create thumbnails for those images
With regards to size, the application would focus on the area specific to where I live (so that I could market it easily with normal advertising methods), but scale simply by adding a new location (simply by cloning the first site and changing the location) similar to craigslist like I said previously.
Sorry if anything I had said does not make much sense or is unrealistic. I am new to web development and am trying to approach this in a very logical manner without wasting too much time.
background tasks are easy, you can use activerecord outside of rails in your data warehouse scripts.
image upload with thumbnails is trivial with attachment_fu plugin for rails.
Django seems easiest for me to learn in terms of general theory (the Model, View, Template makes more sense than Model, View, Controller in my head for some reason).
Both have a good number of resources, both are being updated very quickly. A lot of the issues I had with Ruby on Rails a year ago (hard to deploy) are disappearing now that it has matured a bit.
For the amateur, it is easier to approach PHP and start banging around than to learn Ruby and Rails.
The Rails free docs just aren't as good as say, the free MySQL or the free Postgresql docs. Or as good as the MS .NET docs. But there are several good books. And both Ruby and Rails work as advertised, they aren't bug-laden.
RoR functions like a skeleton you fill in. Django functions like a supporting pole on which you build on top of.
One is more flexible than the other, but the other constrains you less.
and how samething be more flexible and more constraining at the same time?
I have a huge problem with the lack of focus on testing in the Django community though, so I'm somewhat biased.
Again, as many here have mentioned, we need to know more about your problem in order to offer an appropriate solution.
If you already know Python - maybe Django would be better.
Also, Django has geo-django, if you think you might be geo-coding things - this is great, and built right in.
I expect that ruby has something similar??
1. Ease of use - Both are close but Python is just a wee bit ahead because its beautiful.
2.Libraries - Python wins
3.Frameworks - Its a draw if you have use for Django and RoR type frameworks. Python clearly wins if you need Pylons type stuff.
4.Scalability - Python wins.
5.Popularity - In sheer numbers Python is clearly ahead.
I would suggest Python but I don't give a rats ass if you went with Ruby.
I personally prefer Python's syntax and style, Python has many more libraries and it's been around longer than Ruby, and I've noticed that among "top" tier coders they tend to prefer it over Ruby. (Not all, but most.) But Ruby has many strengths, and can do a few tricks that Python can't, to it's credit. Python apps tend to execute faster than Ruby apps. It appears to be easier to scale up Django/Python apps than Ruby/Rails apps, though a lot of the same techniques can be used for both since they're language/framework agnostic (using a clustered architecture with a scalable number of server nodes, caching aggressively, choosing good algorithms, etc.)
I was at the same decision point over a year ago, did both tutorials, and decided I needed to focus more on the languages to help break what might otherwise have been a tie. With either framework you'll be a lot better off than the typical "web COBOL" stack: Java + Servlet/JSP + XML.
Django doesn't have good support for testing. Rails does.
Django doesn't allow clean separation between business logic and presentation logic, forcing both into its "views". Rails does.
Django doesn't have migration and deployment system. Rails does.
Rails is stable 2.0. With Django you have to use SVN+QuerySetRefactor+NewFormsAdmin+YourOwnHacks branch to get anything done. It's not documented anywhere (and not using svn+qsr+nfa+yoh is highly discouraged by django devs).
For me Python vs Ruby was really a tiny issue compared to these four. I like Ruby marginally more but Python was never painful to me, Django is.
Django isn't a traditional "MVC," so "views" in Django have a different meaning. In all reality a Django "view" is the "C" in "MVC," and the template is the "V." I'm afraid I fail to see that point.
I also fail to see your point about SVN+QuerySetRefactor... as I've never used either branch and have gotten everything done that I've needed to. There will come a time when that stuff gets merged back into trunk and I'll have to do some conversion, but traditionally it has been very minimal (see: old school MagicRemovalBranch).
"Django doesn't have good support for testing. Rails does."
You use the same standard doctest & unittest framework that any Python app would. Django even provides built-in support for dedicated test databases (autogenerated, and auto-cleaned-up after a test run) and a simulated web browser. Starting a Django project creates a dedicated 'test' directory that the Django testrunner looks in for test discovery. What more are you looking for?
http://www.djangoproject.com/documentation/testing/
"Django doesn't allow clean separation between business logic and presentation logic, forcing both into its "views". Rails does."
If you're doing it right, you should never be putting business logic into views. It should go in your model classes, as instance methods (for more global functionality, you can define a custom Manager and put your methods there). Django models are more than just dumb containers for database fields: you can add whatever intelligence you want to them.
"Django doesn't have migration and deployment system. Rails does."
I'll grant you that. There've been a bunch of 3rd-party efforts and some interest within the core Django team, but it's still nowhere near as mature as Rails Migrations & Capistrano.
http://code.djangoproject.com/wiki/SchemaEvolution
"Rails is stable 2.0. With Django you have to use SVN+QuerySetRefactor+NewFormsAdmin+YourOwnHacks branch to get anything done."
QuerySetRefactor was merged on Apr 26.
http://code.djangoproject.com/wiki/QuerysetRefactorBranch
I've heard NewformsAdmin is supposed to be merged soon (before 1.0) though I don't know of a target date.
This is unfortunately one of the problems with using pre-1.0 software, and if it's important that your software doesn't change, Django may not be for you. I've had very good luck simply avoiding the functionality that's under heavy development though, and the Django devs are very good at specifying what that is. I don't need the customizability of NewFormsAdmin, and QuerySetRefactor was largely an extension to existing methods.