I think all programmers have their own stylistic choices. All programmers working on software read by other people will know to keep their own opinions in check and to adapt a popular formatting scheme for the languages given. So with that in mind I don’t recommend the following as more than food for thought, or possibly as something to adapt for personal projects.
When learning scala I picked up on some stylistic choices in that language that make it valuable to often have multiple block-level statements on a single like:
This contains what would be a nested loop and a switch in C-like languages. I started toying with this idea in C++ and think that it adds some terseness and clarity. Here’s a real world example:
This would normally be written as something like the following:
In languages with a for..in style construct the original scala code can be written as something along the lines of:
The difference is farly trivial in the grand scheme of things, and I would actually recommend not using it on projects worked on by more than one developer. For my individual tastes however this fairly novel nested block formatting improves readability and clarity of intent.