|
Posted by Steve on 11/01/06 19:08
| Yep I understand it now! Thank you for explanation, it's much
appreciated.
| This is like when learnt to surf in my teens, lol very painfully and
slowly.
| So tell me, when you first started learning php, how many times did you
| rebuild that site after you learnt a better way of doing something? ;-0
one is always rebuilding sites - usually, to add or correct functionality.
however, i find new ways of doing things all the time. what is important is
to catalog reusable code so that implementing the change is more easily
done. reusable code is either in the form of a function, or a class object,
or a template. each of these is a rung in a ladder that when built, give you
great architecture that is easily managed and updated.
what it comes down to these days, for me, is that i rarely rebuild functions
and only add new functionality to classes. i modify templates all the time
as they are how all of that logic get translated to user-viewed output -
which changes daily it seems sometimes! but as it is, i'd rather spend more
of my time on formatting output than validating and processing input.
| Talk about learning curve, I'll have the bl**dy arc at this rate!
well, here's the good news...try prototyping your functionality in clipped
english - psuedo-code. make up function names and parameters like
stringLength($string). after you have it "englished", use php and/or google
on the made up functions by searching on what you intended that they do. in
this case, google "php string length"...you'll see quickly that a function
exists for MOST of the things you want to do. and, this way, you're just
plopping the correct php function name over your made up one using your
editor's replace feature...stringLength becomes str_len.
two important things will happen. you will quickly remember what the real
function names are. and, most importantly, you will have already produced
your code based on what you wanted to happen in it...rather than bending
what you want to do *limited* by what you know php can do. finally, for the
functions you cannot find either on php.net (who has a downloadable .chm
help file) or google, you have but to create said function.
btw, this is very similar to "extreme programming" (gay as hell name!)
techniques used in sound software design.
see! you're already ahead of the game!
[Back to original message]
|