• 0 Posts
  • 14 Comments
Joined 1 year ago
cake
Cake day: December 30th, 2024

help-circle

  • Guttural@jlai.lutoProgrammer Humor@programming.devlook at this junk!
    link
    fedilink
    Français
    arrow-up
    8
    ·
    edit-2
    1 month ago

    As soon as I stopped trying to write textbook OOP stuff, this stopped occurring to me. That was years ago.

    I’m not saying I write perfect code, no. But when I read bad stuff I wrote, I can understand it and think of ideas about how to improve it if that becomes necessary.

    On top of writing more functional-style code, the way I achieved this was:

    • Absolutely no inheritance whatsoever. Composition + interfaces work wonders for what I do.
    • Minimal mutable state. This pays dividends when debugging.
    • Ditto for type-system-encoded nullability markers (ie. ? in C#, std::optional in C++…)
    • I avoid writing code just-in-case something happens. If I haven’t run it manually or via unit tests, it goes to the garbage bin (not an absolute, just a guiding principle). There’s a chance that code isn’t even correct to begin with and you’ll have to throw it away should you ever need it.
    • Low indirection. I don’t want to jump through 10 functions to see what something is doing, and nobody else does either.








  • Well at least things are accelerating down there, hopefully the madness will end soon enough, so the image they’re trying to project won’t hold for long.

    It’ll be interesting to see how an already aging population will fare with so many of the active population dead.

    Last time it happened in the West, it took imperialist pigs in the West a few notches down. Let’s hope for Russians and the neighbouring countries they bully the story will be similar with the pigs in the Kremlin this time.