How often do you leave comments in your code? https://www.rallypoint.com/answers/how-often-do-you-leave-comments-in-your-code <div class="images-v2-count-0"></div> Sat, 23 Jul 2016 10:16:38 -0400 How often do you leave comments in your code? https://www.rallypoint.com/answers/how-often-do-you-leave-comments-in-your-code <div class="images-v2-count-0"></div> SGT Private RallyPoint Member Sat, 23 Jul 2016 10:16:38 -0400 2016-07-23T10:16:38-04:00 Response by SN Private RallyPoint Member made Jul 23 at 2016 10:18 AM https://www.rallypoint.com/answers/how-often-do-you-leave-comments-in-your-code?n=1742878&urlhash=1742878 <div class="images-v2-count-0"></div>Not commenting lines/blocks of code is the worst thing a programmer can do. Comments are how you ensure your code lives on beyond you. SN Private RallyPoint Member Sat, 23 Jul 2016 10:18:46 -0400 2016-07-23T10:18:46-04:00 Response by Maj Private RallyPoint Member made Jul 23 at 2016 10:21 AM https://www.rallypoint.com/answers/how-often-do-you-leave-comments-in-your-code?n=1742888&urlhash=1742888 <div class="images-v2-count-0"></div>I comment lines all the time. Especially when I have a line of code that works and I don't know why. I like to put comments like "Abandon all hope Ye who edit this line" Maj Private RallyPoint Member Sat, 23 Jul 2016 10:21:46 -0400 2016-07-23T10:21:46-04:00 Response by LTC Private RallyPoint Member made Jul 23 at 2016 8:00 PM https://www.rallypoint.com/answers/how-often-do-you-leave-comments-in-your-code?n=1744060&urlhash=1744060 <div class="images-v2-count-0"></div><a class="dark-link bold-link" role="profile-hover" data-qtip-container="body" data-id="77973" data-source-page-controller="question_response_contents" href="/profiles/77973-25u-signal-support-systems-specialist">SGT Private RallyPoint Member</a> Always, I am a bit anal when I write code. I have always documented or over documented to help troubleshoot later if necessary. LTC Private RallyPoint Member Sat, 23 Jul 2016 20:00:45 -0400 2016-07-23T20:00:45-04:00 Response by Capt Daniel Goodman made Jul 23 at 2016 9:32 PM https://www.rallypoint.com/answers/how-often-do-you-leave-comments-in-your-code?n=1744238&urlhash=1744238 <div class="images-v2-count-0"></div>When I did it regularly, albeit not for quite some time now, especially since my disability, quite extensively, actually, I found doing so actually helped debugging considerably, of course, many thanks. Capt Daniel Goodman Sat, 23 Jul 2016 21:32:05 -0400 2016-07-23T21:32:05-04:00 Response by SP5 David Cox made Jul 25 at 2016 1:10 PM https://www.rallypoint.com/answers/how-often-do-you-leave-comments-in-your-code?n=1748524&urlhash=1748524 <div class="images-v2-count-0"></div>I once had to write some fairly intricate code to do some bit-twiddling in a time-sensitive section of code. I first wrote it in the higher-level language (CMS-2Y, a Navy language, but this was for an Army system - long story) That language had a feature that allowed you to embed assembly code directly in the middle of a routine, so I took the compiled code and manually optimized it - cut the execution time down by about 50%. so totally worth it. Because it was unusual and did involve a lot of shortcuts to get the needed speed, I made sure to comment it extensively. The code was ALL IN CAPS, so I used standard capitalization to make the comments stand out clearly. It was beautiful, stood out as desired, and clearly explained what was going on. A couple of years later I got approached to support that system in the field, so I packed up and went to Germany. We had hard copy of all the code, and when I flipped it open to that routine, I was dismayed to find 99% of my comments missing! Only the capital letter at the start of each sentence remained. At some point, the code had been sent through a system that only supported uppercase. I did find that the ascii codes were still in memory, so I could reconstruct the comments if needed, but it was still upsetting. SP5 David Cox Mon, 25 Jul 2016 13:10:04 -0400 2016-07-25T13:10:04-04:00 Response by TSgt Anthony White made Jul 27 at 2016 5:39 AM https://www.rallypoint.com/answers/how-often-do-you-leave-comments-in-your-code?n=1753801&urlhash=1753801 <div class="images-v2-count-0"></div>I always do TSgt Anthony White Wed, 27 Jul 2016 05:39:33 -0400 2016-07-27T05:39:33-04:00 Response by SGT Private RallyPoint Member made Feb 24 at 2017 9:35 PM https://www.rallypoint.com/answers/how-often-do-you-leave-comments-in-your-code?n=2370773&urlhash=2370773 <div class="images-v2-count-0"></div>I leave comments to point out the non-obvious. The amount of commenting that was required by my instructors in school turns out to be considered a bit annoying and verbose in industry. Most of my fellow developers are pretty good at reading legacy code (it&#39;s what we spend most of our time doing, actually). However, sometimes your code does something that other developers need to know before modifying (such as logic that might seem wrong or inefficient but was done that way for a good reason). Also, it can necessary to point a developer to other parts of the code base. SGT Private RallyPoint Member Fri, 24 Feb 2017 21:35:49 -0500 2017-02-24T21:35:49-05:00 2016-07-23T10:16:38-04:00