Lesson 1 in programing - write clean, reuseable and maintainable tidy code
Archive - Originally posted on "The Horse's Mouth" - 2012-12-16 09:28:13 - Graham Ellis
I often say to delegates that I train that they could write code that makes the dog's dinner look neat:
Really, that's not a good approach to code writing ... for sure, it can be cleaned up ...
... and you can end up with something sparkling tidy ...
... but why not write it tidy in the first place?
I stress writing clean, easy to follow, easy to maintain code on all the programming courses that I teach - right through from Learning to program in PHP for delegates who have never programmed before, through PHP Programming which is for delegates who have prior experience, but in other languages, and on to the Object Oriented Programming in PHP and PHP Techniques courses which are more advanced. And this coming week, I'll be following the same good design principles as I teach delegates about the use of "MVC" in PHP, and look at more advanced topics such as caching and testing, much of it under the Zend framework.
Although the example I talk about in this article is PHP, the same applies to our other courses in Perl, Python, Ruby, Lua, Tcl, C and C++.