General changes to help improve ability to compare decompiled code quality between DS and UMT
Which component should be improved?
Decompiler
Describe your feature suggestion in more detail
- Toggleable option of whether semicolons are placed at the end of lines of code would help with comparing decompilation quality.
- Add the final blank line on all decompiled code entries in DS.
- Always wrap the condition of an if statement with parentheses, even if it's only one condition
3a. (ex.
if __b__becomesif (__b__)).
The blank line at the end of files is standard for a lot of things. It's good to have a terminator newline when files end, so programs that read code don't mess up, and if you concatenate two files together, it's much nicer that they have newlines at the end. I'm pretty sure git even warns you if you don't have one. Personally, I think the 2nd point should be changed to, make DS add a final blank line.
The blank line at the end of files is standard for a lot of things. It's good to have a terminator newline when files end, so programs that read code don't mess up, and if you concatenate two files together, it's much nicer that they have newlines at the end. I'm pretty sure
giteven warns you if you don't have one. Personally, I think the 2nd point should be changed to, make DS add a final blank line.
Sounds good to me.
Agree with this.
+1, I'd like to add a suggestion from #785:
Make all if() statements use { ... } instead of 2-line ifs that don't use curly braces
Eg rather than this:
if (something == true)
do_stuff()
It would be this:
if (something == true) {
do_stuff()
}
IME this approach makes refactoring code a lot easier, and IMO makes the code easier to read
In #785 I also proposed using the c# style of brackets on newlines, as well as adding space below them, screenshot is in this comment.
All suggested as an option, if that's possible, so users have a choice depending on their preferred style