beta it republik » Articles

Articles

Untitled Document
Monday, 28 April 2008 | Article

The Need to Teach PHP

The article examines why PHP should be taught professionally as opposed to simply learned from Internet sites (needs-based learning, that is). The contention is that needsbased learning is a short-term solution. In the long-term, however, professional teaching will benefit the growth of PHP as a language, its major applications, and you, the programmer.


Introduction
PHP is no different from other programming languages in that there is self-taught education and there is professionally taught education. But with PHP and other open source languages, the cost justification for professionally taught instruction is steep. Besides, the availability of Internet sites with programming tips makes learning PHP quick and easy. In addition, many quality books have been written which can guide a new programmer through many learning hurdles.

But self learning, supplemented by a good book or manual, still falls under what is known as ‘needs-based’ learning. Rarely do I see a programmer using a book such as those above, chapter for chapter. On the contrary, I usually see a specific programming tip or sample code being implemented. Because of the availability or these learning resources, many PHP programmers describe themselves as “Yeah, I know PHP… enough to make myself dangerous I guess.” The minority of PHP programmers are those with a near-complete understanding of the language.

So where is all this going? Will PHP become a language where implementation is through an army of self-taught PHP programmers?

Overview
PHP has become a mature, robust, and widely implemented web programming language. It is estimated that a third of all web sites are written with PHP. These are not just for personal LAMP (Linux, Apache, MySQL, PHP) projects, but also for corporate intranet and Internet sites. Thus, we can consider PHP to be ‘popular’. By ‘popular’ I mean there is an impetus behind its proliferation, and its implementations come in two flavours:

1. Needs-based web site development
2. Professionally taught web site development

Needs-based web site development occurs when someone does not know PHP and either desires to build a web site using it, or is told to do so by an employer. The need becomes the reason that personal research is done. Typically, php.net is the first place to look and sometimes the only place one need turn to. Needs-based learning isolates parts of PHP from the whole as the need encompasses a set of PHP attributes; so only a portion of the PHP will be learned.

Additionally, the proliferation of PHP has led to a rash of hacker attacks such as SQL injection, Denial of Service (DoS), and flooding. Each attack requires a patch to be installed or a programming fix. These needs-based programming events require research in the exact nature of the specific attack only. As PHP grows in popularity it will become a target of attacks. Needs-based learning will be slow to match the pace of the attacks.

Typically, however, needs-based learning arises from business needs or personal desire. For example, if a programmer is asked to fix a registration web site (because the new minimum length username became eight characters), she can access the PHP page and isolate the requirements section. But there are no minimum length requirements on other fields. So the programmer must now figure out how to get the length of a string in PHP. A quick look at php.net will turn up the strlen command. By viewing other statements in the PHP page, the programmer quickly figures out the proper syntax and implements the requirement.

So now what does the programmer know about PHP?—the strlen command and certain syntax rules. Hopefully a few more functions were realized while having the PHP page open for editing. But the point is that each need will require the exact same actions of learning. If the programmer needs to now add a check to ensure the username doesn’t contain certain characters, she will again research the one issue, find the solution, implement, and be done with it. But PHP throws a curveball at this. If ereg or eregi is used in the script, for example, the programmer will have to pay attention to the fact that as PHP has become more mature, some functions have been replaced. In this case, ereg will still work in PHP 5, but will PHP 6 support ereg? Or will preg_match be required?

Contrast the earlier needs-based example with a programmer who has learned PHP at the college level or through a certificate program. Here the programmer would have tackled everincreasing problems and learned a variety of ways to tackle a PHP dilemma. They can build holistic PHP modules and can even teach others. When I teach I encourage weekly assignments and classroom participation. Students work with each other to tackle in-class learning concepts. They typically would learn:
  • Installing PHP
  • Overview of purpose and uses of PHP
  • PHP syntax
  • PHP variables and reserved words
  • Strings
  • Arrays
  • Pre-built functions
  • User-defined functions
  • Interoperability with files
  • Interoperability with databases
  • Classes
  • Security
  • A dozen homework assignments to underscore the above
  • A mid-term and final to really underscore the above
  • A Web project to finally underscore the above

While the contrast is simplistic, the point can be made that open source languages (such as PHP) appeal greatly because of their cost (or lack thereof). Therefore, needs-based (or wantsbased) programming occurs at a higher level than in traditional programming languages. This might also be because traditional programming languages are more often taught at University level than open source languages.

The Money Issue
Professionally taught PHP costs money. If you’re a student and you have electives to take, then PHP (if available as a course at your University) will not cost any more or less than any other elective. But for the rest of us, we’d be paying especially for PHP courses. Employed individuals can seek their companies’ education assistance policies to see if reimbursement is available, which may help to put 50 to 100 percent of the cost back in the employee’s pocket. Another option would be for a certificate program. In this type of program, several languages might be taught to sum up to a Certificate in Computer Programming (or some such). But in the end, professionally taught PHP will require more money than the cost of a helpful book and perhaps a software license for a PHP editor.

On one hand, there is a free download of PHP and several free web sites from which to learn. On the other hand, you have to pay for the tuition and books to gain a well-rounded education in PHP and a certificate or similar for the effort. Again, in the short-term, free is clearly the better option. But for long-term, consider the value of education and what it can do for you.

Learning Co-Operatives
Recently, I have seen not-for-profit organizations partner with Universities to create certificate programs. These co-operatives are geared to provide for-profit companies, that invest in the not-for-profit, a cheaper alternative to their programming needs. Essentially, the for-profit company outsources the programming needs to the not-for-profit, but donates a sum of money to the not-for-profit to begin the relationship. The end result is that the for-profit companies enjoy a write-off, a cheaper programming cost, and the ability to hire from the not-for-profit as they have had overview of the programmers and can judge each programmer’s expertise.

So where does PHP come in? Well, PHP has become a core language to teach in these co-operatives. This leads to web site outsourcing as the core business being performed. The larger benefit is that structured, professionally taught PHP (along with HTML, MySQL, Analysis and Design courses) leads to better, more well-rounded programmers. These programmers can tackle larger projects at a quicker pace than if they had utilized needs-based education.


What This All Means
For those of us who program in PHP (or teach it), programs like phpBB and phpMyAdmin are mainstays. They provide very good functionality for bulletin boards and MySQL administration. Further, because each of those programs are so robust, they have a team of programmers and developers behind them. Sound familiar? There are plenty of for-profit companies that employ teams of programmers. My greatest fear is to see a for-profit company come out with a better PHP application and somehow tie that application to another application. Something like ‘The Ultimate PHP Program v2.4 requires a license for The Other PHP Program v1.3’.

Needs-based learning will not generate the next greatest PHP program. Needs-based learning will simply allow point solutions when the needs arise. Will the casual PHP programmer attempt to better phpBB or phpMyAdmin? I don’t think so. I think a forprofit company will, and my greatest fear will come true. This is where the future of PHP is at stake. If needs-based learning supplants professionally taught PHP programming, how will PHP survive a for-profit takeover?

So rally for more education of PHP at the University level or certificate level. Teach if you are able. I will do my part and will begin a monthly Beginner’s guide in this magazine!



About the Author

Marc Isikoff is a Senior Project Manager at Warner Music Group in New York City. There he runs financial and compliance projects. But evenings during the school year, Marc teaches PHP at Colmbia University. Mr.Isikoff has been working in IT for 14 years and enjoys teaching PHP and other languages.


   Related Links
http://www.php-mag.net
http://www.php.net


Comment

Name:

Comment:

Captcha Verification !
captcha_image