• Lunya \ she/it@iusearchlinux.fyi
    link
    fedilink
    arrow-up
    58
    arrow-down
    2
    ·
    9 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@lemmy.zip
      link
      fedilink
      arrow-up
      35
      arrow-down
      1
      ·
      9 months ago

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

    • anton@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      19
      arrow-down
      1
      ·
      9 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.

  • smeg@feddit.uk
    link
    fedilink
    English
    arrow-up
    38
    arrow-down
    1
    ·
    9 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!

  • SlopppyEngineer@lemmy.world
    link
    fedilink
    arrow-up
    12
    arrow-down
    4
    ·
    9 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@lemmy.sdf.org
      link
      fedilink
      arrow-up
      4
      ·
      9 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.

    • mrkite@programming.dev
      link
      fedilink
      arrow-up
      3
      ·
      9 months ago

      I’m trying to remember the last time I actually had a core file. I think core dumps have been disabled by default on Linux since at least 2000.

      • Tja@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        9 months ago

        They are stored in the system log and thus rotated automatically to save storage. At least in Arch.

        I use Arch, BTW.

  • anarchyrabbit@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    9 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.

  • JATtho@sopuli.xyz
    link
    fedilink
    arrow-up
    2
    ·
    9 months ago
    gdb> break before it crashes
    gdb> record full
    gdb> continue
    (segfault)
    

    gdb> set exec-direction reverse

  • Ziglin@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    8 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!

  • DannyBoy@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    0
    ·
    9 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.

    • Miaou@jlai.lu
      link
      fedilink
      arrow-up
      1
      ·
      9 months ago

      And then you realise the program doesn’t crash when compiling with debug symbols 😢