[IDE] Better handling commenting/uncommenting comments

Missing or incomplete OpenText Gupta product features? Discuss it here!
Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3447
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

[IDE] Better handling commenting/uncommenting comments

Post by Dave Rabelink » 27 Dec 2010, 09:39

Well this one bothers me since I'm working with the TD IDE.

It is about when commenting/uncommenting code which contains comments.
And I'm hoping this behavior can be improved.

See this situation in the sourcecode:
InternalFunctions.gif
It has a ! between FunctionC and FunctionD with no further text behind it (so just used as a separator).
Between FunctionF and FunctionG there is a separator having text (to indicate the following lines of code have some meaning).
The same applies to the line after FunctionI.
The functions J to L are commented functions.

Now select the complete internal functions section (so click on FunctionA, press and hold shift and click on FunctionL).
InternalFunctionsSelection.gif
Comment it:
InternalFunctionsCommented.gif

And now, select the complete section again and try to uncomment it.
It will give this error:
UncommentError.gif

This is very inconvenient. This means I have to select all functions to uncomment manually and skip the comments.
For large sections this is time consuming.

But this need not to be if the comment/uncomment functionality would be a bit more clever.

I imagine this system:

When commenting multiple lines, the actual lines of code get a ! in front. Like it is now.
But when a commented line is encountered, the line will get also a ! in front. So a double !!.
This will look like this:
NewCommented.gif
Now this way of commenting comments has a great advantage. You can actually see which lines are commented comments.
The functions J to L were originally commented, so a double comment will show that. This can not be seen in the 3rd picture in this post.
You are not able to distinct between functions which are commented and not commented at the time the section was commented.

So a double !! will indicate the line is originally commented and when uncommenting, the single comment ! will be placed back.

Funny thing is, the uncommenting of the situation which I have created manually in the last screenshot actually works.
When uncommenting the section, no error is displayed and all lines are restored to the situation before the commenting.

So the only thing to do is putting an extra ! on commented lines to create a double comment.

The system should also limit it to a double comment.
So when commenting an already double commented line, it should NOT add a !. So the comments will only have a single or double !.

Can anyone else see this as a more clever way to handle comments?

Below the testcase. It contains the situation with double !!. Just uncomment it to see it actually works.
Uncomment_Comment.zip
You do not have the required permissions to view the files attached to this post.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Uwe van der Horst
Site Admin
Site Admin
Germany
Posts: 617
Joined: 05 Mar 2017, 14:21
Location: Wetter (Ruhr), Germany

Re: [IDE] Better handling commenting/uncommenting comments

Post by Uwe van der Horst » 27 Dec 2010, 17:04

+1
Best regards,
Uwe van der Horst
stp.one

Igor Ivanovic
Site Admin
Site Admin
Croatia
Posts: 1462
Joined: 05 Mar 2017, 12:37
Location: Zagreb, Croatia

Re: [IDE] Better handling commenting/uncommenting comments

Post by Igor Ivanovic » 28 Dec 2010, 12:56

+1
Igor Ivanovic
Image

Return to “Enhancement suggestions”

Who is online

Users browsing this forum: [Ccbot] and 0 guests