continued best-practices for newbies
Posted: Thu Apr 08, 2004 12:05 pm
i think i lost my original audience on my "best resources to learn php" thread, but i still welcome continuing comments... i forgot to mention in my original list of bad practices how non-seperated my logic is from my presentation. heck, in places, i can go into and out of php four times in one line
so...
let's say a guy realizes he has learned many bad programming practices, like the ones at http://www.calvinmitcham.com/golf.
he signs up for free hosting space at dotgeek, just to re-do his application (golf league records / membership), and open it up for others to have/help. he hopes to discipline himself to learn and use at least:
db abstraction;
seperate logic from presentation;
security / user login authentication;
threaded comments/news on home page;
templates;
well first, he tries to read about db abstraction. he starts to see alot about pear, and that really sounds good, like a standard one set of libraries he can grab and learn. but it's not long before he sees several other abstraction classes with large followings. maybe pear is not the best way... but he decides to ignore others, and focus on pear.
quickly, he finds ther are two abstaraction classes; db, and mdb. how does he decide which one to use? he notices an authentication section, and checks there. again, two classes to choose from.
he turns his studies (i hated school and swore i'd never go back, this is hell) to the template engine. again several choices, but decides to plow on with smartie. this opens up a whale of an argument just on whether to use a template class or not!
he thinks (for the billionth time) about writing classes himself; not to re-invent pear stuff, but to handle the application specific stuff. although i understand that all bicycles have handlebars and wheels (the typical example), the whole oop thing hasn't clicked for me yet. i do put functions in included files for anything i find myself needing more than a couple of times, but i don't see how to make that leap to oop programming.
this re-learning exercise seems not so easy.
so...
let's say a guy realizes he has learned many bad programming practices, like the ones at http://www.calvinmitcham.com/golf.
he signs up for free hosting space at dotgeek, just to re-do his application (golf league records / membership), and open it up for others to have/help. he hopes to discipline himself to learn and use at least:
db abstraction;
seperate logic from presentation;
security / user login authentication;
threaded comments/news on home page;
templates;
well first, he tries to read about db abstraction. he starts to see alot about pear, and that really sounds good, like a standard one set of libraries he can grab and learn. but it's not long before he sees several other abstraction classes with large followings. maybe pear is not the best way... but he decides to ignore others, and focus on pear.
quickly, he finds ther are two abstaraction classes; db, and mdb. how does he decide which one to use? he notices an authentication section, and checks there. again, two classes to choose from.
he turns his studies (i hated school and swore i'd never go back, this is hell) to the template engine. again several choices, but decides to plow on with smartie. this opens up a whale of an argument just on whether to use a template class or not!
he thinks (for the billionth time) about writing classes himself; not to re-invent pear stuff, but to handle the application specific stuff. although i understand that all bicycles have handlebars and wheels (the typical example), the whole oop thing hasn't clicked for me yet. i do put functions in included files for anything i find myself needing more than a couple of times, but i don't see how to make that leap to oop programming.
this re-learning exercise seems not so easy.