Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You have two things to consider: Python vs. Ruby and Rails vs. Django.

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.



Here's my take, after working in Ruby/Rails for a year, and coming from a background in C++ and Perl (with a tiny bit of Lisp in my distant past): Ruby is nothing like Lisp. It has some metaprogramming features that make you think (vaguely) of Lisp, but fundamentally, it's more like the bastard child of a torrid, three-way affair between Lisp, Python and Perl -- the genetic heritage was passed on, but poor baby Ruby got little of the careful childhood upbringing.

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 was about to post a comment about you being insane when I read 'syntactical consistency and beauty of Perl', but then I re-read what you wrote and my Sarcasm-O-Meter started beeping.

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.


"you should be as worried about finding competent Rails hackers as you should be about finding competent Python/Django hackers."

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.


"any smart coder can pick up Ruby quickly"

True, but can they pick up ruby quickly, and rails (rails is non trivial these days), and rspec, and rake, etc. I'm guessing it would take at least 6 months to become merely comfortable with all of these. This is far different than having a proficient coder walk in the door.

You'll have much better luck getting a proficient rails coder than a proficient django coder. On the flip side I'm starting to get a lot of rails candidates that aren't really interested in rails, but used it at their previous job. For while if someone had rails on their resume it meant they took the time to learn it on their own (which is a good sign). Those days are gone.


You're missing my point: finding a good Blub coder, however hard, is a constant-time problem. The polynomial-time problem is maintaining/reading/understanding an established code base in Blub.

If Blub is an order of magnitude more difficult to maintain/read/understand than Foo, then even if it's far more difficult to find a Foo coder today, it makes more sense for me to use Foo for my new project.


I think code maintainability has less to do with the language than with the architecture chosen by the developers.

Try to explore (save alone, maintain) a complex Python application like Plone with its multiple inheritance. And then read the code of a modern MVC Rails application. You'll see what I mean.

And your statement that Ruby is only marginally more readable than Perl is very surprising. Ruby is a vast improvement in terms of clarity over Perl and is on par with Python there.


the idea that ruby is a blub language while python is a foo language is laughable. Python has it's issues as well. New style classes vs old style classes. These types are treated differently than those types in terms of default behaviour. Decorators are not the easiest thing in the world to read. Metaclasses are another example.

In my opinion ruby's syntax is simpler from a users point of view and equally as powerful. This may be my bias, but a fair assessment is that they are fairly equal


Speaking from experience: I coded many thousands lines of Ruby code for my startup all alone. Then we raised seed, and hired a few additional developers. Two of them joined my project and took over the development from me. They're both very experienced programmers, but had no prior Ruby experience. It took them less than a month to become productive. Srsly. In short, if you write good code and bring in good developers, Ruby probably isn't going to be a problem.


I'd be really worried if I hired someone that took 6 months to become comfortable with the ruby/rails (and rspec, rake, capistrano, etc). Now it might take way longer than 6 months to fully master everything, but if you already have a good quality code base to learn from and a team of experts any smart developer should have no problem picking things up quickly.


"True, but can they pick up ruby quickly, and rails (rails is non trivial these days), and rspec, and rake, etc."

2 Weeks for Ruby & Rails. 1 to 2 weeks for Rspec & rake... especially if you're learning using Peepcode videos and a real project. Those numbers are from personal experience. Your learning curve may vary.


This is simply personal preference; I have no problem reading Ruby code. Perhaps this is because I spent a very, very long time with Perl, but other Ruby hackers seem to feel the same way. On the contrary, I don't much care for looking at Python code, because half of it seems to consist of the word 'self'.

So, 'readability' in this case isn't a very valid argument, because anyone who codes in language X is going to find X to be highly readable.


"This is simply personal preference"

Well, yeah. That's why I said it was my experience.

I think the point is, I code in Ruby and in Perl, and my opinion is that neither language is particularly readable or maintainable. Meanwhile, I have less experience with Python than either Perl or Ruby, yet I find it to be a consistently readable language.

Those are all opinions, but they're informed opinions (and I'm not simply advocating for the language with which I am most familiar).


Rails does have a lot more mindshare than Django right now, but notice Rails had a 2.0 release in December, while Django still hasn't even reached 1.0. I'm not sure about the relative histories of the projects, but it looks like Django is still in the pre-buzz phase. (Meaning, projects tend to start publishing books, holding conferences, etc. after the big 1.0 release, not in the incubation/unstable-API phase.)


Version numbers don't measure age. Django and Rails are roughly the same age, having had their first public releases around the same time.


Yeah, exactly. The two projects have a completely different dynamic. Like Python, Django development is cautious, minimal and relatively slow-moving compared to Ruby and Rails.

Rails burst onto the scene, brought everyone on board with a 1.0, published books, and already decided enough design elements needed to change to warrant a 2.0 release. Django, despite having the BDFL's semi-official endorsement, has crept along, nitpicking at its own API, cranking out beautiful versioned documentation and tutorials, and writing and editing the official Django Book in a wiki. And only now are they feeling confident enough to consider the 1.0 label and even publish their precious gem of a book.

Same timeframe, completely different personalities. This played out somewhat similarly with Python and Perl a decade ago, which leads me to believe that Django's time in the spotlight is still ahead of it.


A lot of Python projects seem reluctant to announce a 1.0 release. For example Pylons and Django are both in 0.9 range, SQLAlchemy is 0.4, Genshi is 0.4 (just some of the projects I've used in a commercial setting).


" There are probably others, but nobody has ever heard of them, so they don't matter. "

Simply untrue. You, and your opinion, are grossly misinformed.


with Ruby, you only have one choice.

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.


Upvoted for Ramaze and do try to use the Sequel ORM library. It's sweeeeeeeeeeeeet. None of that ActiveRecord magic for me.


I am using Sequel.


You sir have good taste.


>...the blazing speed and low overhead of Lisp...

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!


"Ruby has. . .the blazing speed and low overhead of Lisp."

How did you conclude this?


With a smirk, most likely.


Granted the OP was being facetious in claiming the beauty of Perl or blazing speed of Lisp, but he was sincere in analogizing Ruby to Perl and Lisp. In that sense, he was wrong. Ruby is nowhere near the speed of Lisp. Peter Norvig claims Lisp is "about 1 to 2 times slower than C++" (http://norvig.com/python-lisp.html), and I don't think anyone would sensibly equate the speeds of Ruby and Lisp.


Well on a related note, when you become really comfortable with ruby, it's incredibly fast to write scripts and one-liners to do really complex stuff. Especially with the ruby shell as help.


Interesting. I went through the same analysis a couple years ago and concluded that Ruby had the hype but Python had the goods. Was skeptical of Django for a long time, but finally warmed up to it last December and haven't looked back.

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.


I couldn't agree more. Pick the one you like and run with it. Which you choose isn't going to make or break your business or career.


"Steve has engineered a kind of 'JavaScript on Rails' in order to fit into Google. All to avoid programming in Python."

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


+1 Obviously haven't read much Yegge when making statements like that. Ontop of the above defense, there's a video on Youtube...

http://youtube.com/watch?v=1QD9XQm_Jd4


My fault, Steve has indeed explicitly said he could not use Python for that project.

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'.


You really haven't read much Steve Yegge have you? He has his gripes (some of which have been recanted, mind), but he explicitly states he likes Python.

I'd say you're far from the truth.


I find it unfair to invoke Steve Yegge too often, since he's just a guy with an opinion. I have read a fair amount of his rants, of varying quality. His language comparative analysis is interesting because it is informed, argumented and ...well, funny. Read this passage, for example:

>Well, they're just like the Smalltalk folks, who waited forever to replace C++, and then Java came along and screwed them royally, and permanently. Oops. Ruby's doing exactly that to Python, right now, today. Practically overnight.

He just points out at some major architectural flaws in Python (like the scoping issues leading to selfSelfself and unreadable code, and then the whitespace...) and argues that Ruby has superseded both Perl and Python in many ways. That does not mean he does not LIKE Python. His is just an engineer's analysis, not an emotional judgement.

offtopic:

I -- on the other hand -- am emotionally scarred by Python having tried to take it into my system over a couple of years and having failed to love it. Then Ruby came along... ;)


What is the selfSelfself issue?


>Python's author, Guido Van Rossum, also made some boneheaded technical blunders early on — none quite as extravagant as Larry's blunders, but a few were real doozies nonetheless. For instance, Python originally had no lexical scoping. But it didn't have dynamic scoping either, and dynamic scoping may have its share of problems, but it at least sort of works. Python had NOTHING except for global and local (function) scope, so even though it had a "real" OO system, classes couldn't even access their own damned instance variables. You have to pass a "self" parameter to EVERY instance method and then get to your instance data by accessing it through self. So everything in Python is self, selfself, selfselfself, selfSELFselfSELF__SELF__, and it drives you frigging nuts, even if you don't mind the whitespace thing.

http://steve.yegge.googlepages.com/tour-de-babel


Thanks. I read the page and I still don't get it. You might use self.my_function() or self.my_variable. When would you see selfSelfself? Or is Yegge being a poet here?


Poetic license, yes.

And I have felt the same way, seeing "self" everywhere.




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

Search: