On the one side I really like c and c++ because they’re fun and have great performance; they don’t feel like your fighting the language and let me feel sort of creative in the way I do things(compared with something like Rust or Swift).

On the other hand, when weighing one’s feelings against the common good, I guess it’s not really a contest. Plus I suspect a lot of my annoyance with languages like rust stems from not being as familiar with the paradigm. What do you all think?

  • abhibeckert@lemmy.world
    link
    fedilink
    arrow-up
    20
    arrow-down
    10
    ·
    4 months ago

    If you want memory-safe, don’t write C/C++.

    Fixed that for you. There’s no situation where you want buffer overruns.

    • cm0002@lemmy.world
      link
      fedilink
      arrow-up
      22
      arrow-down
      1
      ·
      4 months ago

      There’s no situation where you want buffer overruns.

      I want buffer overruns in my game consoles for jailbreaking purposes lmfaoooooo

    • evranch@lemmy.ca
      link
      fedilink
      arrow-up
      5
      arrow-down
      1
      ·
      edit-2
      4 months ago

      If you don’t want memory-safe buffer overruns, don’t write C/C++.

      Fixed further?

      It’s perfectly possible to write C++ code that won’t fall prey to buffer overruns. C is a lot harder. However yes it’s far from memory safe, you can still do stupid things with pointers and freed memory if you want to.

      I’ll admit as I grew up with C I still have a love for some of its oh so simple features like structs. For embedded work, give me a packed struct over complex serialization libraries any day.

      I tend to write a hybrid of the two languages for my own projects, and I’ll be honest I’ve forgotten where exactly the line lies between them.