PCSX2 Documentation/Code Formatting Guidelines: Difference between revisions

Jump to navigation Jump to search
Line 38: Line 38:


===Example:===
===Example:===
  <code>// Not so good...
  <nowiki>// Not so good...
void DoSomething() { Function1(); Function2(); var += 1; }</code>
void DoSomething() { Function1(); Function2(); var += 1; }</code>


Line 45: Line 45:
     Function1(); Function2(); var += 1;
     Function1(); Function2(); var += 1;
}
}
</code>
</nowiki>


The reason for this guideline is that it can assist debugging tremendously. Most C++ debuggers cannot breakpoint function calls to the bad example, disabling a programmer's ability to use the debugger to quickly track the calling patterns for a function or conditional, and thus removing one of the most ideal tools available to a programmer for understanding code execution patterns of code written by another programmer. For these reasons, code written with such compounding may likely be unrolled onto multiple lines by another programer at any time, if that programmer is tasked with troubleshooting bugs in that code.
The reason for this guideline is that it can assist debugging tremendously. Most C++ debuggers cannot breakpoint function calls to the bad example, disabling a programmer's ability to use the debugger to quickly track the calling patterns for a function or conditional, and thus removing one of the most ideal tools available to a programmer for understanding code execution patterns of code written by another programmer. For these reasons, code written with such compounding may likely be unrolled onto multiple lines by another programer at any time, if that programmer is tasked with troubleshooting bugs in that code.
ninja
782

edits

Navigation menu