• Buddahriffic@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    6 months ago

    Yeah, I like the sweet spot that C++ is in. It can do anything C can but then you have classes and STL and all that on top of it.

    • JoYo@lemmy.ml
      cake
      link
      fedilink
      English
      arrow-up
      2
      ·
      6 months ago

      once i learned about defer it became a hard requirement. cpp kinda gives me that but other c like languages do it better.

      • Buddahriffic@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        5 months ago

        Yeah, I wish C++ had function/scope epilogs and labeled loops/breaks, too. Those are the cases where the “never use goto” rule can be broken to make better code than adding all of the code that would be required to handle it the “right” way (setting up early exit flags and if statements after each level of nested loop to check the flag).