View Single Post
  #19   Spotlight this post!  
Unread 24-02-2016, 13:04
cjl2625's Avatar
cjl2625 cjl2625 is offline
apel py
AKA: Cory Lynch
FRC #2067 (Apple Pi)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Guilford, CT
Posts: 412
cjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to behold
Re: Thoughts On Comments In Team Code

I add comments when it isn't totally clear what a piece of code is doing.
For that tank drive example, I wouldn't have any comments (aside from the negating one side thing, perhaps), since that code is pretty self-explanatory. Comments there seem redundant.

When there's too many comments, I find it bothersome and intrusive.

For single lines whose functions are unclear or confusing, it's worth a comment, but sometimes I neglect to do that (which is a bad habit of laziness).
And perhaps before each method or section of code, I'll sometimes add a line of explanation.

I suppose I'm guilty of sometimes being too cryptic in variable names and documenting my code poorly. Since I basically wrote all the team's code for the past 4 years, I've been able to get away with it, but it's a habit I should break.
__________________
Head Programmer / Driver

Last edited by cjl2625 : 24-02-2016 at 13:09.