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++. (written 2012-12-16, updated 2012-12-22)
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
Q101 - Object Orientation and General technical topics - Programming Principles [2001] I have not programmed before, and need to learn - (2009-01-19)
[2022] Pre and post increment - the ++ operator - (2009-02-03)
[2228] Where do I start when writing a program? - (2009-06-11)
[2310] Learning to write high quality code in Lua - (2009-07-30)
[2327] Planning! - (2009-08-08)
[2415] Variable names like i and j - why? - (2009-09-22)
[2510] The music of the stock market - (2009-11-22)
[2550] Do not copy and paste code - there are much better ways - (2009-12-26)
[2586] And and Or illustrated by locks - (2010-01-17)
[2737] Improving your function calls (APIs) - General and PHP - (2010-04-24)
[2769] Easy - but for whom? - (2010-05-18)
[2878] Program for reliability and efficiency - do not duplicate, but rather share and re-use - (2010-07-19)
[2915] Looking up a value by key - associative arrays / Hashes / Dictionaries - (2010-08-11)
[2964] An introduction to file handling in programs - buffering, standard in and out, and file handles - (2010-09-21)
[3026] Coding efficiency - do not repeat yourself! - (2010-11-02)
[3456] Stepping stones - early coding, and writing re-usable code quickly - (2011-09-24)
[3542] What order are operations performed in, in a Perl expression? - (2011-12-07)
[3548] Dark mornings, dog update, and Python and Lua courses before Christmas - (2011-12-10)
[3551] Some terms used in programming (Biased towards Python) - (2011-12-12)
[3673] Object oriented or structured - a comparison in Python. Also writing clean regular expressions - (2012-03-26)
[3878] From Structured to Object Oriented Programming. - (2012-10-02)
[3928] Storing your intermediate data - what format should you you choose? - (2012-11-20)
[4003] Web and console - same principle, same code - Ruby example - (2013-02-14)
[4061] Seamless, integrated IT - we have a long way to go! - (2013-04-11)
[4090] Test Driven Development in Python - Customer Comes First - (2013-05-16)
[4118] We not only teach PHP and Python - we teach good PHP and Python Practice! - (2013-06-18)
[4153] Rooms available tonight - how to code an algorithm from first principles - (2013-08-19)
[4206] Writing the perfect program in Tcl? - (2013-11-13)
[4325] Learning to program - what are algorithms and design patterns? - (2014-11-22)
[4611] Hungarian, Camel, Snake and Kebab - variable naming conventions - (2016-01-03)
[4632] Remember to ask the question before you listen for the answer - (2016-01-26)
[4645] What are callbacks? Why use them? An example in Python - (2016-02-11)
Some other Articles
Testing classes for your PHP website with PHPUnitThe week before ChristmasZend / layout of MVC and other files in an example application (PHP)Building up from a small PHP setup to an enterprise one Lesson 1 in programing - write clean, reuseable and maintainable tidy codeObjects in PHP - Revision PHP revision ... by example. Christmas Bus Schedule for Melksham - First Bus10 reasons why I travel the night before a course startsMelksham Spa from Woolmore Farm