Home » general » Snakes and Rubies

Snakes and Rubies

Adrian Holovaty and David Heinemeier Hansson
Adrian (left) and David (right)

Yesterday, all the developers from work went to Snakes and Rubies, in Chicago. It was rather fun. This was a seminar/conference for Ruby on Rails and the Django framework for python.

Adrian Holovaty is one of the three developers who created the Django framework for Python; initially for use on the Lawrence, KS local events and information site.

David Heinemeier Hansson is the developer who initially began development on the Rails framework for Ruby two years ago, though at this point there are other collaborators, I believe. Rails is used in projects linked off 37 Signals.



Both presentations were neat, though I will say that I was initially disheartened when David’s Rails presentation consisted almost entirely of code screenshots. That, at least at first, steered me away and gave me a far better feeling for Adrian and his Django presentation. It took a little while to get over that and listen without rancor.

Both technologies are really sweet. For those unaware, they both provide a method to use their respective languages, Ruby and Python, to quickly rock out websites and web applications. What I took away from the event is that they’re both well-thought and extendable technologies, but Django is aimed to be more of a general purpose site builder for sites with dynamic content and interrelations between that content, whereas Rails is aimed more specifically at the web application construction aspect of things.

I don’t know if this is a fair characterization or not, but it’s what I took away.

The difference in presentational style makes things difficult when trying to choose one over the other — Adrian’s Django presentation was very engaging and entertaining. It was very much a proselytizing thrust. David’s Rails presentation was just… code. His assumption of the format was that people already were familiar and knew about the framework, and the presentation aspect of the seminar was just fluff or feature displays as a prelude to the QA portion. It was harder to learn what I, as a developer, could really do with the framework.

The entire trip home was essentially spent discussing the pros and cons of both as far as we could determine. We’ll have to just try them both it seems. Very few of our developers know Python and none know Ruby at work — it will be interesting.

One other thing to mention, there was a lot of PHP bashing going on. Very much in the same religious wars vein as Mac v. PC or Linux v. BSD. Some of it was valid, but most of it was cheap shots. I just want to mention that what a lot of the PHP bashers fail to realize is it’s the programmers who write bad PHP code. If you treat PHP as if it were C++ or some other functional language, the coding requirements to write good code are the same. For reference, I have never heard C bashing (aside from bemoaning the use of pointers) from anyone, even though it has a lot of the same issues as PHP. So I say the put-downs were a little off the mark — it is equally possible to write bad code in Ruby and Python as it is in any other language.

Having said that… I had an epiphany prompted by one of David’s comments — he characterized PHP as the Devil, always prompting you to do bad things. My ephiphany was: This is true, because PHP is basically lazy man’s C++.

Examples:

  • There is no strong typing, you can do all the nasty C++ stuff you got D’s for in college, and furthermore, there’s no compilation. So there’s no incentive to actually test your code or think about validation or error checking. At least with C you get errors or odd behavior when you try to use an int as a char, and if you have an eventual parse error, you know right off the bat.
  • In PHP the language construction is half-assed about being half-assed. You kind of have C-style objects, but they’re not strict so if you really want you can refer to private data (which only became truly private in PHP5.)

You’re set up in a situation where you want to write bad code in the form of shortcuts, inlining what should be functions, and straight declaring what should be objects. It just sets you up, as a developer, to be a poor coder.

The thing I think people really miss is that you can ignore those promptings and write the good code anyway.

In any event, two of the valid criticisms brought up, namely verbosity and length of applications, are issues I’d like to get rid of. PHP, like C++ and C, almost requires that your code be extensive and long. For that reason alone, I’m willing to look at another language solution.

Posted in general and tagged as , , , , ,
  • K0ward.Anonymous()

    Please don’t pick Django. You’ll regret it. I still can’t install the dang thing after going through the tutorials and whatnot. Download Rails, and Ruby gems and you won’t look back.

    I was a python/zope user and I still shudder when I think of all the DTML crap I had to deal with. Python maybe ‘clean-looking’ but it induces people to write needlessly complicated code. Zope3 will be just as complicated as 2.2 and 2.8 and 3.0 which is 2.x but not really 2.9+1 (WTF? yep!)

    Python messes with your brain circuits in the most in-appropriate way. Kind of like what FORTH does to its afficianados [sp] Really good FORTH programmers stop making any frikking sense to the real world after a certain stage of “zen”.

    try out Ruby/Rails, its easy, its painless. Better yet. Try Django first. When you feel like you’ve had enough frustration, try out Ruby/Rails and you might see the light.

    Thx.

  • http://jacobian.org/ Jacob Kaplan-Moss

    Hey K0ward — I’m sorry you had trouble getting Django running for you… did you try asking on the mailing list or IRC channel? One of the great things Django has going for it is the awesome community.

    I had to laugh at your criticisms of Zope; you’re so right, and if that’s been your only exposure to Python I can see why it soured you so. I really think you should give Django another shot; it’s about as far from Zope as you can get.

    If you — or anyone — is having trouble, you can always email me personally: jacob -at- jacobian.org.

  • Pingback: import this. » Blog Archive » Snakes and Rubies roundup

  • Muhammad Alkarouri

    No C bashing? I believe that C is the most bashed language ever. The thing is that it was so bashed it became not cool anymore.
    C has so many faults in the eyes of many that C++ was written to correct that, and Objective C, and Java, and Perl. And I am sure any of the Python/Ruby people will have a stab at the ‘static typing’ programming languages whenever they have the chance. What do they speak about, you think?

    K0ward, django 0.9 installation is really easy now using the python eggs solution. Do have a look at it. As for Zope, it was real bad publicity for Python, imho. Forget about it. Python is not so bad..

  • http://adminspotting.net Joe

    Please don’t pick Rails. You’ll regret it. I still can’t install the dang thing after going through the tutorials and whatnot. Download Django, and mod_python and you won’t look back.

    try out Django, its easy, its painless. Better yet. Try Rails first. When you feel like you’ve had enough frustration, try out Python/Django and you might see the light.

    :P

  • K0ward.Anonymous()

    Okay guys, I will try DJango again. Whenever I think about Zope, I feel like I was violated.

    I’m trying both right now. FWIW. Not that it matters in the larger (scheme ‘(of things)).

    Hey Joe, you can’t really pick on RoR for its ease of install. Really. Maybe it lacks in other areas (one annoing thing for moi is the “pluralization” of table (relation?) names.. E.F.Codd turns in his grave!) but hey a BDFL has got to have his tantrums once in a while, otherwise what’s the point of being one?

  • http://www.michaelbernstein.com Michael

    K0ward:

    While amusing, your Zope rant has one glaring error: 2.9+1 would be 2.10, not 3.0. The Major.Minor.Bugfix numbering convention is well established in many open source software projects.

    For that matter, your criticism of how Zope3 ‘will be’ just as complicated ignores the fact that 3.0 has already been released, as has 3.1. Two books on Zope3 have already been published, and it is being used for production works by a growing number of people.

    Zope3 technologies are being backported to the 2.x line, and various projects such as Plone have already started using them.

    I sympathize with your concerns regarding DTML (in fact, much of my time these days is spent dealing with an application that is three years of accumulated DTML), but using DTML hasn’t been a recommened practice in Zope development for a couple of years now. I’d suggest trying again with Zope3, page templates, and Python.

    Peace.

  • http://adminspotting.net Joe

    Hey K0ward: I find installation on both to be incredibly easy. I was able to get both installations working on my first try.

    My comment wasn’t really directed toward anyone in particular — just that personal opinions (with a flamish-edge) sound the same once you take the keywords out..

%d bloggers like this: