News Feed
Jobs Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Brandon Savage's Blog:
Peer Review Looking At Abstraction - Redux
September 02, 2009 @ 11:46:24

Brandon Savage has posted his latest part of his "Peer Review" series. He takesa step back and looks at abstraction again, this time incorporating some of the suggestions other members of the PHP community gave based on the previous version.

This entry will focus on our use of the database, and specifically on the already_tweeted() method. This method has a number of problems, and while we're focusing on the implementation of the database, it's important to note that we will also need to address some of the logic (which will be the next part of the series).

He looks at assumptions (how they can be bad), the use of an ORM layer to help negate some of the problems surrounding them and adding in some exceptions to properly handle issues that might come up.

0 comments voice your opinion now!
review abstraction orm assumption


Keith Casey's Blog:
Bad Assumptions in Development
June 19, 2009 @ 12:04:28

No one's code is perfect, and if you think yours is - you're wrong. There'll always be something - might be logic errors or unhandled exceptions - that could cause issues later on. One of the worst problems, at least according to Keith Casey's recent post, is making too many assumptions.

In my opinion, the most annoying and worst for cleaning up the system are the functions/methods that make too many assumptions for you. It could be a variety of things - assuming a database connection, assuming what the output destination is, or assuming what the input is - but I most often see it in scrubbing/cleaning functions.

His example is a function that not only assumes that the type of input is correct but also returns the value via an echo rather than a return (despite the name of the function implying the second). As a follow-up, he also suggests that libraries/external tools don't make assumptions when it comes to stopping execution of the script either.

2 comments voice your opinion now!
opinion development assumption



Community Events











Don't see your event here?
Let us know!


component package database install hhvm release podcast application security composer performance project symfony2 framework language facebook introduction example hack unittest

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework