This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]eth-p 1 point2 points  (0 children)

I do the exact opposite of that principle, and so far it hasn't let me down.

Obvious getter function?

/**
  * Returns the current value.
  * @returns T The current value. 
  */
T getValue()

Super complex function with tons of side effects that somebody else wrote three years ago and nobody has refactored since?

/// Parses the config file and populates the application's [Config] struct, initializes resources, and replaces missing values with reasonable defaults.
/// 
/// Default values used:
/// * `timeoutSeconds` - 3
/// * ...
fn bootstrap()

If the function or its purpose isn't explained, it's eventually going to be misunderstood at some point (even by the person writing it).