PHP is currently the de facto web programming language of the internet that, from very humble beginnings, has risen to the height and eminence of being considered the worlds most popular and beloved web programming language.
The beauty of PHP lies in its simplicity and its power - it is a very simple language for beginners and is easier to learn than similar scripting languages such as Perl, but is just as, if not more powerful, than Perl and it comes with a broad array of inbuilt library functions, modules and extensions. There are an unlimited number of resources and avenues for help and support for PHP on the web and the manual is a joy to read, with the comments featuring on their pages being a goldmine of inspiration.
But what is its strength is seen as its greatest weakness in some people's eyes. Since it is so easy to learn, employers and nerds believe any fool can learn it and thus are unable to differentiate the goof from the gifted. But why does it have to be this way? Why should a developer need to put himself at a disadvantage by learning a difficult-to-learn-and-use programming language or a language limited to a single platform?
If languages were likened to paints and oils and PHP was likened to water color paint, would you call a John Constable water color a piece of crap and compare it to a five year-old's water color attempt? You wouldn't, but so many people do this because they think that if a novice can make something using it then it must be a poor medium but that view is just ignorant.
Do people wonder why PHP is so easy to learn? Have you ever spent time comparing the Java and PHP manuals? Reading the Java manual is like trying to find a flashlight in your garage in the middle of the night - it'll take you ages to find it (if you ever find it) and then you discover the batteries have run out and then you have to try out old batteries. The PHP manual, in stark contrast, is like knowing the location of the flashlight and finding it in daylight, and finding it with working batteries and a guide book next to it. Yes that's a poor analogy, but that's how it is, truly! Will someone please save us poor Java programmers and make a PHP-style Java Manual?!
The next problem is the language and platform war. Us Java and PHP programmers are platform agnostic (although we 'slightly' lean towards Unix/Linux) and we work well on almost any system, but the odd one out is Mr (I'm so high and mighty) .NET who only runs on Windows and is closed-source. But yet, the most popular language in the business sector is .NET using VB.NET and C# especially. I've nothing against C# as a language but why o' why do employers feel the need to limit their applications to a single, non-free, non-transferable platform? Why use a language that locks you in to a set of tools and a single platform? I don't get it.
Then there's the issue of the complexity of the languages themselves. PHP can be likened to Perl in its syntax and thus requires few lines to get things done and quickly, but PHP has more library methods, is easier and less cryptic to write, may use fewer lines and has good OOP features. PHP is like Perl's younger, more intelligent and more attractive sister. If you're currently banging away at Perl, you should turn over to PHP; Bioinformaticians, PHP is better and more poweful than Perl, please switch over!
And what about getting things done quickly and easily? Everyone who has tried to program Java knows it's not child's play but they can write decent programs although it takes a little longer and there are far more lines of code, but have you ever tried to do Java Enterprise Edition lately? Jesus! Hello World became Hello Universe! Not only are there very few tutorials, books and resources, but the concepts used to build the applications are numerous, difficult to grasp initially and are badly explained in introductory texts. The hardest part of learning a language is the beginning but Java EE 'takes the mick'. Do they want anyone to learn to build Java web apps? There's a reason why there is no "Idiot's guide to Java EE" book, and that's because you need to be a genius to figure it out.
From every which way you look at it, PHP seems to be the best choice as far as easy learning, fast development, less coding, more tools, more resources, platform independent, open-source solutions and more support goes. It's really a no-brainer why PHP is so popular, but it is unfair to discriminate against a developer for choosing it as their main language and loving it for all those reasons. PHP, as a tool, can be used very badly to write atrocious code but it can be used masterfully to produce a masterpiece. People sometimes forget that huge and corporate sites like Yahoo! run using PHP, that Wikipedia and almost all the major blog platforms run on it - it's not a simple toy and its developers aren't idiots, so we'd appreciate it if you didn't discriminate against us! [And give us jobs and paid us more ;) ]
By Ahmad Retha
Showing posts with label Perl. Show all posts
Showing posts with label Perl. Show all posts
Wednesday, 27 January 2010
Monday, 9 February 2009
Installing PHP, MySQL and Perl modules on Linux
Lately I've been doing quite a bit of work with Perl and I needed to count the number of characters in a string. Usually this is done with this command:
I discovered that you can use the Synaptic Package Manager to install Perl modules! If you do a search for "Unicode::String" in synaptic you can find the module and it installs so easily! So now the code is like:
Another thing I was doing was messing about with the PHP module in Netbeans. They provide probably the best instructions on the Internet on how to install Apache, PHP and MySQL on Linux: http://www.netbeans.org/kb/docs/php/configure-php-environment-ubuntu.html
$len = length($string);But what this actually does is count the number of bytes, so if you are using an encoding like UTF-8 it will not give the correct count of the letters in the string. I did a little search and discovered the existence of the Unicode::String module. I tried to follow the instructions to install it on Linux Ubuntu but both the usual and the manual method failed!
I discovered that you can use the Synaptic Package Manager to install Perl modules! If you do a search for "Unicode::String" in synaptic you can find the module and it installs so easily! So now the code is like:
#! /usr/bin/perl -w
use Unicode::String qw(utf8 latin1 utf16);
#... (some code to get the string from the file and stick it into $str)
$uStr = utf8($str);
print $uStr->length;
Another thing I was doing was messing about with the PHP module in Netbeans. They provide probably the best instructions on the Internet on how to install Apache, PHP and MySQL on Linux: http://www.netbeans.org/kb/docs/php/configure-php-environment-ubuntu.html
Labels:
Apache,
Linux,
MySQL install,
Perl,
Perl Module Install,
PHP,
Unicode,
UTF-8,
UTF8
Subscribe to:
Posts (Atom)