Add option to put opening braces on new line
See original GitHub issueThe location of braces seems to be an eternal debate among programmers. We have
// I don't like this
if(end_of_line_braces) {
do_stuff();
}
// I do like this
if(own_line_braces)
{
do_more_stuff();
}
// Weirdness work makes me use
if(indented_braces)
{
do_even_more_stuff();
}
Why not make braces configurable to the user’s preference? I looked through the decompiler options and it already has quite a few settings the user can configure (indentation, comment style, etc). This is one more quality of life change I think would be nice to have.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:30
- Comments:5
Top Results From Across the Web
How do I set up VSCode to put curly braces on a new line?
Go to File\Preferences\Settings · Add the following lines in 'User Settings' (in the right side pane) "javascript.format.placeOpenBraceOnNewLineForControlBlocks" ...
Read more >coding style - Should curly braces appear on their own line?
When I was a student I used to put curly braces on the same line, so that there are fewer lines, and the...
Read more >How to force braces onto the next line
It's broken down by "class", "method", and "other" in the formatter settings. ... and it's listed under "Braces Placement", you want "Next line"....
Read more >Where Do Curly Braces Belong? - Jeremy Bytes
Option two is to put the curly braces on a separate line. Here's a sample: Each of these styles has its pros and...
Read more >C# formatting options - .NET - Microsoft Learn
The new-line options concern the use of new lines to format code. ... Option values, true, Insert space before opening square brackets [....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Dear GOD, YES please!
Is absolutely horrible for readability. At a quick glance, it looks like there is no starting brace at all.
Also, maybe add a comment indicating the nesting/block depth on both opening and closing braces. I.e.:
It would help when blocks are large.