In several examples you have this

if (condition1 && condition2)

This is basically two statements on one line, which is always bad. Most people will do this:

if (condition1 && 

which stinks, requiring the reader to hold the logical operator in mind as he moves his eyes to the next line and condition.

Do this:

if (condition1 
&& condition2)

This shows that the logical operator is at the same level as the if and the extra space for vertical alignment enhances legibility.

The great majority of code in our industry is close to completely illegible; jagged, cluttered, no consideration for the reader.

American Software Developer living in Vietnam. Classical musician (guitar, woodwinds), weightlifter, multilingual, misanthrope • XY

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store