in reply to What language should I learn?
For web apps and database apps, I'd say PHP. PHP gets a bit of a bad reputation. For many coders it is the first language they learn, and often the only language they learn, so there's an awful lot of bad PHP code out there written by people with no formal training in programming. That's largely why it has a poor reputation.
But recent versions of PHP have had pretty good object-oriented programming support (its OO system is quite Java-like, supporting only single inheritance, with abstract classes and interfaces, and in the latest release candidates traits too), namespaces, a unified database interface (PDO). PHP supports Perl-compatible regular expressions. And PHP's syntax should be fairly familiar to Perl programmers, as its original designer was a Perl scripter. (IIRC PHP 1.0 was implemented in Perl, but newer versions are implemented in C.)
Weak points are the lack of an LWP::UserAgent equivalent (PHP has various different HTTP client libraries, but they're universally rubbish) and lack of something like CPAN (there is PEAR/PECL, but it it has a much smaller set of libraries available, and many are very poorly documented). Also, while there do exist some PHP extensions for desktop programming (e.g. PHP-GTK) they're not especially mature. PHP is not the language you want to use for desktop programming projects.
Python (like Perl) is a bit of an all-rounder. It's certainly suitable for web apps, database apps and desktop apps, though I find certain things about it quite infuriating. One factor that seems to irk a lot of people (including myself) is that whitespace is considered significant. An "if" block indented by 6 spaces might have a different meaning to an "if" block indented 4 characters, depending on the indentation of surrounding code.
Ruby is very Perl-like in many ways. However, it lacks Perl's breadth and maturity in libraries.
That said, a better learning experience might be to try learning some programming languages as un-Perl-like as possible. Once that use completely different programming paradigms. That way, when you come back to Perl, you can apply ideas you've learnt to your Perl programming. Learn a functional programming language like Haskell or Miranda; learn a declarative programming language like Prolog. Learning a very different language could help you become a much better Perl programmer.
|
---|