New Technique to Commenting

Trent Schake
2 min readJun 13, 2023

I was staying over at my cousins house with her my friend her step-cousin, as well as her good friend. My energy was very active that day, whilst causing my brain to come up with rapid ideologies.

I spent a total of about four hours reading SAMS Teach Yourself C++ Everyday for an Hour. I already memorized a decent amount of the syntax. I started to see source code within my minds eye, which is very advantageous as I am planning to be a systems programmer.

While I was tinkering around (before I got very exhausted): I was tinkering around with different areas of C++ programming. Including: polymorphism, classes, data members, etc. I started writing a general template for a brutforcing algorithm to set the scope before I learn about mutli-threading programming with CUDA. All of the sudden I came up with an interesting way that I haven’t seen any programmers that I know use within comments.

Imagine writing a large program such as a host intrusion detection system. Whilst this having multiple header files, as well as multiple libraries such as winsock.h (if you are using the windows socket api “winsock”, and not the Linux or Unix sockets library). You are going to want to keep track of where everything is. This is what I called line based commenting comes into play.

Please do be aware I do not know if anyone has come up with this, or has been used. To my knowledge I have seen nothing of the sort.

Imagine we are troubleshooting/debugging a piece of code with a compiler issue that states LINE 239 DEFINITION NOT DECLARED (An example of a psuedo compiler error). You are calling a reference or a pointer, but you don’t know where that is defined within the program, not the line where it is defined at.

Take this code for example

#include <iostream>
typedef unsinged short int USHORT;
using namespace std;

int main()
{

USHORT foo;
foo = 0;

for (foo = 0;foo > 5; foo++)
{
cout << foo;

}

return 0;

}

Imagine having thousands of lines of this, with definitions of variables, functions, pointers, etc. You are going to want to know where they are first defined to keep track of them. This is where I thought of “Line Based Commenting”.

An example of LBC commenting:

// Defining a class that is used for storing ip addresses on line 23

Another example:

/*
Declaring a variable on line 50
This Variable stores user input then passes it to function foo on line 67
*/

These are examples of Line Based Commenting.

Like I stated very briefly in the beginning this could be used for very large programs containing both multiple header files, functions, pointers, etc.

--

--

Trent Schake
0 Followers

INFJ | Researcher | PC-Gamer | Transhumanist | Programmer | Big-Box Pc-Game collector | Bio-Hacker | Neuro-Hacker | Pantheist