News for hackers. Stuff that matters.
Re:On Comments in Code by bombcar on Tuesday June 15, 2021 @11:13PM (#27524477)
//

// Dear maintainer:

//

// Once you are done trying to 'optimize' this routine,

// and have realized what a terrible mistake that was,

// please increment the following counter as a warning

// to the next guy:

//

// total_hours_wasted_here = 42

//

Re:On Comments in Code by BearfootCoder on Wednesday June 16, 2021 @03:44AM (#27525963)
The inverse of this is also useful:

// Dear maintainer,

// The code which follows was hacked together under desperate pressure.

// It's not smart. // It's not doing anything really subtle. // It's the only thing we could get to work in the time.

// If you want to chuck it and replace it, you absolutely should.

Re:On Comments in Code by kubanczyk on Wednesday June 16, 2021 @05:48AM (#27526664)
Hey, that one I actually can replace with self-documenting code! Oh joy!
Re:On Comments in Code by slver on Wednesday June 16, 2021 @04:57AM (#27526384)
It's useful, until you realize you have this on 90% of your code.
Re:On Comments in Code by Cthulhu_ on Wednesday June 16, 2021 @08:22AM (#27527669)
That's when a full rebuild can be justified.

I'm doing that atm, but I think my predecessor lacked the humility to admit that his code was bad, which is how it went up to 150K of code that basically concatenates XML, converts it to JSON and concatenates HTML on the front-end from the result.

Re:On Comments in Code by OnlyMortal on Wednesday June 16, 2021 @03:37AM (#27525918)
Not a bad idea.
Re:On Comments in Code by bombcar on Wednesday June 16, 2021 @03:19PM (#27532356)
My code would probably be better served by:

This place is a message… and part of a system of messages… pay attention to it!Sending this message was important to us. We considered ourselves to be a powerful culture.

This place is not a place of honor…no highly esteemed deed is commemorated here… nothing valued is here.

What is here is dangerous and repulsive to us. This message is a warning about danger.

The danger is in a particular location… it increases toward a center… the center of danger is here… of a particular size and shape, and below us.