In my experience, the only (very) slight advantage of the first form is the readability of the code, the second form adds “noise”.
But with modern IDEs and code auto-generation (or autocompletion), I highly recommend using the second form, you won’t spend too much time typing curly braces, and you will avoid some of the most common mistakes.
There are enough energy-consuming mistakes; people simply do not open the door to the big waste of time.
One of the most important rules to keep in mind when writing code is consistency. Each line of code should be written the same, regardless of who wrote it. Strict error prevention from "occurring";)
This is the same as explicit and explicit designation of your variables, methods, files or their correct indentation ...
When my students accept this fact, they stop struggling with their own source code and begin to realize that coding is really interesting, stimulating, and creative. They challenge their mind, not their nerves!
thomas.g Jan 24 '10 at 0:09 2010-01-24 00:09
source share