November 2024
Intermediate to advanced
300 pages
7h 12m
English
This book’s code exhibits my preferred programming style and formatting for Java, tempered also with a need to keep code listings brief. Many of you will be offended by my elimination of “safety braces” around single-line conditional blocks:
| | if (condition) doSomething(); |
It gets rid of a line in the code listing.
In most cases, the if body fits onto a single line, as demonstrated.
I find it reads better as a singular concept.
If you ever need a second statement in the conditional body, you’ll likely remember to add the safety braces.
If you forget…that’s why you write unit tests.
If you’re unswayed, feel free to add braces. Try without, though—you might like it.
Read now
Unlock full access