GoThread
appearance log in
home all local communities
c/programmer_humor@programming.dev

Programmer Humor

log in to join
follow from another instance

Not on this instance? Enter your own instance's domain to go straight to following c/programmer_humor@programming.dev there.

hashtags

#programmer_humor#4#android#bin#c#certificate#control#convenience#emudhra#four#hang#hobbit#meme#menu#nostalgia#pico#promises#purpose#sdk#security#trash#trump#tumblr#windows
189
c/programmer_humor@programming.dev · Solrac@quokk.au · 2 Nov 2026 07:58

Is my fear of C/++ Justified?

check post at origin

Is my fear of C/++ justified?, -cursed `e` coding-, The Engima of Segmentation Fault

35 comments
Is my fear of C/++ justified?, -cursed `e` coding-, The Engima of Segmentation Fault
1 / 1 open original
×

35 comments

top new hot controversial

log in to comment.

  • @grue@lemmy.world · 2 Nov 2026

    Less fucked-up than Javascript.

    92
    link
    • @NateNate60@lemmy.world · 2 Nov 2026

      This diagram is nonsense. JavaScript programmers know to simply never use == but to use === instead. Half of JavaScript is like this. Oh, there’s a feature, but it behaves in a super weird way so we don’t use it to avoid the weirdness.

      43
      link
      • @GeirGrusom@lemmy.world · 2 Nov 2026

        Where’s the >== operator? Because they also have the exact same problem.

        16
        link
      • @dan@upvote.au · 2 Nov 2026

        The recommended ESLint rules catch most of the bad stuff, and these days this is all you need in your ESLint config to enable them:

        import {defineConfig} from 'eslint/config';
        import js from '@eslint/js' 
        
        export default defineConfig([
          js.configs.recommended,
        ]; 
        

        There’s one use case where == is still commonly used: == null matches both null and undefined. Lint rules that block == usually allows the null case as an exception.

        12
        link
        • @BradleyUffner@lemmy.world · 2 Nov 2026 · edited

          So you’re saying the jank has become structural?

          11
          link
        • @Venator@lemmy.nz · 2 Nov 2026

          I wonder how much bandwidth is wasted on the extra =, since it survives minification 😅

          3
          link
          • @ignotum@lemmy.world · 2 Nov 2026

            But if every single comparison used in a file is a triple =, then any compression algo worth its weight in salt will compress that bloat away during transmission

            The real issue is all the precious precious RAM those extra = use on the client device once received and unpacked!

            6
            link
          • @9point6@lemmy.world · 2 Nov 2026

            Gzip (any properly configured static server will serve compressed assets) probably compresses them down so probably a single extra byte per file

            2
            link
            • @dan@upvote.au · 2 Nov 2026 · edited

              Gzip is old-school. The majority of modern sites use Brotli now. It’s slower to compress, but that’s not normally an issue for static resources (CSS, JS, etc) because they can be pre-compressed during the build and the web server serves the pre-compressed files instead of dynamically compressing them.

              2
              link
      • @ParlimentOfDoom@piefed.zip · 2 Nov 2026

        As someone trying to learn Javascript, it just makes me mad that at this garbage heap of a language is so widely used.

        10
        link
        • @victorz@lemmy.world · 2 Nov 2026

          The problem is that you can’t break compatibility.

          Only in some exceptional cases. 🙃

          2
          link
          • @ParlimentOfDoom@piefed.zip · 3 Nov 2026

            Not with that attitude

            3
            link
            • @victorz@lemmy.world · 3 Nov 2026

              Personally, I’d love to break compatibility for better features and consistency. We should be able to declare the version at the top of the file or something. Nothing at the top = legacy crap. 🤷‍♂️ I dunno.

              3
              link
      • @9point6@lemmy.world · 2 Nov 2026

        IIRC modern linter rulesets generally just outright error if you do anything remotely like this.

        4
        link
      • @nykula@piefed.social · 2 Nov 2026

        == has never, ever caused me a single issue. Parsing all server input with type-safe schemas makes sure that where I expect a string, I get a string; where I expect a number, I get a number. Bad data must result in an error before it reaches logic.

        1
        link
        • @NateNate60@lemmy.world · 2 Nov 2026

          “I have no problem living in a house of cards as I make sure to never bump against the walls.”

          12
          link
          • @nykula@piefed.social · 3 Nov 2026

            Opposite, living in a house of cards is when you blindly trust data that comes from user. Regardless of the language. eqeqeq isn’t in the recommended linting presets because if you end up needing it, you’re probably already in big trouble because of insecure software design.

            0
            link
            • @NateNate60@lemmy.world · 3 Nov 2026

              Nobody is advocating for blindly trusting data from the user.

              1
              link
      • @diaphragmwp@discuss.tchncs.de · 2 Nov 2026

        When I had to use JS I wrote JS 1.2 because why not. Fun how I had strings of numbers instead of actual numbers in some for loops, yet it all sort of functioned until something didn’t. I then decided to add Number() to random values just in case.

        0
        link
    • @Solrac@quokk.auOP · 3 Nov 2026

      I did not wish to believe… but then I saw.

      image

      4
      link
  • @girlnamedzero@piefed.zeromedia.vip · 2 Nov 2026 · edited

    For those needing help the code is:

    using namespace std;
    int main()
    {
    while (true)
    {
    cout << 'e';
    cerr << 'e';
    }
    return 'e';
    }
    

    Anyway, my opinion: c is the best thing to ever exist, and c++ is evil

    26
    link
    • @xxce2AAb@feddit.dk · 2 Nov 2026

      Yeah. I kept reducing my sane “C with classes” subset until I just ended up back writing C99 too, and just about the only difference that made for my use case was better compilation times. If I ever need more than that, I’ll likely reach for Zig or C3 before C++.

      3
      link
  • @trxxruraxvr@lemmy.world · 2 Nov 2026

    No. I don’t find it a particularly nice language to work with, but there’s no reason to fear it. Just make sure you know what you’re doing if/when you use it.

    27
    link
    • @kettuli@lemmy.blahaj.zone · 2 Nov 2026

      So yes

      13
      link
      • @trxxruraxvr@lemmy.world · 2 Nov 2026

        No

        7
        link
        • @MangoCats@feddit.it · 2 Nov 2026

          Superposition is for quantum computing, C++ does not apply.

          2
          link
  • @axh@lemmy.world · 2 Nov 2026

    No, the C++ should fear you!

    14
    link
  • @mkwt@lemmy.world · 2 Nov 2026

    If anyone is starting to learn C++, make sure to use books or training materials based on C++11 or later.

    13
    link
    • @glibg10b@lemmy.zip · 2 Nov 2026

      Even C++11 is pretty old. I would recommend at least C++17

      8
      link
      • @boonhet@sopuli.xyz · 2 Nov 2026

        As someone who last touched any C++ books when C++11 was very new and has only written like 20-30 lines of non-tutorial C++ since then, what are some significant changes to the language that I should be aware of if I wanted to give it a try now?

        4
        link
        • @glibg10b@lemmy.zip · 2 Nov 2026

          A few examples:

          • CTAD: Instead of std::pair<int, int> myPair{ 1, 2 }, you just write std::pair myPair{ 1, 2 }
          • std::optional, std::variant and std::any
          • Guaranteed copy elision in some cases, making it more feasible to apply the rule of 5 everywhere
          • Attributes like [[nodiscard]] (compiler warning if an object or return value is discarded) and [[fallthrough]] (suppress a switch fallthrough warning)
          • Generic lambdas ([](auto it){ /* do something */ })
          • std::string_view, which is much safer as a function parameter than const char*
          9
          link
          • @victorz@lemmy.world · 2 Nov 2026

            Class Template Argument Deduction (CTAD)

            For anyone wondering, like I did.

            4
            link
        • @steve_lebt_in_overflow@programming.dev · 2 Nov 2026

          Modules

          0
          link
  • @edinbruh@feddit.it · 2 Nov 2026

    Of C? No

    Of C++? Yes

    10
    link
  • @mnemonicmonkeys@sh.itjust.works · 2 Nov 2026

    Your example is just brainfuck but somehow even worse

    8
    link

about

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn’t find it funny, you’re banned. Ha-ha!.. For real: do not use the community for “statements”. There are other places for such content. Keep it chill and funny.
members
34206
posts
128
created
12 Jun 2023
active / week
488
active / month
1610

moderators

  • @anzo@programming.dev
  • @Feyter@programming.dev
  • @BurningTurtle@programming.dev
  • @pylapp@programming.dev

rss · modlog

GoThread · self-hosted threadiverse · instances · modlog · rss · appearance · AGPL-3.0