News for hackers. Stuff that matters.
Re:If... by nametoremember on Friday April 29, 2011 @05:44AM (#2496863)
"And the second kind tests something that some other part of the system already knows. Let’s ban the second kind…"

Can you give an example?

Re:If... by kevinrutherford on Friday April 29, 2011 @12:10PM (#2497856)
Imagine a method with this outline:

File createFile(String name, boolean istemp) { if (istemp) // do temp stuff else // do regular file stuff }

That's an 'if' statement that only exists as a response to the boolean parameter. We can remove the 'if' by having two methods instead:

File createFile(String name) File createTempFile(String name)