Today we’re going to take a look at the various web programming languages that power the Internet. This is the fourth part in a beginners programming series. In part 1, we learnt the basic of variables and datatypes. In part 2, we moved onto functions and control structures. In part 3, we had a look at some of the numerous software programming languages. Like last time, I’ve included screenshots of what typical code in the language looks like, which I believe is a good at-a-glance indicator of whether you’re going to be comfortable programming it or not.
PHP
PHP is the undisputed king of server-side languages in use on the Internet today – running on 75% of all web servers – and is the power behind WordPress, Wikipedia, and even the user-facing part of Facebook.As a server side language, the code is processed before it reaches the user’s browser, so all they see is the final page and none of the original PHP code. PHP is mainly used in conjunction with MySQL to pull information from a database, manipulate it and present it to the user.
PHP is general-purpose and comes as standard with most web servers – if you’ve ever heard the term MAMP/WAMP/LAMP, the P generally stands for PHP (the rest is Windows/Mac/Linux, Apache, and MySQL).
MySQL
Another component of standard web server installations, MySQL is a free, open source database server. It’s not a programming language as such, but it is a new language to learn if you want to talk to databases so it’s a key component of modern websites. Although MySQL is actually a command-line language, there are common GUI tools available such as PHPMyAdmin for managing databases more easily.Again, MySQL is what powers WordPress - so all your posts and content are actually stored inside a MySQL database.
Javascript
Not to be confused with Java, the full object oriented software programming language we introduced last week, Javascript is the daddy of interactive webpages. It’s a scripting language that’s run locally on the user’s browser, allowing webpages to respond to user interactions such as clicking on elements and timing events. To cover everything Javascript is capable of would be impossible – suffice to say if there’s something interactive on a site, and it isn’t Flash – it’s more than likely Javascript.It’s worth mentioning JQuery at this point too. JQuery is a Javascript-framework which lets you write less code and gives you greater browser compatibility, and is quickly becoming the standard for modern webpages. It’s particularly useful for targeting specific parts of a webpage using familiar CSS terms and doing something with them, such as showing or hiding them. Although JQuery is made from Javascript, it introduces its own unique language components too, so just because you know Javascript doesn’t mean you can automatically use JQuery (you could also argue that you don’t need to know much Javascript to be able to use jQuery). We’ll definitely be looking at this one at some point.
Perl
Perl used to be a major force in web programming but has since been relegated to mostly just text-processing applications. It’s incredibly fast at processing text, but not of much use on the modern Internet. It’s something that all hackers have in the box of tricks though, so it’s worth checking out at some point.To give you an idea of the power of Perl, here’s the complete code that was created to crack DVD encryption. Yes, it is rather cryptic:
Ruby
Ruby, and its web application framework Ruby On Rails, powers some pretty major websites such as Groupon, Shopify (a commerce platform), and the front-end of Twitter. It’s a full object oriented language that’s interpreted by the server and then sent as a finished HTML page to the browser – much like PHP (yet also completely different, *sigh*). It has a number of key advantages though, namely in rapid development, less code repetition, and speed.Unfortunately, most web servers do not support Ruby out of the box, so unless you’re able to configure your own server as you wish, you need to use a hosting service such as Heroku.
Python
Python is another full object-oriented high-level strongly-typed language. Adjectives used to describe Python typically include fun, easy to use, and a good learning tool – but ultimately there’s very few real-world Python web applications. It certainly sounds like a good place to start though, especially if you’re the kind of person who’s into Linux and open source / community-driven projects. Just don’t expect to be making any actual webpages with this, and there appears to be a rivalry with the Ruby community.ASP.net
This is Microsoft’s contribution to the web language arena, predictably popular in corporate environments and nowhere else. It’s closely integrated into the .Net family, and you need specific Windows hosting to run ASP.net web applications, which in my experience is far more effort than it’s worth. Stay away from this one unless you have a really good reason not to.So, Which Should You Learn?
If you want to create a modern, interactive website, I suggest a combination of PHP, MySQL, and possibly JQuery/Javascript for interactivity. That’s not to say the languages such as Ruby and Python aren’t worth investigating as a learning exercise – which we certainly will be doing at some point – but if your time is limited and you seriously want to start learning useful real-world skills then the PHP/MySQL combo is the best place to start.If you think I’ve missed something, then feedback and reader contributions are always welcome in the comments.
0 comments:
Post a Comment