r/dailyprogrammer • u/Coder_d00d 1 3 • Aug 04 '14
[Weekly #5] Comment Blocks
Description:
We all have our own ways of commenting methods/functions. I always found it brings out the ASCII artist in all of us. So post your favorite Comment blocks.
For example I am pretty boring. I go for the asterix pac-man
/**************************************************
* functionName()
*
* inputs: (list what method takes if at all)
* outputs: (what does it output if at all)
*
* description: (what it does)
**************************************************/Last Weeks Topic:
[Weekly #4] (http://www.reddit.com/r/dailyprogrammer/comments/2byh4e/weekly_4_variable_names/)
34
Upvotes
View all comments
Show parent comment
5
u/NortySpock Aug 10 '14
In college someone taught me this abuse of C++ comments
...which is commented-out multiline comments. In this case, the compiler (gcc) will ignore the multiline comment and include the temporary code. Removing the single line comment // will enable the multiline comments and thus comment out the block.
Actually you only need to uncomment the multi-line comment opener -- the close still works despite being "commented out".
I've never done it often or outside of college though.