Lightweight Documentation
By admin • Apr 30th, 2008 • Category: 1.3. Good Practice CodingThis article explains the importance of lightweight documentation.
Mark’s SiteCoding and golf …it’s hard being me :-)
|
|
This article explains the importance of lightweight documentation.
My preferred approach to any moderately sized system is a modular, or component based approach.
A useful class I picked up somewhere, and possibly modified in the years since, that handles the work of file uploads. I’ve found it very useful, so hopefully you will to.
I try to use a central database class in my code, simply because if I ever need to migrate from MySQL to another database engine (such as Microsoft SQL or Postgres), all I have to do is alter the one database class file and my application is all converted. Since everything goes through the database class, it’s the only file you need to change in such an instance.
I find it’s always useful to keep this functionality in a function. This example relies on some global variables …pretty easy to understand.
Need to get a list of files from a folder on your server? Maybe it’s a list of photos that you want to manipulate with PHP, this function will grab all files from a specified directory and return them in an array for you.
Something I struggled to find when starting out was good, non standard encryption and decryption functions. Here’s a couple for you to use/adapt as you wish.
In light of all the advantages, you should also be aware of the problems with PHP.
If you’re new to web development, it helps to know why you would choose PHP over another language. This article will help to show you the advantages of php, why php rules, why dot net sucks, and some things I’ve learned along the road to becoming a web developer.
So you probably know that for a given SQL user, you can specify what permissions the user can have, such as CREATE, DROP, INSERT, UPDATE, DELETE etc. But are you one of those people that just sets up a general user with S/I/U/D permissions and leaves it at that?