• Lunya \ she/it
    link
    fedilink
    615 months ago

    Meanwhile Rust: you might get an error at line 45 word 3 because it assumes variable foo is an int32 but it could be (whatever else idk), let’s not compile this before you correct this by changing line 43 in this specific way. Here’s the before and after code snippets so you can just copy-paste the fix.

    • TxzK
      link
      fedilink
      365 months ago

      Man I fucking love the Rust compiler. Easily the most understandable and useful error messages I’ve ever seen.

      • @[email protected]
        link
        fedilink
        English
        105 months ago

        Have you seen Elm’s error messages? They were what inspired Rust to have its error messages.

        • @Asudox
          link
          35 months ago

          I like how Elm error messages are like the compiler talking to you as a person.

    • @[email protected]
      link
      fedilink
      185 months ago

      In my IDE there us even a button for accepting the compilers recommend fix. This is only possible because the error messages and recommendations are that good.

      • @agent_flounder
        link
        English
        115 months ago

        Hm. Rust sounds better and better every time I hear something new about it.

  • @[email protected]
    link
    fedilink
    English
    395 months ago

    JavaScript: error: undefined is undefined or some nonsense like that. Sorry to repeat the old JavaScript bad, but I really hate debugging JavaScript!

          • @[email protected]
            link
            fedilink
            55 months ago

            If you want the same traces as Java and python in the meme, you leave them, if you don’t you strip them. Or you ship them separately. You decide, like a big boy.

          • @Ziglin
            link
            14 months ago

            Have the user compile it without debug symbols to save space. If the user has a problem they can just recompile it with debug symbols and see what went wrong with gdb.

  • @[email protected]
    link
    fedilink
    English
    165 months ago

    It’s been a minute since I used C/Cpp but if you compile with debugging symbols and using gdb give you info like in Java? At least the location of the crash.

      • @Buddahriffic
        link
        85 months ago

        Then it’s time to have a closer look at how your concurrent threads are behaving and where you missed a sync point or mutex.

    • @Ziglin
      link
      24 months ago

      And much more, it tells you each operation it goes through, where it is in the code, what’s in the registers and more.

  • Illecors
    link
    fedilink
    English
    155 months ago

    But it returned 139! That’s a start even without a debugger!

  • @SlopppyEngineer
    link
    95 months ago

    And C/C++ are like that by design. Compiled languages were new and the developers were afraid additional checks would decrease performance. It was certainly performant in racing toward a crash.

    • mox
      link
      fedilink
      55 months ago

      And C/C++ are like that by design. Compiled languages were new and the developers were afraid additional checks would decrease performance.

      If you have a credible citation showing that was what guided K&R’s decisions, I think you should post it.

  • Gnome Kat
    link
    fedilink
    75 months ago

    but with a core dump you can just load it up and see the state of the process when it crashed…

  • @anarchyrabbit
    link
    45 months ago

    Story time. Back at uni I had a c++ subject. Me being lazy as fuck I didn’t attend many classes and let alone do the practicals during the semester. Exam time comes around. I realise I can’t cram in a whole semester’s learning in a week. Luckily it’s open book exam. Big brain time, I print the whole c++ documentation to take into the exam. I frantically page through the hundreds of pages in my lever arch file looking for answers. I pretty much copy and write example code to questions. Very sad when I failed.

  • @[email protected]
    link
    fedilink
    25 months ago
    gdb> break before it crashes
    gdb> record full
    gdb> continue
    (segfault)
    

    gdb> set exec-direction reverse

  • @Ziglin
    link
    14 months ago

    The code editor I had to use for Java once didn’t give me anything like that.

    Meanwhile for C you can just use gdb, it’s great!