Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • I generally prefer this also, for the reason stated here. However, I usually place a comment at the close of each if block of } //else to make it clear, when reading the code, that the only intended execution after the if code block is if the condition in the if statement was false. Without something like this, particularly if the code within the if block grows to be more complex, it may not be clear to whoever is maintaining the code that the intent was to never execute past the if block when the if condition is true. Commented Dec 10, 2016 at 22:01
  • @Makyen you raise a good point. One I was trying to ignore. I also believe something should be done after the if to make it clear that this section of code is done and the structure is finished. To do this I do what I haven't done here (because I didn't want to distract from the OP's main point by making other changes). I do the simplest thing I can that achieves all that without being distracting. I add a blank line. Commented Dec 10, 2016 at 22:21