14 Comments
User's avatar
Kevin Hinners's avatar

Good advice. I've seen most of these, but had not seen the tip on "Use Is/Has/Should/Can Prefixes" with booleans. I'm experienced enough now to do that automatically, but it is good to see it spelled out regardless. It is certainly of benefit to learners.

Vinny's avatar

Great article: simple to understand and apply the recommendations next

Petar Ivanov's avatar

A simple but yet very effective tip. Great article, friend!

Daniel Moka's avatar

Thanks my friend!

Raul Junco's avatar

Returning early is one of my favorite tricks to reduce complexity!

Good compilation, Daniel.

Daniel Moka's avatar

Thanks my firend!

Bill Lennon's avatar

I'll echo what Vinny has already said - great job!

Ricardo Solon's avatar

Great content! :) and I’m checking the TDD course at the moment 😜

Bilal Ben Benyoussef's avatar

thank you bro for this article, clear and concise

Bilal Ben Benyoussef's avatar

thank you for this great article, clear and concise.

Saurabh Dashora's avatar

Some great tips my friend!

Robert Forsyth's avatar

Re Reduce Nesting with Early Return

Reducing if-then-else nesting is a good thing. The refactored code checks each parameter, in its own bit of code.

Structured Programming has single entry and single exit to code section, so one return statement at end.

If you want to place some debugging code/breakpoint before the return, there is only one place.

The other naming tips are useful to avoid the dreaded double negative