Leaving PHP for a new love; Python over Perl and Ruby
I’ve got about 8 years of LAMP type programming and still love PHP, but I new PHP wasn’t going to be up to the task for this project. PHP is great for web apps and simple CLI stuff but that’s pretty much it. In the past I’ve created some CLI PHP scripts which work pretty well, but it lacks the power of other launguages. Also there are no viable GUI tools avaiable for PHP which was a requirement for my project. Basically PHP was made to be a web programming language and everything else is a afterthought.
So with this in mind I started evaluating other launguages. As part of my project requirements it needed to be a scripting language and be available on older Linux systems (specifically RHEL 3). Initially I started looking at shell languages like Bash, CSH, KSH but quickly found out I wasn’t going to get the power and flexiblity I needed. So I started looking at Ruby, Python and Perl.
I wanted to make the right decision here so I took some time and read as many language comparision articles as I could find. I downloaded and installed my own copies of Ruby, Python, and Perl and started to play. Went through the “Hello World” type examples and spent some time just experimenting with the languages.
Initially I was trying to find out how usuable the old version of the languages were on my rhel3 systems, then see how easy it was to install localized $HOME versions. Overally I was trying to get the idea of flexibility and system usablility.
Existing modules, frameworks, toolkits and overall community support was a big issues for me as well, so I made the rounds checking out what I could and getting the overall vibe from the languages.
I don’t want to drone on forever, sense there are quite a few good low level languages comparisions. I’ll just focues on my overall impression. Languages can be almost religious for some, so save the hate mail. This is just my opinion:
Ruby:
Great object oriented language, but overall to “new”. Not quite as polished as Python, or extensive as Perl. There wasn’t the community arround it like Perl and Python had and it dosen’t have nowhere near the modules, framworks and toolkits that Perl or Python have.
So the end result for me was; I like it but it’s not quite there yet.
Perl:
Perl seems like it’s been around sense the dawn of time, and it’s showing it’s age. The language itself seems more like a bash scripting than a modern programming language. For me it was hard to use and cluttered. There doesn’t seem to be the language consistancy that Ruby and Python had. I think that just comes from being around so long and getting all this language clutter buildup.
Overall I like Perl for CLI text processing and the like, but for a cross-platform application it’s lacking compared to Python and Ruby. As a newbie to all 3 languages Perl just seemed harder to learn for me than Ruby or Python, it just seemed cluttered and harder to use.
Python:
Python’s for me is at that perfect stage, it’s got all the features I was looking for and none of the cruft like the older languages. It has the best “out of the box” feature set I’ve found on older and newer versions of the languages. I could do CLI, and GUI programming for Linux and Windows with the same code which was very appealing. For my project I have CLI parts and GUI parts, initially it needs to work on Linux and later on Windows. Overall this seemed like the best fit.
The language syntax was a bit odd for me when I first started with it, but I’ve grown to like it quite a bit and appreciate the syntax and formating. There is massive community support, and even companes like Google are putting it out there for everybody to use (Google App Engine).
Conclusion:
I don’t have that religios zeal for Python yet. But in love with Python as a scripting language that allows me to write code that worked on Linux and Windows with both a CLI and GUI interface. To get more familary with the language I started using iPython as my Linux system shell and love the outcome.
Next for me I want to check out web programming with Python and I’m curious how it compares with PHP. I’ve just started with Django and playing a bit with Google App Engine, I like what I see so far.
