News Feed
Sections




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

David Gardner's Blog:
Why you should always use PHP interfaces
November 25, 2010 @ 11:46:37

David Gardner has a suggestion for your development that he thinks can help keep things neat and tidy - using interfaces.

This post was sparked by a very simple question from an ex-colleague: "Why bother with PHP interfaces?" The subtext here was that the classes themselves contain the interface definition (through the methods they define) and hence interfaces are not needed, particularly where there is only one class that implements a given interface.

He talks about two reasons he things that interfaces could be beneficial - they help you think about things "the right way" of planning out structure before implementation and that it makes things more "future proof" the code by forcing future elements into the same mold as the current use.

0 comments voice your opinion now!
interface opinion structure design planning futureproof


blog comments powered by Disqus

Similar Posts

Lukas Smith's Blog: Stop building gold on top of crap

Smashing Magazine: Upcoming Conferences and Events for Designers and Developers in 2011

Kevin Schroeder's Blog: How chickens and programming are kind of related

Richard Thomas' Blog: ZF please before you go 2.0 gunho please clean out the attic

Larry Garfield's Blog: PHP project structure survey


Community Events

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


list example laravel language composer podcast introduction opinion series application api part2 community project interview voicesoftheelephpant symfony yii2 php7 framework

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