Relative Content

Tag Archive for coding-standards

Preventing override of methods in Objective-C [closed]

It’s difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago. Objective-C lacks private methods or java-esque final methods. […]

Always pull out common cases and branch separately? [duplicate]

This question already has answers here: Style for control flow with validation checks (4 answers) Closed 11 years ago. We had a disagreement in a code review. What I had written: if(unimportantThing().isGood && previouslyCalculatedIndex != -1) { //Stuff } if(otherThing().isBad && previouslyCalculatedIndex != -1) { //Otherstuff } if(yetAnotherThing().isBad) { //Stuffystuff } The reviewer called that […]

coding style for If condition [duplicate]

This question already has answers here: if (‘constant’ == $variable) vs. if ($variable == ‘constant’) (5 answers) Closed 11 years ago. I came across below style of writing if statements in C#, on msdn code examples. Usually when I write if statements, the conditions I would write `(Customer != null) I want to know if […]