Ghidra: Add option to put opening braces on new line

Created on 7 Mar 2019  路  3Comments  路  Source: NationalSecurityAgency/ghidra

The 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.

Decompiler Enhancement

Most helpful comment

Dear GOD, YES please!

if(end_of_line_braces) {
    do_stuff();
}

Is absolutely horrible for readability. At a quick glance, it looks like there is no starting brace at all.

All 3 comments

Dear GOD, YES please!

if(end_of_line_braces) {
    do_stuff();
}

Is absolutely horrible for readability. At a quick glance, it looks like there is no starting brace at all.

Has this been implemented yet?

No, it has not.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

niedabao1 picture niedabao1  路  23Comments

lab313ru picture lab313ru  路  16Comments

woachk picture woachk  路  33Comments

tzizi picture tzizi  路  17Comments

mumbel picture mumbel  路  29Comments