Small trick: the beauty of Auto Format.

Just a small trick for users of the Arduino IDE:
Before compiling an intesnsively changed code, go to Tools and start Auto Format.

I will not only automatically indent your code in a pretty mood, but you can rely on that:

if the indent ist not as expected

you have great chances to have got a syntax error in the lines before!

Check them thoroughly and you will save a lot of time in avoiding compiler errors.

Even easier, use CTRL and T to Auto Format the code. No need to select anything from the menu

You can also change the action of the Auto Format to suit your requirements. See formatter.conf in the same folder as your preferences.txt file