:: krowemoh

Friday | 27 DEC 2024
Posts Links Other About Now

previous
next

Comments in Programming

2023-05-30
programming, nightmares

A hot take.

If you need comments in your code then things might be too complex and you can probably rewrite things to make clearer. In my own code I find this to be true more often than not. I have one specific place that I have a comment and I can tell something is wrong with the code but I still haven't figured out an elegant way to deal with it.

That comment haunts me.

*********************  S U B R O U T I N E  *********************
*
* UPDATE LINE GIVEN A REAL.LINE.NUMBER
*
* 1. GET ALL LINES THAT BELONG TO REAL.LINE.NUMBER
* 2. DELETE THEM
* 3. CHUNK THE RAW.LINE
* 4. INSERT THEM BACK INTO LINES
*

It is as simple and as clear as I could make it but the fact that it's there means that I don't understand it enough. This is a comment in my EVA editor that deals with updating a line.