Re: Best open source project/framework to support a php training course?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 27 September 2006 20:47, Ligaya A. Turmelle wrote:
> There are a number of frameworks that you can use from PEAR (though many
> argue over whether it is a framework), Solar, CakePHP, Symfony, Zend's,
> and many many more.  As for most OS projects - I don't know of a
> particular project that uses a particular framework (someone feel free
> to tell me otherwise).  Many of the larger (aka well known) OS projects
> tend to be hodged podged together from what I have been told (again
> someone feel free to contradict me).

Varies widely with the project.  OSCommerce is a great application to study as 
an example of what NOT to do.  It's horrid.

On the other hand, Drupal is a very good example of using PHP4-era code to its 
fullest.  Modular design, plugin architecture, separation of logic and 
content and presentation, function-level polymorphism, all kinds of good 
stuff.  (Disclaimer: I am a Drupal contributor, so I am biased, but I'm a 
Drupal contributor because of how good a system it is.)  Of course, Drupal is 
not a framework per se, but a CMS/framework.  It's not for the first time PHP 
developer.  

Here's another idea: If they're just starting out, don't give them a 
framework.  Make them work without one, then write their own, realize how 
hard it is, then they'll appreciate what separates good code from bad code 
much better. :-)  One should never use a WYSIWYG HTML editor until one is 
fluent in HTML tags and CSS by hand.  Similarly, using a super-high-level 
framework before you understand how to write a decent function that 
manipulates a nested associative array to control an SQL query means that you 
will never learn how to properly manipulate a nested associative array (which 
is, frankly, what makes PHP teh awesome).

> Might I make a suggestion to you - no matter which framework/OS project
> you use... Have it be in PHP5.  Yeah it may restrict you in options, but
> that is where PHP is going and to my mind that is what someone new to
> PHP should be learning.

True, and Zend is certainly pushing that hard.  On the other hand, there's 
plenty to learn with PHP 4-era code (although that can certainly be done in 
PHP 5) before introducing advanced topics like magic object callback 
overrides.  Plus, better than 50% of the shared hosts out there today still 
run PHP 4 for a mixture of legit and stupid cop-out reasons.

> You should also make sure to go over security in one of your classes -
> the intro would be my preferred class since security is a mindset as
> well as a way of coding.  And it is easier to create habits then unlearn
> and relearn them.  Just my $0.02

The very very very first code they write after "Hello world" should be a 
secure input wrapper.  Go over ALL the issues with PHP user input *in 
historical context* (register globals, magic quotes, $_REQUEST as evil, why 
you should get out of the global namespace as soon as possible, etc.) and 
have them write code to safely get input from the user regardless of the 
server configuration.  That right there is a good solid challenge, but it 
makes them paranoid from day one, which is how they should be.  It also is 
code they can (and should) then use in all their later projects.

10 points off for every way you find to hack their code. :-)

-- 
Larry Garfield			AIM: LOLG42
larry@xxxxxxxxxxxxxxxx		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux