By Antonio Cangiano, Software Engineer & Technical Evangelist at IBM
Currently Browsing: Books

Agile Web Development with Rails, Third Edition

The Pragmatic Programmers have announced the beta release of Agile Web Development with Rails, Third Edition. The final version of the book, updated to Rails 2, is scheduled to be released for October 2008. Even if the style of the tutorial is not everyone’s cup of tea, this is good news and they surely picked a great author in my fellow IBM colleague Sam Ruby.

Quoting myself from three weeks ago:

I think that the Pragmatic Programmers made a mistake in deciding not to upgrade their Agile Web Development with Rails, 2nd Edition because they left newcomers in a difficult spot. Developers who are experienced with Rails, will just get Obie’s The Rails Way and be fully covered, but those who are new and would like to get started with Rails don’t have many choices. They can get the Pragmatic Programmers’ Rails title mentioned above, but it’s a bit obsolete now and that means extra effort on their part to follow along, installing an old version of the framework, and then figuring out some way to move to the new features that were introduced by Rails 2.0 (soon to be Rails 2.1).

I’m happy to see that they’re working on it. :)


On The Last Lecture

The Last LectureStarting today, Amazon will be shipping the hardcover version of “The Last Lecture”, by Prof. Randy Pausch and Jeffrey Zaslow. While I wait for my copy to arrive, I feel the need to express a few thoughts on the subject of this book. Over the past several months I’ve been following closely Randy’s story and was often tempted to write a few lines about his touching message and courageous attitude towards life and death. The release of this book is a good opportunity for me to do so, because I’d rather prefer my words to be a heartfelt thank you letter – while Randy is still alive – than a brief eulogy to be published when, sadly, he’s no longer physically with us anymore.

Randy Pausch is a popular Professor of Computer Science, HCI, and Design at Carnegie Mellon University, an ACM Fellow, and the founder of the Alice project (an educational software that’s designed to teach computer programming to young students. You can donate here.). He’s also a married man and the father of three small children. In August of 2007, Randy was diagnosed with terminal pancreatic cancer and was told that he would have very little time left to live. Grimly, he was given an estimated 3 to 6 months of remaining good health.

On September 18, 2007, Randy gave a lecture at CMU which made him famous worldwide. The talk was titled “Really Achieving Your Childhood Dreams”, and it was given as per tradition, as a hypothetical final lecture in which top academics are asked to summarize important lessons that mattered to them, as though it was their last chance to do so. For Professor Pausch however, this was actually the case.

His lecture is truly brilliant and provides important suggestions on how to achieve satisfaction in life, by living to the fullest. If you haven’t seen it before, please make sure you do, today. It’s not the usual self-help mumbo-jumbo, and it’s not a sad, depressing lecture either. It’s uplifting stuff that will motivate you and, to a certain extent, change your life if you’re listening carefully enough. I know it has had a deep impact on my own life, even if I’ve never had the chance to meet Randy and I’ve not (thankfully, so far) had any close relatives or friends die as a result of pancreatic cancer.

I love how, throughout his lecture, Randy manages to maintain an optimistic outlook on life, while at the same time not being in denial about his condition, or the future that his family is facing. His proactive, positive attitude, even when approaching death, is nothing short of inspirational. And I’m talking about the type of inspiration that you get after hearing a recording of Richard Feynman. Without even trying hard to inspire many, this man ended up doing just that for the millions of online viewers and TV spectators who watched the condensed version of Randy’s lecture on Oprah.

Here is a man who, with humility and dignity, decided to fight an aggressive disease for which there is no cure, by living his life to its fullest and having fun until his last day. Rather than screaming “why me?” or feeling depressed by how unfair his situation is, he’s opted to accept his condition no matter how unfortunate it is. While at the same time working diligently to make the best of the present, and to ensure a future for his wife and kids in which they are taken care of.

You can’t control the cards you’re dealt, just how you play the hand.
— Dr. Randy Pausch

It’s humbling, to say the least, when one start to think about the countless day-to-day opportunities that each of us has, just by the sheer fact that we don’t have an immediate “death sentence” over our heads. It makes you think about the value of time and the fact that most of us have no reason to feel sad or over-worried about the small problems that affect our daily routines. His lecture, and his ultimate lesson, are about embracing life and never giving up.

For those of you who have access to North American TV, tomorrow ABC will air an hour long Diane Sawyer feature entitled “The Last Lecture: A Love Story For Your Life”. Please, if you can, try not to miss it.

But it’s not just inspiration and the power of dreams that I want to talk to you about. We, as a society, have a very skewed perception of what constitutes a real threat. Terrorism is one of the most unlikely causes of death in America and yet it has received a huge deal of press coverage and public attention. Mad Cow Disease, Avian Flu, Africanized bees, just to name a few, are all very unlikely to affect you. Yet, in the collective mind they are perceived as huge risks, because they’ve been portrayed as such by the media. We have a huge elephant in the room though, and it’s being ignored. That elephant is cancer. Cancer is the second highest cause of death in the US, after Heart Disease, and in 2005 alone, it was responsible for taking the lives of 559,312 people. Or to look at it from another angle, 22.8% of all US deaths occurred as a result of cancer. 1 in 2 men, and 1 in 3 women, will statistically develop cancer in their lifetime. This means that if you’re married or have a life partner, there is a greater chance of one of you developing cancer, than of neither of you being affected. These numbers are astonishing, absolutely astonishing.

Society, as a whole, really needs to stop and reflect for a moment on the impact of cancer. Cancer is literally killing millions of people, and we are unnecessarily playing Russian roulette. The odds are against us. Any of us can get cancer, no matter how healthy we try to be. Cancer research has done a lot in terms of improving the survival rates of specific types of cancers. But others are, by and large, left in the dark, with very little funding and research going towards them. The five-year relative survival rate for melanoma went from 82% to 92% in the past 30 years, breast cancer went from 75% to 89%, and prostate cancer from 69% to 99%. Overall, considering all the types of cancer, in the past three decades, we’ve gone from a 50% chance of survival to a 66% chance. Those are all excellent results, and they essentially mean that if you get any of the cancers mentioned above, you have a fighting chance of surviving thanks to the research that’s been done and the funding that’s been put forth.

But not all cancers are created equal. Do you know what the survival rate for pancreatic cancer is? 4-5%. If you get pancreatic cancer, you may as well consider yourself dead – and usually within the span of a few short months. Over the last 30 years there have been extremely few advances in the field of pancreatic cancer research, and a truly severe lack of funding. I’m an atheist who doesn’t believe in prayer, but I do believe in science and that when you put money towards research, results usually follow in a fairly systematic manner.

Randy has been strongly advocating for the Pancreatic Cancer Action Network. I ask you to join me in donating to this very worthy cause, because donations can, and will, make a very real difference. I’m not good at telling other people what they should do with their hard earned money, but if you can, please contribute to this cause, as it will help to make Randy’s last few months worth of incredible effort all the more valuable. Many tech people donated to Ron Paul, Kucinich, Obama and other valuable political campaigns, now let’s make sure that the same happens for another type of very important cause – and let’s do it while Randy is still alive to witness our support.

The following is Randy Pausch’s public service announcement on behalf of the PANCAN:

This one is a public service announcement of The Lustgarten Foundation for Pancreatic Cancer Research:

And this is his testimony before Congress:

And finally, if you haven’t done so, I highly encourage you to watch his lecture:

With absolute sincerity, thank you Randy for showing us all how to live in the face of adversity.


This Week in Ruby (April 7, 2008)

The first edition of This Week in Ruby received a warm welcome from the community. A week later, here we are with a second installment of the series. I’ll attempt to repeat these posts approximately every week, so feel free to follow along by subscribing to my feed.

The Ruby community is a tremendously active one. In only seven days, there have been so many noteworthy items popping up, that it would take me hours just to mention them all. I’ll try to pretend that you, the reader, have been on a week-long vacation in a remote place without internet access, and on your return you asked me, “Hey, Antonio what happened in Ruby and Rails land while I was away?”

Some fun on April Fools’ Day

We kicked off the week on a lighthearted note, by fully embracing the endless opportunities offered by April Fools’ Day. Most of the spoofs and jokes were aimed at making fun of Ruby on Rails, one way or another. Testimony to the self-irony that we, as a community, certainly have. I personally announced the soon-to-arrive release of a fictitious (of course) framework called Ruby on Crack. Which was supposedly much faster and productive than Rails. At the heart of the joke were the fake endorsements, chocked full of double-meanings (with apologies to Matz, David Heinemeier Hansson, Dave Thomas, Ezra Zygmuntowicz, Obie Fernandez, Zed Shaw, Tim O’Reilly, Guido van Rossum and Paul Graham). I found the SQL on Rails April Fools’ gag very funny and extremely elaborate. Their screencast is comedic genius and their site a spoof in every minute detail. In my book, on that day, they took the cake. The joke itself was from two years ago (as pointed out by a commenter below) but it resurfaced again this year. The hilarious trend continued with Cobol on Cogs and for the ASP.NET and PHP nostalgic, with Acts as ASP.NET and RHAP (Ruby Ain’t Hypertext Preprocessor). Avdi Grimm even found the final solution to the whole Monkey-patching diatribe: Ninja-Patching, “When you really want to catch a coder by surprise, a monkey doesn’t cut it. What you need is a Ninja.”. :)

mod_rails

Last week I mentioned Passenger (aka mod_rails). This week Hongli Lai published some interesting benchmarks that compared it against Mongrel and Thin for three Rails applications (Typo, Petstore and El Dorado). While still synthetic benchmarks, the results where very encouraging and showed how Passenger was on average faster than Mongrel and roughly on par with Thin. Even just the perspective of having performances that are somewhat comparable with those of Mongrel, would be great news, given that it’d highly simplify the deployment process of Rails applications with Apache. Ninh Bui has announced that the official release date for the project is expected sometime this week and that meanwhile they are working with companies like Twitter and Dreamhost to ensure that the module is fully tested. Speed is only one of the project’s aims in fact, with a lot of focus put on stability and robustness, too. They also caught the attention of Engine Yard who is interested in discussing a possible partnership and contributions to the Rubinius project.

Git

By now you should be aware that the Rails community is fully embracing Git, and github.com is only part of the reason. Michael Bleigh has even created a small library called ruby-github to simplify access to the GitHub API. David has announced that Rails is moving to Git and the ticket tracking system is being switched over to Lighthouse. As David pointed out, this means that both the tracking system and version control are to be run by Rails applications, which is a good bonus if you subscribe to the philosophy of “eating your own dog food”. For those who are still git-challenged, Kurt Schrader has a collection of helpful links to get you started. And if you need a simple issue tracker for git, version 0.1.2 of Ditz has just been released, too.

Conferences

Confreaks has now published the remaining videos from MountainWest RubyConf 2008. They’re very interesting and highly recommended. All of them.

In case you missed the Ruby Fools conference, held on April 1st and 2nd in Copenhagen, you can read an interesting personal account by 41Concepts. The conference also took place on April 3rd and 4th in Oslo.

Speaking of conferences, Sam Ruby will be presenting on Ruby 1.9 at this year’s OSCON. In a recent short post, he mentioned his plans for his talk and really nailed one of the problems that will hinder Ruby 1.9′s adoption, in his own words:

My tentative conclusion at this point based on observations of efforts to get products like Rails working on Ruby 1.9: the biggest obstacle to Ruby 1.9’s adoption is the sheer number of mostly working but essentially unmaintained gems that virtually everybody in the Ruby community depends on. — Sam Ruby

Rails

Amazon has an article on Using SimpleDB and Rails in No Time with ActiveResource. Another interesting article which surfaced this week was a post called simple pages for easily creating “boiler-plate” pages in Rails.

Three interesting plugins where released. You can read about them in Introducing Action Messager: Dead simple IM notifications for your app!, Better Partials Plugin for Rails and A Rails 2.0 Message Forum Plugin.

The Rails Jedi posted about two Mac OS X applications for accessing Rails docs in the most efficient way possible. Nookkit.app and RailsBrain are real timesavers, and I highly recommend them to Mac users.

SapphireSteel has announced the Public Beta of their Visual Rails Workbench. With the release of Ruby in Steel 1.2 Beta 3, they have in fact included their drag-and-drop visual environment for Rails. I didn’t have a chance to try it out, but if you are on Windows you may want to give it a shot, starting with reading their online articles.

The ink for printing Ruby and Rails books never runs dry, as I pointed out in my post 7 soon to be released Ruby and Rails books. It turns out that in the months of April and May alone, there will be 8 new Ruby/Rails titles. Check them out, especially if you are looking for updated material relating to Rails 2 or, in the case of the pickaxe 3, to Ruby 1.9.

The guys from Rails Envy, published episode 25 of their Rails podcast. If you are not familiar with their fun podcast, I recommend that you listen to a few episodes by subscribing to it through iTunes.

Ruby

There were countless interesting Ruby articles in the last week, but I’d like to point out the following:

Ruby VMs

In Rubinius for the Layman, Part 1: Rubies All the Way Down, Mathieu Martin has a nice, gentle introduction to Rubinius with some reveling benchmarks too. For those interested in learning more about the current status of Rubinius, InfoQ has a short article with a few pointers.

More remarkably, in the land of alternative Ruby VMs, Jruby 1.1 has finally been released, after months of hard work. The authors are already thinking about what lies ahead for the project. If the subject interests you, feel free to grab a few slides from various presentations on the topic.


7 soon to be released Ruby and Rails books

With the amount of good Ruby and Rails books already on the market, you’d think 2008 would be a shy year when it comes to publishing new titles, but nothing could be further from the truth. The following books are all to be released this month or in May, and there are many more coming out this summer.

Do we really need another 7 titles on the market within 2 months time? Interestingly, the answer is yes, for two main reasons. First, most of them serve a specific purpose, rather than being generic introductions. Second, we have a hole in the Ruby and Rails book market. Ruby 1.9, despite being a development release, has been out for a while. More importantly, Rails 2 differs enough from Rails 1.2 (covered by most books out there) to require new tutorials for those who approach Rails for the first time and perhaps even for those who wish to upgrade.

I think that the Pragmatic Programmers made a mistake in deciding not to upgrade their Agile Web Development with Rails, 2nd Edition because they left newcomers in a difficult spot. Developers who are experienced with Rails, will just get Obie’s The Rails Way and be fully covered, but those who are new and would like to get started with Rails don’t have many choices. They can get the Pragmatic Programmers’ Rails title mentioned above, but it’s a bit obsolete now and that means extra effort on their part to follow along, installing an old version of the framework, and then figuring out some way to move to the new features that were introduced by Rails 2.0 (soon to be Rails 2.1). As a matter of fact, when people ask me for a good Rails 2.0 introductory book for programmers, I can’t really name one. So far I’ve suggested getting Dave Thomas’ book or RailsSpace: Building a Social Networking Website with Ruby on Rails, and then moving to The Rails Way when they are ready to take it to the next level. But it’s not an ideal scenario at all.

Alright, to the titles then:

Title: Programming Ruby: The Pragmatic Programmers’ Guide (Third Edition)

Available: May 15, 2008

Notes: Currently in beta, it’s going to be the first book that fully covers Ruby 1.9 and its core and standard libraries.
Title: Simply Rails 2.0

Available: May 15, 2008

Notes: It’s the second edition of an already “gentle” introduction to Rails called Build Your Own Ruby on Rails Web Applications. It covers Rails 2, and if well written, it may be that missing guide for newcomers to Rails and beginner programmers, that I was talking about.
Title: Practical REST on Rails 2 Projects

Available: May 5, 2008

Notes: It’s marketed as a practical intermediate/advanced title for creating RESTful applications. The topic and target audience make it interesting for many web developers.
Title: Agile Testing with Ruby and Rails

Available: May 19, 2008

Notes: It’s supposed to extensively cover TDD and BDD with Ruby and with Rails 2.0.
Title: Advanced Rails Recipes: 84 New Ways to Build Stunning Rails Apps

Available: May 15, 2008

Notes: Currently in beta, it’s a Rails 2.0 cookbook by one of the most prominent developers in the community (Mike Clark).
Title: Deploying Rails Applications: A Step-by-Step Guide

Available: May 15, 2008

Notes: Currently in beta, it’s the book that should alleviate the pain of Rails deployment for many. Ezra is one of the biggest experts in the field, so I have great expectations for this title.
Title: FXRuby: Create Lean and Mean GUIs with Ruby

Available: May April 15, 2008

Notes: Currently in beta, it covers cross-platform development with FXRuby, the Ruby wrapper for the FOX toolkit. The author, Lyle Johnson, is also the author of the gem.

I can’t speak firsthand for any of these books, having not had the opportunity to read them yet, but knowing some of the talent behind them I certainly have high hopes.


Django’s tipping point

Django seems to have reached its tipping point, that critical mass which will enable its momentum to skyrocket. Getting here took a while though; partially because of a lack of hype and partially due to Rails’ very prominent presence in the market. Now this well deserving framework has finally begun to be widely adopted and considered as a valid alternative to Rails, for agile web development. Why do I care about what other people are going to use? I care because I’m deeply passionate about technology that works and that keeps things as simple as possible – as such forms of innovation always should. Independently from their adoption, promotion, and the differences in their approaches, both Django and Rails have at their core, a lot of substance and can greatly simplify and improve the way a web developer’s creative process flows.

Stating that Django has reached its tipping point is a bold claim, but I can present some evidence to back it up. I will use Rails and Ruby as a comparison for Django and Python – but don’t construe this as a race between the two frameworks. Rails is still the most popular and will probably continue to be for a long time. I’m only comparing the numbers to get an idea of where Django stands right now.

Visiting irc.freenode.net, I’ve noticed that the Python (#python) channel is often more populated than the Ruby one (#ruby-lang), and the same goes for Django (#django) and Ruby on Rails (#rubyonrails). For example, right now I see 517 members for Python and 354 for Ruby, 382 for Django and 298 for Rails. Django and Python consistently have more hackers in their chats than Rails and Ruby. This doesn’t say too much, given that the average developer doesn’t hang out on irc, but it’s still somewhat indicative of Django’s growing community.

Moving to newsgroups/Google Groups, things start to change a little. As I write this, there are 12,457 subscribers for comp.lang.python and only 6,935 for comp.lang.ruby (with 1,857 members in ruby-talk-google). “Django users” has 8,178 members versus the 13,355 of “Ruby on Rails: Talk”. So far this month, the Django group has had 1,244 messages versus the 2,890 of the Rails one. By looking at these numbers, without any pretense of being too scientific in our comparative methods, we get the impression that the Rails community is almost twice as big as the Django one, which sounds about right. On the other hand we also get that the Python community is larger than the Ruby one (confirmed also by the irc results above). In looking at these numbers, Rails also has the advantage of being the most used Ruby framework by far. In Python-land, Turbogears (3,303 members), Pylons (1,333 members) and good old Zope split the pie too, even though Django remains the most popular choice. Guido van Rossum’s blessing for Django was just the icing on the cake.

By observing the TIOBE Index, we see that Python is in 7th position versus the 10th position where we find Ruby. Perhaps more interestingly, Python has had a +0.70 delta since last March, while Ruby a -0.11%. Again, this is certainly not an exact science, my friends. TIOBE accuracy is often disputed for good reason, but I think it’s still an indicative factor.

Speaking of less than entirely reliable things, Alexa (django vs rails), Compete, and Google Trends (yes, rails is a very generic term) all confirm the anecdotal evidence that Rails is still far more popular. That said, the values start to be at least somewhat comparable.

In my opinion the strongest indicators of Django’s increasing popularity come from the publishing world. You’ll see many books in print for a given topic, only if their publishers believe that there is a large enough market for them. In 2007 the following two books were published: Professional Python Frameworks: Web 2.0 Programming with Django and Turbogears and The Definitive Guide to Django: Web Development Done Right (available for free online). 2008 has only just started and already there’s been one Django title published (Sams Teach Yourself Django in 24 Hours), with two further titles lined up: Practical Django Projects and Python Web Development with Django (which I’m currently reviewing for Pearson, as it’s in the process of being written – and I must say, I think it’s going to be a very good one).

5 books on Django announced to date and more lined up to be released this year, I’m sure. There are now many books in print that cover Rails (my recommendations here), but the sudden spur of Django books reminds me of Rails a couple of years ago and will surely help widen Django’s popularity. Watch closely because things will move fast in Django-land.


Rails is the best thing that ever happened to Python

Rails has been a blessing and a curse for the Ruby community. It brought sudden popularity to the language with all the consequences, good and bad, that usually result from exponential growth. On one hand, it gave many developers the chance to appreciate the design of the Ruby language based on its own merit. On the other hand though, it’s been a cash cow that’s changed the community forever by attracting all kinds of attention. Rails has become the poster child for Ruby, blurring the distinction between the Ruby, and Rails, communities. A large number of web programmers got to experience the “ease of use” and beauty of Ruby development, but it also clearly exposed Ruby’s implementation shortcomings. Rails enabled Ruby to go from a relatively unknown programming language to a mainstream one within the frame of just a couple of years. Languages are made to be used, so overall, most would agree that the advantages for Ruby, brought forth by Rails’ success, far outweigh the negative aspects. In the words of Matz, Ruby’s creator:

Rails is the killer app for Ruby.
— Yukihiro Matsumoto

Whatever your take on the subject is, in this article I argue that Ruby on Rails is actually the best thing that ever happened to Python. Rails is a successful Ruby framework, so some may think that it would convince people to switch from Python to Ruby. In other words, naively, one could think of Rails as a Python exterminator, at least as far as web development goes (which is a big deal nowadays). This couldn’t be further from the truth. This year is going to be a great one in terms of the adoption of Python, and I think that Rails has had a positive influence in this regard.

Independently from Rails and Ruby, over the past few years Python has had a good deal of penetration within the market. It wasn’t Java, of course, but as far as dynamic languages go, Python was well represented in many companies and achieved a fairly adopted niche even within the enterprise world. What Rails did was to promote and popularize the usage of MVC web frameworks written in dynamic languages. What could have been considered an unusual choice in the pre-Rails era, is now viewed by most as the right way of developing web applications. The marketing abilities of the Rails community benefited the Python one, in the sense that they made the usage of dynamic languages for serious web projects a very acceptable and even well warranted choice.

Rails got the message out that MVC web frameworks and “scripting” languages could be very productive and much nicer to work with. Django and other web frameworks are indirectly taking advantage of this. A couple of years ago people were asking me whether it was better to adopt Rails or stick with Java for a given project. Nowadays, most emails and requests that I receive are about whether it makes sense to adopt Rails and Ruby or if it would be more sound to use Django and Python.

Initially, even Sun hired Ruby hackers to work on JRuby and have only recently announced that two pythonstas will work on Jython full-time. Yes, they are late to the party and should have done this years ago, but I think that Rails’ popularity and hype led them to consider Ruby first before eventually realizing that they should have done the same thing for Python. Rails has been, at least in part, a catalyst for Python’s success.

Don’t let this confuse you though. Python (and Django) are able to benefit from all the interest geared towards dynamic languages, only because they are technically excellent and make a strong case on their own. Their communities are much less about marketing and more about substance, in my opinion. I understand those who go from Ruby to Python, but there are far fewer motivations in favor of a switch from Python to Ruby. The reason for this is that, in a way, Python is currently an answer to Ruby’s MRI shortcomings. When I speak about Ruby’s shortcomings I always refer to the implementation and not to the design of the language, which is a well balanced and coherent mix of paradigms and features.

Things will change with Rubinius (and perhaps JRuby), but as it stands right now, Ruby’s implementation has critical limitations that affect the development of non-toy projects and its adoption within the enterprise world. Speed, I/O processing, threads, garbage collection and troubling deployment when compared to other languages, are serious issues. It doesn’t mean that you can’t use it, just that the limitations that are in place will make your life more difficult on certain projects.

In a way, Python is the only acceptable implementation of Ruby for certain values of Ruby. The two languages have different approaches and quite a few distinctions which make them both unique. Overall though there are plenty of similarities that make developing in one or the other a somewhat comparable mental process and coding experience. Sure, Python doesn’t promote the functional paradigm as much, and it’s less implicit/magical than Ruby (read import this). This could be a good thing when it comes to large and enterprise projects, but the two are all not that different from each other. They’re Capelli d’angelo and Spaghettini, as my fellow countryman Alex Martelli eloquently put it.

As much as I may like Ruby more as far as language design goes, not only does Python boast a very solid implementation, it has several advantages over Ruby that go beyond the interpreter. I’ve found that Python has an incredible amount of rock solid, high quality libraries that perform very well. Not all of them of course, but most are well coded, maintained and documented. In Rubyland we can’t claim the same levels of good reusable code. I use both and I see a big difference. Lingering for a moment on the subject of documentation, Python has a wealth of tutorials, guides and even entire books available for free online. Learning Python from these, without spending a cent, is a walk in the park. Ruby on the other hand has good books in print, but a long way to go as far as free documentation goes. And this is true for both Ruby and Rails.

The community attitude is much different too. The Python and Django communities generally keep a low profile, following the “shut up and show them the code” mantra. They do have some marketing issues but can’t be blamed for hyping their technology, like at least in part, Rails has done. For example, Django is a very mature framework that’s several years old, and yet it still hasn’t been tagged as a 1.0 version. If Twisted Matrix was implemented in Ruby it would be advertised as the second coming of Christ. :) Jokes aside, I feel that the Python community has a very good attitude which is in no way altered by the Django one, because it happens to share the same traits. There are no exclusive private clubs or the feeling of experiencing a technological “gold rush”, even though the community is in no way smaller. This may seem like a minor point, but for many the maturity, pragmatism and attitude of the community is a big selling point for Python/Django.

I’ll refrain from indulging in a full length comparison of Rails and Django. But I must briefly mention that Django takes the cake when it comes to creating applications that do web publishing (for obvious background reasons). Despite attempts to put Photoshop online, I feel that most of the web is still about publishing and interacting with published data. This makes Django a good choice in most cases. Of course, should you develop a web application that intends to replace a desktop app, Rails will most likely have the edge there.

So what does this mean for me personally? I’ll use them both, as I’m a firm believer in using the right tool for the right job. I’ll give you an example. Stacktrace.it is a small revolution in the Italian IT publishing world. A few months ago I contacted about 30 people from amongst the best Italian hackers and IT professionals and I proposed that together we create a site in which we’d promote and influence software development and IT in general in Italy (even if I live in Canada myself). The site has been going very well and has attracted a group of highly technical people who follow and contribute regularly with high quality articles. The code was based on Luambo, an open source blog engine yet to be officially packaged and promoted to the world. What was remarkable about it was that most of the new features that were requested in our private mailing list ended up in the code in less than five minutes. An unbelievable level of productivity. Even our designer, who was not familiar with the language or the framework, was easily able to work on the project. Guess what? Despite loving Ruby and Rails, when it came to deciding on the framework and language to be used for that project, I strongly pushed for the adoption of Django and Python, and not Ruby on Rails. It was simply the right tool.


Great Ruby and Rails books

Some of the Ruby and Rails books I ownI finally got around to updating my recommended Ruby book page. I decided to split it and create two new pages, one for Ruby and the other for Rails. These include new gems (pardon the pun) such as Obie‘s The Rails Way (best book on Rails currently in print) and the fantastic Design Patterns in Ruby.

By the way, the picture on the side is a quick snapshot I took to show some of the Ruby/Rails books I own. In fact, I only recommend books that I own, have borrowed or otherwise thoroughly analyzed. :) I hope you’ll find my suggestions useful.


Recommended Ruby books


Recommended Rails books



How to install Django with MySQL on Mac OS X

Installing Django on Mac OS X Leopard is supposed to be very straightforward, but if you are new to it, you may encounter a few puzzling questions and, in the case of MySQL, even a couple of headaches. I’m writing about this for the benefit of those of you who may attempt and struggle with this feat. MacPorts is not required for this how-to.

First and foremost, we are going to install Django from its svn repository, as opposed to obtaining the 0.96 release archive. The reason for this is that the trunk version implements a few new features. The development code is also rather stable and used by most people in production mode, even for sites like the Washington Post.

Checkout Django

svn co http://code.djangoproject.com/svn/django/trunk django_trunk

Tell Python where Django is

Mac OS X 10.5 already ships with Python 2.5.1, thus you won’t have to install it. You can verify this by running python in the Terminal (use exit() to get out of the python shell). What you need to do is inform Python about the location of your django_trunk directory. To do this create the following file:

/Library/Python/2.5/site-packages/django.pth

Within this file, place only one line containing the path to your django_trunk folder. In my case, this is:

/Users/Antonio/Code/django_trunk

Of course, change it to the full path location of the directory on your filesystem.

Add django-admin.py to your PATH

The bin directory within the django folder (which is inside django_trunk itself) contains several management utilities. We need therefore to add the following to the PATH (again, change it to your own location):

/Users/Antonio/Code/django_trunk/django/bin

How you go about doing this, depends on the shell you are using, and I’m assuming you are able to export a shell variable on your own. In case you are using the bash shell (as I do) then you should have a .profile file in your home directory. Alternatively, you could just create a symlink to the utility django-admin.py in /usr/bin, but I recommend the former approach.

Grab and install MySQL

I would normally recommend PostgreSQL, at least until we have DB2 on Mac, but I realize that many of you use and prefer MySQL, which also seems to be the only one that requires special instructions due to a few installation issues when trying to get MySQL and Python to work together. You can install MySQL by grabbing and running one of the packages that are available on the official site. Choose the one for x86 and Mac OS X 10.4.

Install the MySQLdb driver

Get MySQL-python-1.2.2.tar.gz from SourceForge. Please follow these exact instructions because the source code won’t compile out of the box and will give you the following error when trying to build it:

/usr/include/sys/types.h:92: error: duplicate 'unsigned'
/usr/include/sys/types.h:92: error: two or more data types
in declaration specifiers
error: Setup script exited with error: command 'gcc' failed

Run the following:

tar xvfz MySQL-python-1.2.2.tar.gz
cd MySQL-python-1.2.2

At this point, edit the _mysql.c file and comment out lines 37, 38 and 39 as follows:

//#ifndef uint
//#define uint unsigned int
//#endif

Now, from the MySQL-python-1.2.2 folder run:

python setup.py build
sudo python setup.py install

If you still get an error (and only in that case) you’ll need to edit the site.cfg file within the same folder and set threadsafe = False, before running the two commands above once again.
If instead, you don’t receive an error but you see warnings about files not required on this architecture, don’t be concerned about them. The last step required is to create a symbolic link with the following command:

sudo ln -s /usr/local/mysql/lib/ /usr/local/mysql/lib/mysql

All these adjustments are required because we are building and installing the driver on Mac and not on Linux.

Verify the installation

You should be all set now, but let’s verify this right away. Open Terminal and run the following commands in the python shell (start this with the python command).

Verify that MySQLdb is correctly installed:

>>> import MySQLdb
>>> MySQLdb.apilevel
'2.0'

Now, verify that Django is working:

>>> import django
>>> print django.VERSION
(0, 97, 'pre')

By running exit() get out of the python shell, and verify that django-admin.py is in your path:

django-admin.py
Type 'django-admin.py help' for usage.

If you obtain a similar output for all three of them, you are really set to write the next YouTube.

Where to go from here

Now that Django is installed, you can go read the Django Book 1.0 that’s available for free online. Something equally well done and useful is really missing from the Rails community. Above all, experiment, Django (and programming in general) is learnt by doing. The Definitive Guide to Django: Web Development Done Right is also available for purchase in its deadtree version, which just came out. It’s cheap and it’s already a best seller on Amazon. Despite the availably of a free version online, I like having paper versions of tech books so that I can read without staring at the monitor. Furthermore, I feel like rewarding the authors (who are also the framework creators), while encouraging publishing companies that are willing to allow authors to make their books available for free on the web. Well done guys!


A preliminary review of three Cocoa and Objective-C related books

As announced before, I got interested in Mac development, bought a bunch of books and spent a few nights reading and coding. Here are my first impressions on those books which thus far I’ve picked up.

I only had time to read 3 chapters from Stephen Kochan’s book and I must say that I’m not impressed! The pace is extremely slow and experienced programmers who read it will be bored to tears. An example of this, is the fact that he spends 15 pages on teaching how to use if/else statements. I’m afraid it’s not working for me; by nature it’s far too basic, and slow paced books are irritating. I don’t blame the author, I’m just not the right target for such a book – and I find the title to be inappropriate, or rather, inaccurate. It should be renamed ‘Learn to Program with Objective-C’ or ‘Introduction to Objective-C’ not ‘Programming in Objective-C’. Readers who don’t know how to program in C or any other programming language, will find this book to be a very good explanation and thorough introduction to programming though. The book “Learn Objective-C on the Macintosh” is basic too, but it’s often recommended as an alternative to Kochan’s book. According to what I’ve seen from the sample chapter, this is still a very gentle introduction to the language, but it carries more insight and it’s not a boring read. Plus one of the authors is Mark Dalrymple who is very active in the online community as well.

Hillegass’ book is a whole different story. He is clearly a great teacher and, while I’ve read only half of this book so far, I can already conclude that this book rocks. Most of what I’m learning is coming straight from this book. Cocoa is not that easy but I feel that this tutorial sufficiently covers the subject matter at hand in-depth and gives a good deal of clarity to the fundamental concepts of this topic. I won’t be an expert by the time I’ve finished this book, no (this is never the case with any one book), though I will have a far better grasp of Cocoa. I’d say that at this time, it’s most likely the best book I could be reading on the subject. I highly recommend it to those of you out there who’d like to follow similar steps (if you buy only one book to get started with Cocoa, this is definitely the one I’d go for).

I read three chapters from Advanced Mac OS X Programmingso far, and I’m really glad I bought this book. If Cocoa Programming for Mac OS X (2nd Edition) is the the best tutorial to learn the basics and get started with, this advanced book appears to be what I’m really aiming for eventually and there is no doubt in my mind that it’s going to become my reference of choice along with the official Apple documentation. It covers difficult topics in detail and gives you insights that I’ve not found elsewhere on the Web. If I’m aiming to get serious about Mac development, I have to study this tome as best I can. I’m holding off on reading it for the moment, as I believe this book is the perfect continuation of the one I’m currently reading. From the chapters that I’ve read up until now, I’m wowed by this book. Mac OS X is a Unix OS, and this book covers that aspect by not leaving many details out. So far it looks like the perfect match up between theory (you will get a lot of college flashbacks when they talk about multi-threading and networking) and practice (the chapters on Memory management and Subversion are worth the price alone). Mark Dalrymple and Aaron Hillegass nail it again with a must-have book for serious developers.

Not bad, I bought three books and it turns out that two of them are great. I’m tempted to return the Objective-C one, but ultimately I don’t think that I’ll end up doing so.

I’ll suggest a fourth book, in case you are approaching Objective-C without any knowledge of C (but with at least some knowledge of other programming languages). I’m using it myself to brush up my C skills, which are certainly there, but in need of a quick refresher course.

Objective-C (aka ObjC) is a superset of ANSI C in fact. As such, any C program is also a valid Objective-C program. It provides you with a relatively easy and straightforward way of doing Object Oriented programming, while simplifying memory management. From what I’ve seen though, unless you are willing to become well versed in C, you won’t become an overly advanced Objective-C developer. Knowing C already (albeit I’m not a Guru), I must say that Objective-C is very easy and can be picked up in a matter of days. The real power and learning curve comes from the Cocoa framework itself, and that’s where I’m going to focus my efforts.


Cocoa is my Cup of Tea

Writing the article “Desktop Applications are not dead!” was an interesting experience that led to vivid discussions about the business of software for desktop applications, including the current limits and options available in this field. In the last comment by Eugueny Kontsevoy (the person I was responding to with my article in the first place), he expressed once again his frustration regarding Windows development:

“Seriously: I am an engineer for the sake of it: I love what I do and spending 20% of my time planning the deployment and dealing with failing Microsoft OS components is NOT something I want to do anymore. Period.” — Eugueny Kontsevoy

Before you dismiss his comment as an over exaggeration or peg him as having too picky an attitude, I would suggest thinking twice. The guy has a point, and if you’ve done Windows desktop application development before, you know this is often the case. My article proposed possible (partial) solutions for making Windows a more enjoyable and viable deployment platform for software startups. Of course, the easy way out is to leave the desktop market and move exclusively to the Web application arena. Hey, that’s what everyone else is doing, that’s the future, it’s buzz compliant, etc… But I want to take my own advice, and put my money where my mouth is.

Taking the red pill

I felt more at ease with my Mac after 5 weeks of using it, than I had with Windows after a dozen years. We feel like old friends, like Hemingway’s old man and the sea. I absolutely love Mac. I love its culture, the quest and appreciation for beauty. Quality over quantity, simplicity over complexity, beautiful design over crowded ugly interfaces. Mac is productive; Mac is zen-like, inspiring, and enlightening. Mac makes me happy to be a computer geek, and in my mind, Mac OS X is simply the best operating system available today.

I’m taking the red pill: I’ve decided to get serious about developing applications for Mac OS X. I can’t refrain from programming with this beauty.

Oh boy, where do I start?

I’m writing this as a quick guide for whoever decides to follow a similar path as mine. Consider that I’m just starting out, so I don’t know anything beyond what I’ve researched from reading other peoples’ opinions. I think it’s a sensible plan though. There is a wealth of good information on Apple’s site and many guides all over the web. Here is a list of resources that I am using or which I plan to use. They refer to Objective-C and Cocoa, which are respectively the favored language and framework for developing Mac applications.

First Step: Let’s get excited

  • Let’s get motivated with these slides from one of the most successful Mac developers out there and his associated podcast (whose genre is ‘religious’, according to iTunes, hahaha);
  • Beginning Mac Development: A good guide on how to get started by MacZealots.com;
  • Subscribe to CocoaRadio, an awesome podcast including interviews with the most popular and successful Mac developers around.

Second Step: Let’s read some documents

Third Step: Let’s get serious, with some books

I actually ordered the three books below yesterday night. The second one is already here, while the other two should arrive soon enough. All three of them have stellar reviews.

  • This should teach the language in depth and serve as a decent reference to have on hand.
  • This is, I believe, *the* crucial book. I plan to read this cover to cover and work through it.
  • This book should provide some advanced techniques.

Fourth Step: Join the discussion

  • Join the irc.freenode.net channels #macdev and #macsb, respectively about Mac development and the business side of Mac programming;
  • Subscribe to the Cocoa-Dev and the MacSB mailing lists.

Fifth Step: Keep Reading

Apple Developer Connection (ADC) has a huge amount of information about developing applications and guidelines for delivering high quality products. Bookmark http://developer.apple.com/ and come back to it often. I know I will.

What about Ruby and Python?

RubyCocoa is a nice bridge that allows you to develop in Ruby and Cocoa. Yes, I’m super interested in this project, but I want to learn first the traditional way of using Objective-C and only then consider when and if Ruby and Python can be beneficial for my Mac development needs.

And what about DB2?

Do I miss DB2 when I am on my Mac? Hell yes. DB2 Express-C is just plain awesome and it’s the only software that I really miss on my Mac. It runs fine in a virtual machine, but wouldn’t it be great to see it run natively in Mac OS X? Well, this won’t happen tomorrow, but I’ll tell you something… sooner or later, we’ll get there!

I already know that the biggest challenge is going to be finding the time to study all this stuff, and above all, finding time to code (the only way to really learn). But it’s going to be awesome. What are your thoughts about this strategy for learning Mac development? I especially welcome comments from experienced Mac developers and people who, like me, have decided to give Cocoa a serious go.


23 Programming Languages compared through their Amazon book sales

Please note that this article is intended as a fun way of looking at several programming languages from a different and unusual angle. I have adopted many oversimplifications which make the outcome’s possible insight very limited. Take it at face value for what it is: a fun post that yields a general idea of the programming languages’ respective popularities, but don’t consider it as a scientific/statistical analysis.



Technical books are a topic that interest me a lot. From book sale figures and trends we can attempt to better understand where developers are putting their money, not only their mouths. For this article I decided to perform a small experiment, by collecting some interesting data. I considered 23 fairly well known programming languages, and searched for the top selling book (according to Amazon) for each of them. The Amazon sales rank allows us to compare the success of books representative of each language, and indirectly compare the popularity of the languages themselves.

Below is the resulting table with all the data organized by sales rank:

Rank Language Amazon # Book Title Publisher
1 Javascript 1,227 JavaScript: The Definitive Guide O’Reilly Media
2 Java 1,799 Head First Java, 2nd Edition O’Reilly Media
3 Ruby 1,881 Programming Ruby: The Pragmatic Programmers’ Guide, Second Edition Pragmatic Bookshelf
4 SQL 1,929 Sams Teach Yourself SQL in 10 Minutes, Third Edition Sams
5 C# 2,676 Programming C#: Building .NET Applications with C# O’Reilly Media
6 C++ 3,317 Effective C++: 55 Specific Ways to Improve Your Programs and Designs (3rd Edition) Addison-Wesley Professional
7 C 3,499 The C Programming Language (2nd Edition) Prentice Hall
8 Visual Basic 4,165 Microsoft Visual Basic 2005 Step by Step Microsoft Press
9 Python 5,537 Learning Python, Second Edition O’Reilly Media
10 PHP 5,936 Beginning PHP and MySQL 5: From Novice to Professional, 2nd Edition Apress
11 Perl 7,692 Learning Perl, Fourth Edition O’Reilly Media
12 Erlang 8,609 Programming Erlang: Software for a Concurrent World Pragmatic Bookshelf
13 Objective-C 10,476 Programming in Objective-C Sams
14 Groovy 13,613 Groovy in Action Manning Publications
15 F# 21,273 Foundations of F# Apress
16 Lua 23,052 Programming in Lua, Second Edition Lua.Org
17 Scheme 29,548 The Little Schemer – 4th Edition The MIT Press
18 Haskell 42,459 The Haskell Road To Logic, Maths And Programming King’s College Publications
19 Delphi 67,035 Mastering Delphi 7 Sybex
20 Lisp 86,188 ANSI Common LISP Prentice Hall
21 Forth 93,245 Forth Application Techniques FORTH, Inc
22 Smalltalk 279,312 Smalltalk, Objects, and Design iUniverse
23 Ocaml 290,618 Practical OCaml Apress



Despite the limitations of the methodology employed (see disclaimer for details), I think this table gives us a nice picture of the status of our industry. I’ll let the data speak for itself, and allow you to speculate in the comments, but I’d like to point out a few interesting aspects of the resulting data.

According to the table above, it is clear that the once widely adopted Delphi is now much less prominent (consider that there are more recent books on Delphi, and that they have even worst sales ranks). This of course, does not take into consideration the fact that Delphi may have great documentation online, but I doubt that this would end up penalizing Delphi books that are on the market to this extent. Java and .NET on the other hand are doing very well. No surprise there. Also it doesn’t come as a surprise that Javascript is, thanks to Ajax, so widely popular on Amazon. Notice how developers seem to be embracing the study of dynamically typed languages, even though statically typed ones are still predominating. C, despite its age, still keeps our industry going. What I found surprising was the sales rank of the Groovy book, I honestly thought Groovy was a much more limited phenomenon. Regarding the functional paradigm, functional languages are slowly becoming more adopted, but it’s clear to me that the paradigm is being accepted by most when incorporated within existing Objected Oriented languages rather than in its pure form as seen in languages like Haskell for example. Speaking of Haskell, I’m sure the data will change a lot when the new book Real World Haskell hits the shelves. And that’s what the Haskell world really needs, because Haskell is often presented in an academic way which is hard for a wide audience to digest, and it is considered too theoretical by many.. It’s no wonder that 150 of us, fired off an email in reply to a request for reviewers.

You may notice that the fourth most popular book on the list is a “10 minute” type of book for SQL. This is ironic but it doesn’t contradict the anecdotal evidence, as real world experience suggests that many developers don’t really know SQL, and they resort to quick guides as a remedy while working on a given project. It’s a shame, because database and SQL understanding are essential skills needed to be successful programmers in many areas. To conclude, by looking at the table, it is apparent that the Pragmatic Programmers are definitively influential. Let’s face it, they contributed a great deal to the growth of the Ruby community and are now helping edge forward Erlang’s popularity. According to other data available on the web, Erlang should have been somewhere at the bottom of this list along with Haskell, but the Pragmatic Programmer’s book on this language has already presold many, many copies (it will be published in mid-July). It is clear that this book is going to be a best seller and that it will do a lot to promote the language itself. This is absolutely a good thing, because Erlang deserves the spotlight. By looking at the column of publishers, one can’t help but notice that O’Reilly truly successfully markets its books, and they are generally highly regarded by us developers.

Disclaimer (Or… wait a second, dude!)

  • The method that I used didn’t account for books related to frameworks (Django, Rails, Seaside, etc…). The Agile Web Development with Rails book for example, has an incredible Amazon Sales Rank and it’s one of the best sellers of all time in our field;
  • This methodology favors languages that have a book which has been widely adopted within the community, as opposed to languages where sales are split relavitely equally amongst a few titles;
  • Not all languages are represented here of course. I just picked a reasonable selection;
  • Amazon is not the only place on Earth where books are sold. But I think it’s still a fairly accurate indication of the US market;
  • The Pragmatic Programmers sell many of their books directly, the sales ranks shown here don’t take this into consideration, so chances are they are underrepresented;
  • The links to Amazon have my referrer id. This won’t cost you a cent more, and will help support this site.

Ruby and Rails books, Textmate and FastRi

  • Ruby and Rails books keep popping up on the (virtual and real) shelves, which means that it may be slightly puzzling for newcomers to decide which books to spend their hard earned cash on. In the spirit of providing guidance in this process, I’ve prepared the Recommended Books for Ruby and Rails page. The recommendations are organized by skill level and should provide the reader with a nice logical sequence of increasingly more challenging reading material, making the task of identifying valid books easier for the new developer or student.
  • The more I become acquainted with Textmate, the more I’m impressed by such a nice little editor. I’ve had next to no time to play with it, and yet I’ve already added new functionalities to some of the existing bundles. In particular, I’ve committed a patch that extends the Textile bundle features, and I’ve become the maintainer of that bundle, with SVN access. Textmate bundles are very easy to customize and extend, and this flexibility is really appreciated from a development standpoint.
  • ri is an indispensable tool for the Ruby programmer, however you may have noticed that it’s a bit sluggish. If you haven’t done it already, do yourself a big favor and install the FastRi gem. FastRi provides various enhancements and advanced functionalities over the standard ri tool. But even when it’s used simply as a replacement for ri locally, it is significantly faster, and in my opinion more practical. Also, if you look for String#o for example, ri provides you with all the methods of the class String, that contain the letter ‘o’. While FastRi outputs only the methods starting with the letter ‘o’, which is what you actually want in most cases. Install with: $ sudo gem install fastri and $sudo fastri-server -b . Then use it in this way (qri is used for stand-alone mode, fri to connect to a remote server): $ qri String#scan.

Collage of Ruby and Rails books

While working on a presentation for a series of conferences that I’ll be speaking at, I’ve put together this image, to convey the attention that Ruby and Rails are currently getting from publishers. Feel free to use it for your own presentations, optionally crediting it to me if you’d like (you don’t have to).

The list of books may not be complete. And yes, the book images are from Amazon.com


Italian Ruby book and cool suggested reading

I’m glad to announce that Ruby per applicazioni web has been published by Apogeo. This is the first Ruby book written in Italian and I was a contributor as a technical reviewer and author of an appendix about Ruby and DB2. As you can see my name is only located inside the book and not on the cover, because while international publishers are usually glad to add contributors to the cover page, however in this case the Italian publisher decided to only include the main author’s name on the cover.
You can read Lawrence’s rant about this here. I don’t see this as a personal blow though, what really matters is that Ruby is booming across the globe, and creating a revolution in the development world and that we now have an Italian book to help my fratelli d’Italia.

While on the subject, there are a few remarkable books that I’m currently reading or have just finished reading, and I’d like to recommend them to my visitors:

  • Ruby cookbook, yes, I’m biased as I contributed to this book, but it’s really a great tome rich in great programming examples to solve common tasks
  • Ocean Sea, ok not a technical book, and I actually read it a few years ago, but it’s a beautiful novel from one of my favourite Italian writers who deserves to be better known internationally

While listing books, these are some of the books I plan to read in the next few months, straight from my Amazon wish list (feel free to help slim it down :-P ):

Should any author or publishing house be interested in having me read and provide a thorough, unbiased review of these titles or related work, I’m available to do so, and can be reached by email. I will gladly publish my review in this blog and on amazon ;-)


Ruby Cookbook: Rough Cuts Version

Ruby  Cookbook

Currently online O’Reilly is selling the rough cuts version (basically the beta version) of the Ruby Cookbook. It’s a pleasure to see that many good books about Ruby are being published.

This book authored by Leonard Richardson and Lucas Carlson is particularly special to me. In fact, I have contributed to the book with three recipes and related full-length explanations. My recipes are about using RMagick to achieve common image manipulation tasks, as I love photography and I like RMagick a lot!

The recipes are Thumbnailing Images, Adding Text to an Image and Converting Among Image Formats. While these tasks are quite easy to achieve thanks to Tim Hunter’s library, I tried to go the extra mile and provide a good sort of introduction to the library, within the limits of the problem/solution framework of these kind of books.

It’s my first contribution to an O’Reilly book and I’m humbly proud of it. I look at it as a stepping stone until the day when I’ll publish my own book about Ruby :-)


Ruby rocks and Java sucks?

Java VS Ruby

Many hackers are quite religious about their programming language of choice, but I’m not. Whenever possible I try to be rational about things that matter to me. For this reason you won’t hear me saying things like: “Ruby rocks, Java sucks!”. Indeed Ruby rocks, but it does so for me, for the kind of development that I love to do and for the way I like to think and express my thoughts in code.

I am quite confident that Ruby would be a great programming language for a broad audience of hackers worldwide, but this doesn’t mean that we should belittle those who happen to work with Java, C# or other “bureaucratic” language. On the web there are thousands of threads about “Java vs Ruby”, “PHP vs Rails”, “Python vs Ruby”, “C# vs Java”, and so on… this is mostly non-sense. Of course all these languages have differences that will determine your life as programmer, but you really need to go and try them out for yourself. Spend time selecting and learning your development platform, experiment, and if possible learn more than one language and framework. Different paradigms can be a huge gain for the programmer in terms of flexibility. I really love to work with drills, but sometimes you need a screwdriver, or just a hammer. “Buy some tools” keep them in your toolbox, and then use the ones that will let you do the job better. Or that are requested by the company were you work or by the client, or again that you enjoy using the most.

Some programming languages let you be more productive than others in particular circumstances, create a more maintainable code and so forth. Assembler is definetely less “human-friendly” than Python for example. But in the field of general purposes languages, the real bottleneck is often the programmer not the language! It’s your level of mastery of the language, that makes the difference in most cases. I love Ruby and it is in my opinion, a slightly better language than Python, but at the moment I am not half as productive in Ruby as Alex Martelli is in Python. :-)

One day my wife asked me why I was so passionate about Ruby, while I used to be interested in C# a lot. She asked me what the difference is and the advantages are? Now, she is a very smart woman, but she hasn’t a programming background so I tried to explain to her without going into details like dynamic languages, meta programming, ORM, and so on. She mostly got what I meant but I was looking for a more effective and direct way of illustrating the concept.

A few days ago I remembered the funny photo that you can see on the top righthand side1. That’s probably the best answer: simplicity. Ruby doesn’t get in the way and it lets you express your ideas, because Ruby is as simple as possible but not simpler as Einstein would say. You don’t need a dozen books to master Ruby or Web development with Rails, you just need a couple of books, a brain and some practice.

(1) I’d like to give credit to the author of the photo, but I don’t know who originally took the picture. I’ve only added the Einstein quote and rounded the corners.


Next Entries »

Copyright © 2005-2010 Antonio Cangiano. All rights reserved.