Saturday, June 22, 2024

Coded Smorgasbord: Minimal Commentary

Programming LanguageCoded Smorgasbord: Minimal Commentary


Comments explain a lot about our code. And sometimes, the comments explain more than the code itself.

Alastair found this lovely comment, which demonstrates an excellent, if confusing, understanding of a boolean "or":

// Only add delivery option if it has no weight bands or at least one weight band.

The developer has left the company, so no one knows what the code should do if someone orders a negative number of weight bands.

Leith knows what they want to do in response to this comment:

# This function needs to be document or deleted

Deleted. The vote is deleted.

Samir inherited some code from someone who knows what they should do- but arguably isn't doing it.

/* all the code under here is bad, and I should feel bad*/

Finally, Brian riddles us this:

/// <summary>
/// Requests the additional time.
/// </summary>
/// <param name="?">The ?.</param>
protected new void RequestAdditionalTime(int milliseconds)

The ? needs to be set correctly to get you additional time.

[Advertisement]
Continuously monitor your servers for configuration changes, and report when there's configuration drift. Get started with Otter today!

Check out our other content

Check out other tags:

Most Popular Articles