Programming languages, pt. 1: Why Markup Languages aren’t Programming Languages and Let’s Learn PHP

What are your plans now that summer has started? Why not pick up a programming language? Even if you don’t plan on using it in the future, some of the introductory tutorials can be fun to work through and might give you a new perspective on what it means to program.

Programming Languages vs. Markup Languages

HTML (HyperText Markup Language), it’s predecessor SGML (Standard Generalized Markup Language), and other related languages such as XML (eXtensible Markup Language) are actually not technically programming languages. This post will be dealing with programming languages and not markup languages. Programming languages are generally high level languages (meaning they are more easily read by humans, unlike the more cumbersome machine language) used to create programs. Markup languages are generally used more for formatting and structure. HTML also has some built in presentation semantics, but nowadays a lot of people are using CSS (Cascading Style Sheets) to set what the “look” (or presentation) of a web page is.

For an entertaining article on the subject: Programs vs. markup
or why HTML authoring is not programming

To learn more about the different kinds of markup: On Semantics and Markup

Post Part 1: PHP

PHP

About: PHP is an HTML-embedded scripting language used to create dynamic webpages. PHP stands for PHP: Hypertext Processor. Yes, you read that right. It’s a recursive acronym much in the same way as GNU is (GNU’s Not Unix!).
Related: Zend Engine
Compiler: PHP is a parsed language and so instead of a compiler, you will need a PHP interpreter to turn your text files into dynamic web pages. You can do this by signing up for a web-hosting service that offers PHP, but it is possible to set up an interpreter on your own computer. To learn more, here are a few sites:
For PC users: http://www.php.net/downloads.php
For Mac OS X users: http://www.entropy.ch/software/macosx/php/
For Linux users: http://us.php.net/manual/en/install.unix.php (there might also be particular packages for different kinds of Linux that you can install such as the “-libphp” and “php4-” packages for Debian Linux).
Another much more involved option is to create a development server by using a software bundle such as a LAMP (or a WAMP or a MAMP). LAMP stands for Linux, Apache HTTP Server, MySQL, and PHP (or Perl or Python). It’s the basic components for creating a web server. This is worth learning about, but not recommended for beginners. To learn more about how PHP and MySQL interact, here is an O’Reilly article on the topic: Are PHP and MySQL the Perfect Couple?

Getting Started

PHP Introductory Tutorial
W3Schools PHP Tutorial
Devzone’s PHP 101
List of PHP Editors

UIUC Resources:

UIUC subscribes to Safari Books Online, a service provided by O’Reilly. In the catalog, just search for “Safari Books Online” and make sure to select “Series” in the “Search by” drop down menu. There are books that specialize in a variety of ways such as securing web applications, PHP reference, as well as PHP and MySQL books.

Just for fun, one way to code Hello World in PHP:

<?php
echo “Hello, World!”;
?>

To see the PHP embedded in a web page, see the Introduction to PHP tutorial: Your first PHP-enabled page

Tune in to part 2 where I’ll focus on a different programming language. Any requests?

Facebook Twitter Linkedin

One comment

Leave a Reply