Stroustrup's Rule (2024)

(buttondown.com)

38 points | by bmacho 3 days ago

4 comments

  • quietbritishjim 29 minutes ago
    I would modify Stroustrup's rule like so:

    * For new features, people insist on LOUD explicit syntax.

    * For established features [that turned out to be used disproportionately often], people want terse notation.

    So, I argue, it's not really people getting used to the feature that allows it to be terser. It's that enough time passes that you figure out what features are used enough that they warrant the terse syntax (like the Rust example he gave).

    It's a form of selection bias: there are many other established features that are rarely used and left with a verbose syntax but you don't notice them later because, well, they're rarely used.

  • MarkusQ 1 hour ago
    There's a missing dimension: orthogonality. Having terse notation that implements a feature that you can reason about in isolation is fine for both beginners and experts. But features that have complex interactions with their environment are hard to reason about regardless of the syntax (though bad syntactic choices can certainly make it worse).

    You can introduce a notation that's terse without problem, so long as it's comprehensible when encoutered. Example: the (!·!) operator (which I just made up), which can be placed around any expression to log the value of the expression to STDOUT. Its value is the same as the expression (so `(!3+7!)` equals `10`).

  • Jtsummers 38 minutes ago
    The discussion for the (linked by Hillel) defunct web page when it was submitted a decade ago here:

    https://news.ycombinator.com/item?id=13192052 - 16 December 2016, 73 comments

  • fsckboy 16 minutes ago
    But that's not a rule, it should be Stroustrop's Observation:

    For new features, people insist on LOUD explicit syntax.

    For established features, people want terse notation.