Jump to content

Commenting the code...


Sludge Vohaul

Recommended Posts

Sludge Vohaul

Hi,

this is somehow a never ending task, but don't you think it would be a good idea to annotate at least the public methods and properties with some sort of comments, to make documentation generation possible?

 

Though I haven't got anywhere deep into the code so far, I have already asked two or three questions on the forum, which would not have been necessary if there were more comments in the code. You guys answered them always nicely, but it's still a waste of your time.

 

Don't get me wrong, I am not proposing to comment all the existing code, but why not commenting the methods getting modified in the future? There could be a nightly job to generate a documentation in a separate repo (with sandcastle, or doxygen or the like).

 

I personally think it's worth it to start documenting a project just "now", as the documentation coverage will grow over time. And if some comments are not 100% accurate so what? Reading the code is it many times neither. Once set up, it's easier to have a look in Studio's help browser, than to go through the code (and at least sandcastle does a really good job in generating help files).

 

I could imagine people would start making pure comment-pull-requests, for things they just found out (at least I would) simply not to forget what the code in question was all about...

 

Just an idea...

 

--

sv

 

 

Link to comment
Share on other sites

Do summaries and other commented lines of code get stored in memory when the executable is run?

Would commenting code for an IDE mean a larger file size for downloading?

Link to comment
Share on other sites

Koleckai Silvestri

Do summaries and other commented lines of code get stored in memory when the executable is run?

Would commenting code for an IDE mean a larger file size for downloading?

 

Most comments should get discarded from the compiled result. 

 

Comments in Javascript, CSS and HTML will most likely persist.

Link to comment
Share on other sites

Yeah, if the source compiles into a different object, like .so or .dll, when it is compiled the assembly code created doesnt contain the comments too. Those comments will exist only in your source code.

 

If the source is run as a text file like qbasic, the comments are not byte compiled. The commands, reserved words, etc would be byte compiled to single or double-byte tokens. All scripting languages use interpreters/tokens and comments slow down the initial first byte-compile of each script. Once the script runs completely it will be faster the 2nd iteration because it can run the byte compiled code it created from the first run. Once byte compiled the comments no longer have an effect on the speed of the interpreters parser.

 

Comments should not affect the size of your download if they are in plaintext. You should be using gzip when downloading. This will deflate and compress with zlib before it sends to the client downloading who then inflates.

 

Sent from my Nexus 7 using Tapatalk

Edited by speechles
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...