Archive for the ‘PHP’ Category

Programming frameworks – MVC

If you have no ideea what MVC (Model-View-Controller) is about please read here, here, here and/or here.

When you start-up as a programmer, no matter what language, you first learn iterative programming, then your teacher learns about recursive programming and he shows to you and you are both happy, then you hurry up to do spaghetti programming for tens of projects, then your five years younger neighbour tells you about structured programming and you start to spend weeks on adjusting your projects code, and later you read about OOP in a cookbook and you delete all your projects to start new ones :D

From the beginning of his career the programmer tries to design and improve nice and efficient frameworks. Depending on the programming language the frameworks have different characteristics, of course, therefore you can’t use the exactly same framework characteristics.

But, as general programming behavior, I’d like to propose some guidelines regarding frameworks:

  • Try as much as possible to build/choose MVC frameworks from the beginning for your applications
  • Though we don’t like too much theory learning, read and learn about the MVC notions and specialists’ articles in order to improve your architecture logic; you may be surprised to find out that most of the time your application may run faster or be easier to maintain if you do the right customization, even if it’s related to one module of your application only
  • If it’s working and it suits your projects, your team is using it and you’ve already built the documentation, stick to it. Don’t try to change the projects’ frameworks on the fly, especially when you have a team using it. It takes lot of time and many issues keeps popping up, trust me. You should only change the framework if it’s bad from the beginning and it can’t be improved.
  • Try to choose/buy from the beginning a good framework that suits your needs. There are so many frameworks for almost all programming languages that it’s almost impossible not to find a suitable one. Learn the choosed one, they usually come with good manuals, and adjust it as you wish. It always takes less time and money. Just remember, if you have very complex projects that need too much out-of-the-box-framework customization for power and speed improvement (web big projects usually do), you might be considering as well to start you framework from scratch.

MVC frameworks examples: CakePHP (php), FuseBox (coldfusion, php), Struts (java), Spring (java) and many others (just google).

PHP 6.0 peek (unknown release date)

It’s long since we’ve had the first inside info about the 6th version of PHP. Actually, the very first time I heard about PHP 6 was back in 1999, long before good old PHP 4.3.0 :) (http://cvs.php.net/viewvc.cgi/php-src/NEWS?view=markup)

This Mid Octomber we will have the PHP 5.3.0 release. No word on the PHP6 release date, so we still have to wait. But the news is that PHP 5.3.0 will already have some of the 6th release announced features/improvements (namespace support, improved XML support through use of XMLReader and XMLWriter, SOAP support and others). So no Unicode support yet and you may still play with ereg (you have more time to switch to preg_match, hurry up ;) )

If you want to peek (again?) on what we’ll have in the PHP 6.0, I have some quick picks for you:

http://php.net/~derick/meeting-notes.html
http://www.ibm.com/developerworks/opensource/library/os-php-future/
http://www.phpro.org/articles/PHP6-Preview.html
http://snaps.php.net/ (php 6 snapshot, developer build)

PS: but of course, we already have the PHP 6 book :D (http://www.amazon.co.uk/gp/product/032152599X/ref=cm_cr_pr_product_top)