• sp3ctr4l@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    16
    arrow-down
    1
    ·
    edit-2
    16 hours ago

    I have definitely gone into a rageful fugue state and woken up a week later after reworking an entire code base from being an inconsistent mess of slop…

    …into actually having a common library of functions instead of just rewriting slightly different versions of them 8 times, having those functions only actually instantiated for necesarry classes…

    …rewriting every variable name and function name to an actually consistent and intelligible naming scheme…

    … and finally, moving a whole bunch of shit out of some kind of global ‘think’ type loop that doesn’t actually need to be called or checked every goddamned micro second.

    Done that more than once actually.

    Never look inside ‘baby’s first video game mod’ code, unless you have healthy blood pressure.

    But uh yeah, spite, hatred, and anger are indeed powerful motivators for making good code, lol.

    … so many idiots just jam everything into a global, called every tick loop, and then claim that it just can’t be optimized, because “the game engine just can’t handle it”…

    • ChickenLadyLovesLife@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      3 hours ago

      I spent a good fraction of my career taking over and trying to fix code bases that my company refused to scrap and replace outright because they didn’t want to admit their worthlessness. Complete rewrites would have taken maybe a tenth of the time I spent.

      My favorite thing to encounter (which was nearly universal) was the phenomenon of a young programmer fresh out of college encountering SQL for the first time, deciding he hated it, and writing a huge mess of code to handle auto-generating the necessary SQL. I remember taking over one C# application that had classes named “AND.cs” and “OR.cs” which just took a String as a parameter and returned that String with " AND " and " OR " appended to it, respectively. In about an hour, I replaced three months of this guy’s work that had bottlenecked the project with like five SQL statements.

      It’s insane to think what the civil engineering world would be like if it had the career structure of the software world.

      • sp3ctr4l@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        3
        ·
        edit-2
        1 hour ago

        Jesus Fucking Christ.

        I’ve done a lot of SQL/Database type work as well, and yep, I’ve been the person learning their insane spider web of db structures, and then either trying to enforce some kind of actual defined standards going forward, or in some instances, succeeding at restrucuring the dbs, transitioning them, and convincing corporate that this actually needed to be done.

        It’s insane to think what the civil engineering world would be like if it had the career structure of the software world.

        Points at understaffed ATC tower, collapsing bridge that hasn’t been even evaluated in a decade, general state of roadway disrepair and constant re-repair, also the new highway/overpass/lane expansion being built to ‘solve traffic’ despite doing that literally never working

      • lordbritishbusiness@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        3 hours ago

        First thing I tell my interns: “The guys that made that database are smarter than you, they got PhD’s for the algorithms the database uses. You are going to use SQL properly, and query properly, because the database will always do it better than your python code.”