These days, Python and Ruby are popular programming languages with the tech startup crowd, and so, many of the venture capital backed ‘teach code’ startups, have ruby or python courses targeted at total beginners. The problem is, that these are not the best languages to learn programming with. Why?
In a nutshell:
1. PHP is easier to learn:
Python and Ruby are object oriented language at their core, so to do anything with the languages, you really have to understand object oriented theory and principles. This adds an unnecessary level of complexity to new learners.
Yes, modern software development is largely object oriented, but my 10+ years experience in teaching web development, has taught me that it is better to teach basic programming concepts and techniques before adding the OOP (object oriented programming) layer.
PHP has both an object oriented layer, and a much less complex prodedural layer, and that makes it the ideal learning language for people who have never written any software before.
2. With PHP, it's easier do real things.
With PHP, because it was designed specifically for the web, you can create web apps fairly quickly. On top of that, getting PHP apps live is also trivial - just upload the files to a PHP enabled server, and you are done. Try that with Ruby or Python!
Ruby and Python were not designed with web apps in mind. They were put together more as general purpose languages and have been adapted for the web. Yes, they are both excellent languages, but there is that additional layer of complexity when it comes time to actually creating a web app and going live.
…. These days, if you are creating apps, they are most likely web apps! So this is relevant.
3. PHP is BY FAR the most used web development language - it’s not even close!
If you are looking to put practical skills into student's hands, then PHP is easily the best choice. Check out this simple stat: over 80% of dynamic websites, that is to say, websites that are also web apps, are created with PHP. Ruby and Python together may add up to 7%.
In fact, what I hear from new programmers time and time again (after they learn Python or Ruby,) they discover that they have to learn PHP, since there are so many more jobs in the PHP world.
Consider this next stat, Wordpress runs about 23% of the world’s websites!! Add in Joomla and Drupal (two other popular CMS’) and we are probably close to 30% of the worlds websites being run by 3 web apps created with …. PHP!
.. There is no equivalent in the Ruby or Python world.
The point here is that there is a huge ecosystem in PHP that no other language comes close to. When selecting technologies, we all know from the Apple Appstore, that the ecosystem is hugely important. It’s a big reason why iPhone is so successful.
It seems clear, if you want to learn programming more easily, and you want see your code actually do something real, PHP is the obvious choice.
Add in the market viability of the language and the growing probability that Ruby will slowly fall into a micro niche (it’s already niche IMHO) … then there is really no argument. You can see why webmentor.org teaches programming with PHP first.
I made the choice to teach programming with PHP in 2004, NOT because I was a PHP programmer zealot. I’ve written software in 8 or so languages, I am language agnostic. In fact, my favourite language for years was Java … I’ve written more lines of Java code than any other language.
Instead, I chose PHP to teach programming, because it was the best choice - and it still is.
I hope you find this helpful.