DEV Community

Discussion on: Coding practices your future self will love you for

Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

Great tips! I can attest to all of these.

I strongly agree with your statement about not following DRY blindly. I'd extend that out to any methodology or practice.

Additionally, I use commenting showing intent to leave my specification and intent inline in the actual code. The result is that, no matter how long I'm away from the code, I can always pick back up my thought processes where I left off; meanwhile, anyone else reading my code can pick up not just what I'm doing (which should be self-evident from the code itself), but why I'm doing it.

Collapse
 
poncianodiego profile image
Diego Ponciano

Loved CSI! Thanks for sharing.

Collapse
 
mohanarpit profile image
Arpit Mohan

I didn't know about CSI. Thank you so much for a pointer to the article. #TIL

Being able to re-create the program in any other language using just the comments is a great north-star to have; obviously really hard to follow (especially in the beginning)

Collapse
 
codemouse92 profile image
Jason C. McDonald

Glad you find it helpful! I should have also included the link to my article about how it works in practice.

Collapse
 
peledzohar profile image
Zohar Peled

I can't agree with you more! About two year ago I had to re-write an implementation of am algorithm I wrote 7 years earlier. Lucky me, I originally commented everything that the customer needed right next to the specific part of the code that did it. Saved me days. Literally days of work.