Wednesday, 13 July 2011

«From Python to Ruby» aka «Yet Another Infamous Comparison»!

In these days I'm interesting about Ruby and Ruby On Rails. I already know PHP and Python, but Ruby seems more active, widespread and interesting. For "interesting" I mean PHP still appears to me as a easier Java without compilation and classpath. Some friends of mine use Symphony, but I am not so enthusiastic about it. I like Python's abstraction level, but I admit it has too many web frameworks and none of them seem "cool" enough.
Rails, instead, uses an high level language (Ruby) and creates a homogeneous, well designed and complete environment for web application development.
These are my first impressions: maybe I am wrong.

This post is written for another religion war: Python vs Ruby. I belive it's a war without sense and I think it's usefull learning both.

Always learn at least one scripting language

It's fundamental to learn at least one scripting language. It could be lisp, javascript, python, ruby, perl, ecc. But it must read/write files, opens sockets and do everything a real language must do. It will help you to write some usefull scripts (e.g. create and populate a database from text files, download and save XML from network to local disk, ecc.)
Will learn more than a language will help me? yes! Because...

...you must use the more confortable tool...

...for a specific task. C and C++ are usefull for real-time applications and for videogames. They're not very good to write CGI or web applications. Java is good on servers, but I think isn't good for heavyweight audio manipulations.
I found myself comfortable with Python in many cases, but it is very likely I will use Ruby more often. Remember: the silver bullet is an anti-pattern. Learning more languages will give you more instruments to work better and faster. In programming there's not a Holy Grail, just the right tool in the right place.

No comments: