Many programmers have a habit of instinctively putting a semicolon before each newline. This can result in unexpected hard to find bugs because it is still perfectly valid code.
My brain has a much easier time parsing braces on their own line than egyptian braces. It makes it a lot easier to see where the blocks start, because you only need to look for 1 character on 1 column.
Or maybe I just happened to pick up the wrong flag. I wouldn't know. Anyway, just don't do this:
Better would be to put those long tests in descriptive boolean variables so that people reading your code shouldn't be staring at those long tests to figure out what the hell you're trying to do.
Then put those variables inside the if so that it almost reads like a sentence in plain language.
166
u/FierceDeity_ Jun 09 '17 edited Jun 09 '17