I download PHP applications, usually for one reason, to make my life easier. Applications are suppose to make the end user have the best experience, with a good architecture, even the developers won't find it difficult to write modules.
But libraries, usually are classes, should be a completely different story.
1. Libraries are design for developers, not end-users/users.
Review what end-user means.
2. Do nothing more than it should
Developers are not the kind of people seeking for ultra easy "can do all" library. For example, if I want a PHP library to write stylish text on images for GD, I really only need the library to write the stylish text, not load a image from a URL ,and I certainly don't want it to give me an option to put boarder around the entire image.
3. Break it apart
Small module design. Don't let one method use other optional method, but let the optional method use the essential method.
Again, using the imaginary write text on image library I mentioned before.
Suppose it have a API that read URLs and turn them into arguments for the text writing method.
The text writing method it's essential, it can run without the API, but strangely, the text writing method have a reference to the URL API method, now a developer who does not want the URL API are going to edit code instead of delete some code.
function writetext($image,'text'){
if($_SERVER['GET']){
//USE the URL API!!!
}
}
4. Efficient coding
Speed of libraries is THE KEY. No one like a library use lots of inefficient codes and slow the entire system down.
Be an Algorithmist, A person who studies algorithms.! Any reasonable reason of using the naive factorial function(recursively multiply and call self) instead of the Luschny Prime Factorization Swing for a factorial class (..why make a class for factorial?)
5. Comments and documentation
No one want to read the entire code to understand why is he reading and not write his own. Maybe this quote helps you
"Documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing."
--- Dick Brandon
Things below is just for FeedShow Revenue Sharing program, I will write about it later.
--[Subscribe FEEDSHOW Revenue sharing program]
provider=[Google]
uid=[pub-3197443558420570]
option=[5338430085]
--[Subscribe FEEDSHOW Revenue sharing program]
Recent comments
7 hours 8 min ago
14 hours 37 min ago
1 day 8 hours ago
1 day 17 hours ago
3 days 2 hours ago
4 days 6 hours ago
4 days 10 hours ago
4 days 10 hours ago
4 days 10 hours ago
5 days 2 hours ago