|
|
Log in / Subscribe / Register

Quote of the week

I just realized. The more you comment your code and make it understandable, the easier it is for other people to takeover and rewrite your code. This means that when you retire/pass-away, your code will likely be quickly overwritten and your legacy gone from the active code base.

So, if you write complex clever code with little to no documentation, your code is more likely to be immortalized in the code base as everyone will be too afraid to touch it and possibly break it.

Steven Rostedt

to post comments

Quote of the week

Posted Oct 12, 2023 2:30 UTC (Thu) by Cyberax (✭ supporter ✭, #52523) [Link] (4 responses)

For bonus points, you can add misleading comments!

My favorite example from a fairly dense piece of code:

// Pink ponies fly swiftly.
... (a screen of code later)
// Promote surreal humor!

Quote of the week

Posted Oct 12, 2023 5:47 UTC (Thu) by adobriyan (subscriber, #30858) [Link] (2 responses)

> For bonus points, you can add misleading comments!

Misleading comment might lure someone into the code and later fix it. You need scary looking but information-free comments:
// don't touch this

Quote of the week

Posted Oct 13, 2023 9:31 UTC (Fri) by NRArnot (subscriber, #3033) [Link]

// Do not attempt to modify or optimize the following code. You will regret it.
// if you have ignored this advice and then reverted the original, code please increment the following comment
// TIMES_REGRETTED = 14
// Thank You.

Quote of the week

Posted Oct 16, 2023 5:05 UTC (Mon) by error27 (guest, #8346) [Link]

wb();
wb(); /* magic! */

Quote of the week

Posted Oct 12, 2023 14:58 UTC (Thu) by Gotchfutchian (guest, #167310) [Link]

My favorite so far, from an internally developed driver for some esoteric printer (or something like that, its been a few years since I worked there)

\\ I wish I could do something else here, but everything else I have tried has produced papers containing ancient texts that probably summon demons.
\\ Instead, I opt to write a demon in itself, a scourge upon all who read it.
\\ Hic sunt dracones.
{what follows is, from what i recall, effectively hijacking the printer to run new code, then printing, then rebooting. It had to push the code one byte into the printers memory at a time.}

This also meant we had a dedicated computer for printing everything in the office. Thankfully, we rarely printed.

Quote of the week

Posted Oct 12, 2023 2:36 UTC (Thu) by anarcat (subscriber, #66354) [Link]

This is horrible. Thank you.

Quote of the week

Posted Oct 12, 2023 14:34 UTC (Thu) by smoogen (subscriber, #97) [Link]

The cool part will be that the comments you wrote will not be changed so the next layer of code will be immortal as no one can understand how after reading the comments how any of what the code does worked!

Quote of the week

Posted Oct 20, 2023 19:35 UTC (Fri) by rhuveneers (guest, #3785) [Link] (2 responses)

Wouldn't it be just great if somebody else improved your code, being helped by the comments you gave? What are you afraid of?

Quote of the week

Posted Oct 24, 2023 11:05 UTC (Tue) by mathstuf (subscriber, #69389) [Link] (1 responses)

The rest of the post:

> I thought of this when looking into the Linux TTY code base

I think this is a lament on the lack of comments in various places in the kernel, not the expression of a philosophy to live by.

Quote of the week

Posted Oct 26, 2023 20:55 UTC (Thu) by Wol (subscriber, #4433) [Link]

So you don't remember back to the kernel 2. era?

Alan Cox (who was Linus' no 2 at the time) tried to fix the mess that was the tty code and it broke him. Okay, he had a personal tragedy at about the same time, but he left Linux completely, to the best of my knowledge.

Cheers,
Wol


Copyright © 2023, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds