TLDR: The author independently re-discovered what you may know as Old Code Syndrome. I think that's because mathematical papers place too much value on terseness and abstraction over exposition and intuition. This guy's basically in the position of a fairly new developer who's just been asked to do non-trivial update of his own code for the first time. All those clever one-liners he put into his code made him feel sm…
I started taking readability very seriously once I started going back to extend old code and finding I couldn't immediately understand what it was doing. Now, if I have that problem, it's now two problems. The original problem, and the readability problem. The readability problem is solved first, and the original problem can only be solved afterward. I don't see comments helping me, I could spend the time better by m…
Today I put in a log statement to see why the code deletes data from the database if there is no new temperature data for the time period. The cron job has been running all day and so far every time it attempts to delete the data, there is no data to delete.
Another line runs a different script if the time is 15:00. No idea what is magical about that time. I added a bunch of log statements to see what happens at 15:00 that is different from every other hour of the day. So far I have no clue.
I’m sure the original coder had a reason for inserting these bits of code, but damned if I know what it was.
There are dozens of instances like this in the code. A one line comment would have saved me hours of work and the client several thousand dollars.