News Feed
Sections




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

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


blog comments powered by Disqus

Similar Posts

Lorna Mitchell's Blog: Preparing for ZCE 5.3

Davey Shafik\'s Blog: php|tek Day 2

Test.ical.ly Blog: Is forking symfony 1.5 really a realistic option?

Nikita Popov's Blog: A plea for less (XML) configuration files

Stefan Koopmanschap's Blog: What PHP needs (well, what I think it needs)


Community Events

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


language introduction example voicesoftheelephpant release laravel library security php7 list series opinion podcast version laravel5 api interview extension framework community

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