aka “bros: in order to be rich, just don’t be poor.”

  • JakenVeina@midwest.social
    link
    fedilink
    arrow-up
    51
    ·
    12 days ago

    To be clear, he’s not saying “just code better”, as the title implies. It’s a really poor choice of title.

    you are going to mess up somewhere and get leaks, stray pointers, etc. This is true independently of how conscientious you are with your allocations:

    He goes on to say, effectively, “Don’t use new/delete/malloc/free if you can help it. Use smarter mechanisms.”

    • sik0fewl@lemmy.ca
      link
      fedilink
      arrow-up
      5
      ·
      11 days ago

      Ya, I don’t think he actually said that since it’s not mentioned in the referenced article. What’s actually meant is “by writing code that doesn’t have any memory management”.

    • avocado@programming.dev
      link
      fedilink
      arrow-up
      3
      arrow-down
      3
      ·
      11 days ago

      C++'s so called smarter mechanisms are ugly af. I would rather my RAM crash and burn than use its standard library.

      • chunes@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        11 days ago

        yeah. I’d rather use C and statically allocate everything up front, even if that’s not a great fit

        • sobchak@programming.dev
          link
          fedilink
          arrow-up
          2
          ·
          10 days ago

          When I did embedded programming that’s what I did. Nothing was dynamically allocated. It also allowed me to write a debugger that would watch how variables changed by just directly reading from memory, chart them, and and stuff like that.