Comment

Comment by kevinrutherford

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)

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton