Learning PHP Programming

| 2 Comments

Finished learning how to use Fireworks to edit graphics. The graphic that accompanies today's entry was converted (with Fireworks) from a much larger Illustrator (*.ai) vector source file. Looks sharp, no? Fireworks is a hybrid graphics editor that supports both vector & bitmap objects in the same document.

PHPNow that that's done, I started learning PHP. Kinda excited. I've long known *about* PHP, and how it works (» server-side scripting), but never took the time to sit down and actually study the nuts-n-bolts of the language.

Currently using a video series titled » Essential Training, taught by Kevin Skoglund. He's good. (Very good.) In fact, Deke is the only instructor I found who's better. (Deke is head-n-shoulders above everybody. Mr. Entertainment.)

Amazing how much of a difference a good instructor can make. I've demo'ed other PHP courses, but couldn't get into them.

Skoglund also has another series (released last March) titled » 'Beyond the Basics,' which would provide seamless continuity, should my quest for the PHP grail continue.

I'd like to get to the point where I 'see into,' (or 'grok') the inner-workings of the language .. on an intuitive level.

So I installed the latest version of WAMP Server, and have begun learning how to program with PHP.

One nice thing about WAMP is that it allows me to DUPLICATE locally (via add-ons) the same server config currently residing on the Rad VPS (in Chicago). This approach to development would help identify and minimize any incompatibilities between different versions of Apache, PHP or MySQL.

Progress has been slower than I'd like but moving along nonetheless. Doesn't the tortoise (who never stops) always win in the end? I'm enjoying it. It feels 'right' .. if you know what I mean. In other words, it's working for me. The programming shoe fits.

Several factors influenced my decision:

••• today's entry continues here below •••

:

  1. Many world-class, open source projects are written in PHP, such as Drupal, WordPress, ExpressionEngine, MODx & DokuWiki. Anybody who wants to customize these programs will need to know the language. (EE is not open source.)

  2. I'm excited about using » MODx Revolution, a super-cool Content Management System (CMS) that should be released later this year. (Currently at beta5.)

  3. PHP is web-specific. In fact, the letters PHP used to stand for » Personal Home Page. In other words, PHP began as a set of tools to help people customize their web pages. Seeing how I already have a website, any programming skills acquired will be put to good use, sooner rather than later.

  4. PHP is very popular. TIOBE currently ranks it THIRD (after Java & C) in its index of programming languages. Its popularity has risen steadily.

  5. PHP is open source. That's FREE as in beer (cost), plus FREE as in freedom (to customize). I don't need to explain why FREE is good .. especially in today's economy.

  6. Tons of documentation out there. More PHP books than anybody could ever read.

  7. Supports advanced features, such as object oriented programming, which bodes well for future development.

I heard that PHP 5.3 (released June, 2009) was a MAJOR update. It included many features originally planned for release with PHP6. The most current version is » 5.3.1 (.. released Nov 2009). It's what I use. PHP 5.0 was release July, 2004.

PHP logoIf you agree with Joel, who says » Good software takes 10 years, and you concur with others who feel that PHP4 (released May, 2000) was really PHP 1.0 .. then PHP has 10 years of development behind it. So this would seem like a good time to jump in.

One interesting tidbit » Skoglund says the difference between compiled languages (such as C and Java) and scripting languages (such as PHP, Perl, Python, Ruby & Javascript) is that scripting languages do things ONLY IN RESPONSE TO EVENTS .. while compiled languages can do things even when they're NOT responding to events. Never heard that description before.

I've always heard that scripting languages are simply those we run thru an interpreter instead of a compiler.

Another thing I learned is » I need to actually WRITE THE CODE (WTFC). Watching Skoglund present his demo-code is cool. And it certainly SEEMS like I'm learning it. But when I actually try to write it myself, I see things I didn't notice before.

Maybe this is just me, and you can learn a programming language by simply watching somebody else. But there are nuances that don't become apparent until I actually write-the-code and run-the-script for myself. Hmmm. Why didn't that work? (Would be quicker/easier if I didn't have to.)

Rasmus Lerdorf, Andi Gutmans, Zeev SuraskiPHP is largely the product of two Israeli programmers » ZEev suraski & aNDi gutmans, who founded » ZEND. Tho PHP was was originally created in 1995 by a Danish programmer named Rasmus Lerdorf.

Here's what I learned today » If your string doesn't contain any $variables, use 'single-quotes' instead of "double-quotes" .. so the parser / interpreter / engine doesn't have to search for the $variable(s).

This will help the script run faster and use less server resources. If your script *does* however, contain $variables, you must use "double-quotes" in order for the $variable-substitution feature to work.

I used to wait until the stars were all lined up and my schedule free for the foreseeable future .. before starting a major new project like this. But I realized the stars never line up.

Seems there's always one thing or another clamoring for attention (.. you know how it is). So now I just jump in whenever I get a free moment. Tackling big projects this way isn't perfect, but better than waiting for the stars to align.

For more along these lines, here's a Google search preconfigured for the query » reasons learn php programming scripting server

2 Comments

The reason you haven't heard scripting langauges as those involving "responding to events" before is that it's simply wrong.

A charitable explanation for Mr. Skoglund's mistake is that being inexperienced, he's observed one common way that scripting languages are employed and assumed that it's what they are, putting the cart before the horse.

The earlier explanations you were given were correct; now, it so happens that being interpreted, scripting languages are amenable to field customization in ways that compiled languages really are not. One of the ways that very big, complex systems therefore can gain a great degree of flexibility is to embed a scripting language inside themselves, to allow some of their behaviour to be modified and extended in the field.

In this kind of architecture, "events" are a useful organizational metaphor for describing how the script code is launched by the rest of the system. The underlying (compiled-language) program has built into it several points where it can defer to a customer-provided script, to redirect the built-in behaviour; the notion of an "event" is this a way of describing these attachment points between the fixed part of the system and the part that can be customized.

This kind of architecture is very common nowadays; it's what web browsers do to hook Javascript into the HTML rendering process, or what computer games to do allow them to be extended (such as the Bethesda roleplaying games Morrowind and Oblivion).

However, these are examples of modern uses of scripting languages which are extending interactive programs: "events" are therefore a natural metaphor for such programs, since things happen in response to an external entity (the human end user). However, that's not the case for all scripts - for one, scripts are often employed in non-interactive environments, and scripting languages became plenty popular before GUIs did!

The flexibility that you get from combining a scripting language along with a compiled language base makes it an attractive combination that appears everywhere (indeed, many domain-specific langauges work that way, with the DSL being an interpreted one on top of a foundation provided by compiled code which provides the vocabulary specialized to the problem domain).

[ And indeed, that's the best way to describe PHP - it was a domain-specific scripting language (the domain being "web homepage generation") - that has become more and more generalized, by adopting more and more features from more general-purpose computer languages. ]

About this Entry

This page contains a single entry by Rad published on February 2, 2010 2:02 AM.

Wacom Intuos.4 Pen Tablet was the previous entry in this blog.

Beginning of the End? is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.