Using functions is great
-
<font style="font-family: Courier New;" size="2">Today I reviewed the code maintained by our PHP programmers. I did notice that there are not so many function definitions in the code. Actually I found only 3 functions in some code written by a precious employee. All other repeating part of the code was copypaste. (e.g. connecting a database).
I told the programmers that this is not acceptable and they should use functions and create a common function library for everyday usage. They ended up with something like this in every PHP file:
<?php
dosomething();
function dosomething() {
// code
}</font>
-
Aww man....
-
Next step: objects and classes in PHP. Should be fun!
-
Point the Einsteins to http://www.php.net/manual/en/language.functions.php
-
@Zizzencs said:
<font style="font-family: Courier New;" size="2">...a precious employee...</font>
Obviously too valuable to keep...
-
I will not dare to try...