Here’s the Deal
Slant is powered by a community that helps you make informed decisions. Tell us what you’re passionate about to get your personalized feed and help others.
The block of code itself is disconnected from the control statement which allows developers to comment out or remove entirely a control statement without having a large risk of encountering syntax errors because of extra or missing braces. See More
The K&R style uses braces only when necessary. So for example: if(condition) doSomething(); But this can be annoying if you need to put something inside that if statement, because you have to go and add braces to make sure that will be grouped correctly with the statement that was before. See More
With this style, one of the advantages is that the opening brace does not take a whole line for itself, wasting a lot of space. The closing brace though is indented on the same level as the control statement it belongs to, making it easier to understand which block of code it's closing. See More
Help millions of people make better decisions.
Each month, over 2.8 million people use Slant to find the best products and share their knowledge. Pick the tags you’re passionate about to get a personalized feed and begin contributing your knowledge.