"I'm not back." - Bill Harding, Twister
Originally posted by Nick Way:
A truly trivial topic for my first post here
Originally posted by Mark Vender:
Personally, I have a theory that books always use the brace on the end in order to save pages (and thus money). As a result people get use to that style and then use it.
Books: Pragmatic Unit Testing in Java, Agile Java, Modern C++ Programming with TDD, Essential Java Style, Agile in a Flash. Contributor, Clean Code.
"I'm not back." - Bill Harding, Twister
Your theory has been confirmed by statements made by Brian Kernighan and Dennis Ritchie, whose little white book introduced the style. They personally used the brace-alone-on-a-line style but the end-of-line style made it easier to fit code samples on a single page without breaking them up, so it was used for the book. They were not proud of what they accomplished
Originally posted by Jim Yingst:
Interesting point, Jeff. Just to muddy the waters I'll note that dropping braces entirely (around a single statement) can produce the same effect. But this bothers many people. Oh well. I've long felt Python had the right idea about braces - we shouldn't need them at all for control structure. Unfortunately this idea hasn't caught on in any other languages I'm aware of. Too bad.
Books: Pragmatic Unit Testing in Java, Agile Java, Modern C++ Programming with TDD, Essential Java Style, Agile in a Flash. Contributor, Clean Code.
"I'm not back." - Bill Harding, Twister
42
Originally posted by Jim Yingst:
Also I'm very agressive about improving readability by refactoring long methods into smaller methods (with nice descriptive names), so there's often not a whole lot of need for additional subgrouping of code within a method.
No, tomorrow we rule the world! With this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|