Last active
March 10, 2016 01:58
-
-
Save fossil12/d6e367b49df866b920b0 to your computer and use it in GitHub Desktop.
How do you comment on if/else clauses in C (Objective-C, ...)?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Variant 1 | |
*/ | |
if (cond) { | |
// Description of condition holding in if | |
// code... | |
} else { | |
// Description of condition holding in else | |
// code... | |
} | |
/* | |
* Variant 2 | |
*/ | |
// Description of condition holding in if | |
if (cond) { | |
// code ... | |
// Description of condition holding in else | |
} else { | |
// code ... | |
} | |
/* | |
* Variant 3 | |
*/ | |
// Description of condition holding in if | |
if (cond) { | |
// code ... | |
} else { // Description of condition holding in else | |
// code ... | |
} | |
/* | |
* Variant 4 | |
*/ | |
if (cond) { // Description of condition holding in if | |
// code ... | |
} else { // Description of condition holding in else | |
// code ... | |
} | |
/* | |
* Variant 5? | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment