Skip to content
DevMeme
4050 of 7590
Compilers Post #4415 · source on Telegram

C++ compiler panic versus Rust compiler gentle guidance meme comparison

Description

The meme is a two-panel vertical layout on a black background. Top text reads: "Me: Makes small mistake in C++ C++ Compiler:" followed by a photo of a startled person holding a frying pan like a shield, with the subtitle "*Confused screaming*" - illustrating cryptic C++ error output. The next caption says: "Me: Makes small mistake in Rust Rust Compiler:" above an image of a calm, smiling presenter gesturing toward the viewer; overlaid text states, "Here is a detailed list of what went wrong and how to fix it, including helpful links to the docs and some tips how to improve other parts of your code!" Faces are blurred for privacy. Technically, the joke contrasts notoriously terse C++ compiler diagnostics with the famously verbose and actionable messages produced by Rust’s `rustc`, highlighting developer-experience differences when debugging small mistakes

Comments

60
Anonymous ★ Top Pick C++: miss one semicolon and the compiler spills a 4-screen SFINAE coroner’s report; Rust: miss one lifetime and rustc replies with a TED-style slide deck, a doc link, and a gentle reminder that your other functions deserve ownership too
  1. Anonymous ★ Top Pick

    C++: miss one semicolon and the compiler spills a 4-screen SFINAE coroner’s report; Rust: miss one lifetime and rustc replies with a TED-style slide deck, a doc link, and a gentle reminder that your other functions deserve ownership too

  2. Anonymous

    After 15 years of deciphering C++ template instantiation errors that span 500 lines for a missing semicolon, you realize Rust's compiler messages aren't just helpful - they're basically pair programming with someone who actually read the documentation and remembers why you made that architectural decision six months ago

  3. Anonymous

    The real difference between C++ and Rust isn't memory safety - it's that C++ compiler errors read like Lovecraftian horror ('template instantiation depth exceeds maximum of 900') while Rust's compiler is basically a patient senior engineer doing code review at 2 AM, complete with suggestions, documentation links, and gentle reminders about that unused variable from three functions ago. One makes you question your career choices; the other makes you wonder if you deserve such kindness

  4. Anonymous

    C++: one typo triggers a SFINAE avalanche and 600 lines of “instantiated from here”; Rust: miss a ‘&’ and the compiler drafts the patch and explains your lifetimes like a calm tech lead

  5. Anonymous

    C++ turns a dangling pointer into an error novella; Rust's compiler delivers the executive summary with pull-request-ready fixes

  6. Anonymous

    One missing & in C++ summons SFINAE and 800 lines of 'note: in instantiation of…', while rustc turns the same typo into a teachable moment with lifetimes, a .clone() hint, and links - the only compiler that feels like a code reviewer

  7. @ZgGPuo8dZef58K6hxxGVj3Z2 4y

    Lool rly? Never used rust…

    1. @feedable 4y

      fake

      1. @ZgGPuo8dZef58K6hxxGVj3Z2 4y

        Ah okay thanks😂😂

    2. @anatoli26 4y

      True story. That’s why (among other things) we love it

      1. Deleted Account 4y

        But still people think that Rust > C++ lmao

        1. @anatoli26 4y

          Define the '>' operator

          1. Deleted Account 4y

            "better than"

            1. @anatoli26 4y

              Then I’d say Rust >> C++ (way better)

              1. Deleted Account 4y

                >> is a bit shift to the right

                1. @anatoli26 4y

                  Makes sense.. if you bitshift Rust to the right you get something like C++

                  1. Deleted Account 4y

                    Lmfao

              2. @feedable 4y

                not better at all

                1. @anatoli26 4y

                  What’s your experience with both langs?

                  1. Deleted Account 4y

                    I love c++ but i didn't know where i can work if i know him very well

                  2. @feedable 4y

                    ~4yrs with c++, ~1 with rust

                    1. @anatoli26 4y

                      Get a couple of decades more with C++ and then tell me how you love it 😏

                      1. @feedable 4y

                        and then a couple of more, and more, and more the truth is, it only sufficed me one year to understand just how bad rust really is

                        1. @anatoli26 4y

                          I guess you just don’t get it yet why C and especially C++ sucks.. but tell us why you don’t like Rust

                          1. @feedable 4y

                            i do not intend to do so to you, since clearly you are already convinced, and no amount of effort will make you change your mind. please come back when you aren't condescending

                            1. @anatoli26 4y

                              Don’t be so sure about others. We are all ears (eyes). Tell us, what’s wrong with Rust? What makes you think “how bad Rust really is”?

                              1. @feedable 4y

                                rust is a language of lies. Sure, c++ is not safe, but it does not promise to be safe. Rust promises safety, and zero-cost abstractions, none of which turn out to be true. While programming in rust, you will fight the borrowchecker, and you will lose and discover the multitude of programs that cannot be expressed safely or elegantly, mostly because developers did not think of that particular usecase and did not make an exception there. For how small, compared to c++ this language is, it consists of inconsistencies and little exceptions. It results in a language, in which you are affraid to write actual code, since every time you write anything non-trivial, you will encounter one little issue, which you will try to circumvent for a couple of days, while pulling your hairs out, and you will end up on rustc bug tracker, where you will find your exact problem in a discussion which has been stale since 2019. There is a solution for that in rust, though. Just litter your code with Arcs and Mutexes, and your problems will be gone! But that's no zero-cost, now, is it? Also, I just wanted to briefly mentioning metaprogramming in Rust, or, rather, the fact that it does not exist.

                                1. @RiedleroD 4y

                                  rust promises memory-safety, which is true. Everything else is promised by rust stans

                                  1. @feedable 4y

                                    why rust then, and not go?

                                    1. @RiedleroD 4y

                                      because I haven't learned go and I don't want to

                                    2. @anatoli26 4y

                                      Performance and memory safety

                                      1. @feedable 4y

                                        did you just ignore everything that I wrote?

                                        1. @anatoli26 4y

                                          In general, it looks like you’re not using rust the way it should be. Though describe a specific example that gives you so much trouble

                                          1. @feedable 4y

                                            my usecase is abstracting a complex api in a type-safe way, while not introducing overhread. My particular task required a lot of type magic, which was ~100SLoC of C++, and turned out to be impossible with rust. In general, though, anything involving non-trivial control-flow (for example async), will bring down all the safety and speed of rust

                                            1. @RiedleroD 4y

                                              where the fuck do you need type magic when abstracting an API?

                                              1. @feedable 4y

                                                take as an example GPIO, which is actually not that difficult to abstract away with Rust, or anything at least moderately complex

                                                1. @anatoli26 4y

                                                  Anyway, your issue, even if it’s really following the best practices and is truly unsolvable, doesn’t invalidate Rust as such and at maximum may indicate that some niche cases of interoperability with other langs could be somehow difficult to implement

                                            2. @anatoli26 4y

                                              Not knowing the exact details it looks like you’re trying to solve something in Rust the C++ way probably with some bad design overall

                                              1. @RiedleroD 4y

                                                I need a 👆reaction in telegram, I don't want to reply with "👆 this" all the time

                                              2. @feedable 4y

                                                i am not willing to disclose my exact usecase, and it was a year ago, now, so i will redirect you to another example myy my friend Hirrolot, one of the designers of Teloxide, a popular Telegram bot library for Rust. He basically lays out the same problem as I do, but with concrete examples https://hirrolot.github.io/posts/rust-is-hard-or-the-misery-of-mainstream-programming.html

                                                1. @RiedleroD 4y

                                                  absolutely nothing in this blog post is concrete. He's (they're?) making vague statements based on vague premises and most of the blog post is just 'imagine if rust was good'

                                                  1. @RiedleroD 4y

                                                    ok nvm you just sent me to the last section for some reason

                                                    1. @feedable 4y

                                                      yeah that's what i had in my open tabs, so

                                2. @RiedleroD 4y

                                  and if you fight the borrowchecker, you're fundamentally misusing rust

                                  1. @anatoli26 4y

                                    👆this

  8. @FallenChromium 4y

    I think they both do it, except Rust screams more often because more things are illegal at compilation time Full disclosure: never used Rust

  9. @ZgGPuo8dZef58K6hxxGVj3Z2 4y

    Post this with Assembler vs C#

    1. @meowo456 4y

      that doesn't make any sense, most instruction sets are way way simpler than any seriously used language, the only errors your (excluding macro-) assembler(s) could catch are very simple syntactical ones.

      1. @RiedleroD 4y

        I think that's the joke

        1. @SamsonovAnton 4y

          Well, then some RISC assembler vs MSIL (.Net CRL byte-code).

          1. @feedable 4y

            don't

  10. @azizhakberdiev 4y

    ...and phone number of nearest psycologic consultant

  11. @mvolfik 4y

    Unless you work with async

  12. @mvolfik 4y

    Or do lifetime magic

  13. @mvolfik 4y

    Or, in the worst case, both at once

  14. dev_meme 4y

    No, c++ can fucking ignore error and didn't tell you

    1. @ZgGPuo8dZef58K6hxxGVj3Z2 4y

      Yes with the ms compiler

  15. @V0W4N 4y

    look at my new code! (Its written in the best language in the world rust that everyone should use i use rust its so cool cpp sucks dung in comparison to it i love rust so much)

  16. @RiedleroD 4y

    bogo type

  17. @feedable 4y

    you forgot the dyn

Use J and K for navigation