News Feed
Jobs Feed
Sections




News Archive
Tim Koschuetzki's Blog:
Composing Methods Substitute Algorithmn
August 16, 2007 @ 08:26:00

Tim Koschuetzki has another in his "Composing Methods" series posted today - this one taking a look at something called the "substitute algorithm". It's a method of replacing content in a simpler way than using multiple ifs (as replaced by array functions).

Programming is such a dynamic action that you often find yourself having to replace an algorithmn all together. It will be much easier to do if the current algorithmn is an easy one already. [...] Make sure you decompose your algorithmns as much as you can and use many small methods for it.

His example replaces multiple if statements to search through an array with a simple in_array statement, returning the selected array index from there.

0 comments voice your opinion now!
method compose substitute algorithm replace search method compose substitute algorithm replace search


blog comments powered by Disqus

Similar Posts

LotsOfCode.com: Tag Cloud Tutorial

Ivo Jansch\'s Blog: What php search engine would you use?

The Bakery: Some ideas to organize your CSS files and autoload them in CakePHP

DevArticles: Creating the Front End of a Search Engine with AJAX

Community News: Finally, Phorum 5.2 has made it to stable!


Community Events











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


series phpunit framework application language interview tool unittest development functional podcast community release object opinion testing introduction zendframework2 example code

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