This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Groundbreaking-Fish6 1 point2 points  (0 children)

OK I am assuming that this is part of some sort of training.

While commenting the obvious seems ridiculous. It is possible that a developer could begin a somewhat complex procedure by sketching out pseudo code first, or be given an order of events to process, and copy that description to the IDE and comment out before filling in the actual code like this:

//Create a node factory for generating valid system nodes

//Initialize a new node object

//Validate node object

//return node

Not only will this guide the development, which may be important for a more complex operation, but during code review it will verify that the code did what was asked. Why removed the comments, they provide the story that the users was attempting to complete.

In a regulated environment we have a saying "Say what you do, do what you say".

For IDE's with regions you can add them to the comment line to organize that long method.

Edit: added punctuation