News for hackers. Stuff that matters.
Re:IF-less programming by alisnic on Friday December 28, 2012 @07:49AM (#4977481)
> "ifs are a smelly thing in a Object Oriented language."

It is partially my fault because I failed to express what I really ment. English not my native, so sorry.

What I really ment in this sentece is "why using (a lot of) ifs can be a bad practice in a Object Oriented language"

Re:IF-less programming by raverbashing on Friday December 28, 2012 @07:51AM (#4977486)
Ok, with that I can agree.

Or maybe better: how can ifs be replaced (sometimes) using OO principles

Re:IF-less programming by jeremiep on Friday December 28, 2012 @08:53AM (#4977650)
My take on why ifs are "bad" is that they are statements, just like for, while, switch and others. Being statements they can't be composed as you would do with expressions.
Re:IF-less programming by dragonwriter on Friday December 28, 2012 @12:38PM (#4978539)
That's not universally true; there are languages where if is an expression rather than a statement (e.g., Ruby.)
Re:IF-less programming by ufo on Friday December 28, 2012 @01:21PM (#4978761)
Most languages have a ternary if operator like (?:). I don't see how this is such a big issue.