About 472,000 results
Open links in new tab
  1. maintainability - Mandatory use of braces - Stack Overflow

    Dec 16, 2009 · As part of a code standards document I wrote awhile back, I enforce "you must always use braces for loops and/or conditional code blocks, even (especially) if they're only …

  2. C Switch-case curly braces after every case - Stack Overflow

    May 29, 2015 · In a C switch-case flow control, it's required to put curly braces { } after a case if variables are being defined in that block. Is it bad practice to put curly braces after every case, …

  3. The Importance of Braces. Rule in .NET Projects using EditorConfig

    Jul 25, 2023 · In this article, we'll highlight the importance of using braces, and demonstrate how to enforce this rule as an error in .NET projects using EditorConfig. When developers omit …

  4. What's the purpose of using braces (i.e. - Stack Overflow

    Aug 30, 2012 · If your fast coder cannot be bothered to spot a syntax-highlighted return statement within the body of a function before adding something to it, you shouldn't let the fast coder get …

  5. Programmer's Ranch: Best Practices: To Always Use Braces for ...

    Sep 25, 2013 · If you want to add statements as part of the conditional, you know that there's just one statement and no braces, so adding them should be a pretty automatic response: if (x == …

  6. The Dangling If-Else Problem: A Common Pitfall in Programming

    Mar 15, 2024 · To avoid the dangling if-else problem, it is important to carefully structure your if-else statements and ensure that the conditions are properly defined. One way to avoid this …

  7. To Always Use Braces for Conditionals and Loops… or not

    Aug 20, 2015 · Braces (or curly brackets) are a feature in just about any programming language that uses the C-style syntax, including C, C++, Java, C#, JavaScript, PHP, and many others. …

  8. Types of Brackets in Coding: A Quick Reference Guide - StrobeCorp

    May 12, 2023 · Curly brackets, also known as braces, indicate the beginning and end of a code block. They are commonly in loops, functions, conditional statements, and object literals. For …

  9. When Are Braces Required for If/Else Statements in Programming?

    In programming, the use of braces (or curly brackets) in if/else statements can vary significantly between languages. While some languages allow optional braces for single-line statements, …

  10. Is it a bad practice to use an if-statement without curly braces?

    Jan 24, 2010 · Use braces for all if statements even the simple ones. Or, rewrite a simple if statement to use the ternary operator: if (someFlag) { someVar= 'someVal1'; } else { …

Refresh