As our favorite imperative languages gain functional constructs, should loops be considered a code s

Posted by Michael Buen on Stack Overflow See other posts from Stack Overflow or by Michael Buen
Published on 2009-01-11T06:03:49Z Indexed on 2010/05/05 12:28 UTC
Read the original article Hit count: 329

In allusion to Dare Obasanjo's impressions on Map, Reduce, Filter (Functional Programming in C# 3.0: How Map/Reduce/Filter can Rock your World) "With these three building blocks, you could replace the majority of the procedural for loops in your application with a single line of code. C# 3.0 doesn't just stop there."

Should we increasingly use them instead of loops? And should be having loops(instead of those three building blocks of data manipulation) be one of the metrics for coding horrors on code reviews? And why?

[NOTE] I'm not advocating fully functional programming on those codes that could be simply translated to loops(e.g. tail recursions)

Asking for politer term. Considering that the phrase "code smell" is not so diplomatic, I posted another question http://stackoverflow.com/questions/432492/whats-the-politer-word-for-code-smell about the right word for "code smell", er.. utterly bad code. Should that phrase have a place in our programming parlance?

© Stack Overflow or respective owner

Related posts about language-agnostic

Related posts about programming-styles