2021年1月1日星期五

Adding comments to code in legacy apps/code at company in industry?

I am a junior software engineer at a company in the USA. And as many as you engineers know, many times I run into heavily undocumented code, with little to no/zero comments (I mostly code in Java).

Now, I know you might say the logical response of "well, comment the code then dude!", which I have done before, but something I have noticed is that the entire codebase is uncommented, so it looks "weird" having a few commented methods and such out of the blue. It would probably take many more hours or sometimes I simply lack the information on the "grand" scale of how the application or system operates, so I would not be able to comment the entire codebase or functionality.

I wanted to ask you fellow software engineers who also have uncommented/undocumented legacy applications and work in industry if:

  1. I should be fixing and commenting the entire codebase when I work on defects/bugs and new features
  2. Leave it alone since its a legacy application and follow the pattern that was set before (no comments)
  3. Comment individual pieces as I work on the application over time
  4. Are simple comments like // this is a comment preferred or java-doc style comments? (below):
     /**       *        * @param the four byte rgb pixel value from image       * @return the bitwise AND of the rgb value and a bitmask       */  

Thank you!

https://stackoverflow.com/questions/65535126/adding-comments-to-code-in-legacy-apps-code-at-company-in-industry January 02, 2021 at 08:55AM

没有评论:

发表评论