SGT Private RallyPoint Member1742873<div class="images-v2-count-0"></div>How often do you leave comments in your code?2016-07-23T10:16:38-04:00SGT Private RallyPoint Member1742873<div class="images-v2-count-0"></div>How often do you leave comments in your code?2016-07-23T10:16:38-04:002016-07-23T10:16:38-04:00SN Private RallyPoint Member1742878<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.Response by SN Private RallyPoint Member made Jul 23 at 2016 10:18 AM2016-07-23T10:18:46-04:002016-07-23T10:18:46-04:00Maj Private RallyPoint Member1742888<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"Response by Maj Private RallyPoint Member made Jul 23 at 2016 10:21 AM2016-07-23T10:21:46-04:002016-07-23T10:21:46-04:00LTC Private RallyPoint Member1744060<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.Response by LTC Private RallyPoint Member made Jul 23 at 2016 8:00 PM2016-07-23T20:00:45-04:002016-07-23T20:00:45-04:00Capt Daniel Goodman1744238<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.Response by Capt Daniel Goodman made Jul 23 at 2016 9:32 PM2016-07-23T21:32:05-04:002016-07-23T21:32:05-04:00SP5 David Cox1748524<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.Response by SP5 David Cox made Jul 25 at 2016 1:10 PM2016-07-25T13:10:04-04:002016-07-25T13:10:04-04:00TSgt Anthony White1753801<div class="images-v2-count-0"></div>I always doResponse by TSgt Anthony White made Jul 27 at 2016 5:39 AM2016-07-27T05:39:33-04:002016-07-27T05:39:33-04:00SGT Private RallyPoint Member2370773<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'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.Response by SGT Private RallyPoint Member made Feb 24 at 2017 9:35 PM2017-02-24T21:35:49-05:002017-02-24T21:35:49-05:002016-07-23T10:16:38-04:00