Need various type of comments

Usually, my code has a lot commented lines.. ~60-90%..
Some of them ate tested working blocks. Others are unfinished ideas.. And also there are totally trash experiments I keep..

So, it would be nice to have different kind of comment slashes.. At least three..

Python IDE allows to solve that situation by adding extra comment symbols. My vscode allows only to toggle (on-off).

##    . . . 
##    . . . 
##    . . . 
####    . . . 
####    . . . 
####    . . . 
######    . . . 
######    . . . 
######    . . . 
######    . . . 
##########    . . . 
##########    . . . 
##########    . . . 
##########    . . . 

Well you can always have //, ///, //// etc. or /* ... */, /** ... **/, /*** ... ***/ etc..

These are doc comments.

1 Like

I think your issues are a bit orthogonal to actual source code comments and will be better handled by something like a notes.txt file in your project or just by using version control software (like git).

You have an idea for later, make an idea.md file in that directory.
You want to explore an idea, make a branch in git.

Don't leave commented out code in your code. When I read commented out code of myself or coworkers I never know what's the intent behind that code.

2 Likes

Is there in vscode a shortcut for for that? I can only 'comment - uncomment'. Adding manually each symbol looks like time-consuming

IDK, but you can always roll your own. This split of comment types is strange for me; I've never used it.

1 Like

Just want to point out the branches in git is a very good thing to get used to using. I used to comment out lines and even make filenames with "idea" added, 'rect.idea.c' . It just felt like the way to do it. Getting into git was hard. At first if felt like a big waste of time. Making a commit just to change something. But I forced myself to use it. Forced myself to use branches. Now it is easy and makes sense to use git. Commenting out lines and backup / experimental filenames just feel wrong. Disclaimer: I still comment out lines and make backup / test filenames.

3 Likes

Yes, the VSCode shortcut for it would be Ctrl + / for Windows and Cmd + / for Mac. If you really want to categorize your comments, what I would personally do is just use a special character or a symbol that represents it after the // line. For example, if I wanted to categorize two comment blocks, code that requires fixing and code that are placeholders, I would just do // FIXME and // PLACEHODLERS.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.