• merc@sh.itjust.works
    link
    fedilink
    arrow-up
    32
    ·
    21 hours ago

    I hate these. You don’t need to program for very long before you see one of these. And, you get used to the idea that when it says there’s an error on a blank line, that it means something isn’t properly terminated on one of the previous lines. But, man, I hate these.

    At the very least, you’d hope that by now compilers/interpreters would be able to say “error somewhere between line 260 and 265”. Or, more usefully “Expected a closing ‘)’ before line 265, opening ‘(’ was on line 260”.

    Error on <blank line> just pisses me off because the compiler / interpreter should know that that isn’t true. Whoever wrote the compiler is a seasoned developer who has been hit by this kind of error message countless times. They must know how annoying it is, and yet…

  • tetris11@lemmy.ml
    link
    fedilink
    arrow-up
    22
    ·
    1 day ago

    You need to do binary search. Comment out all lines in the IDE, save, push to master, and then close the laptop

  • Pika@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    34
    arrow-down
    4
    ·
    edit-2
    1 day ago

    I hate that I noticed the syntax error on line 263 before I realized what the joke was. (at least I assume that 260 contains a function with a callback meaning it is missing the closing parenthesis)

    • master5o1@lemmy.nz
      link
      fedilink
      arrow-up
      9
      ·
      edit-2
      1 day ago

      My assumption is that it’s setting up an object to map element selectors -> callbacks.

      var specialElementHandlers = {
        '#editor': function() {
          return true;
        }
      };
      

      But yeah, could be something as

      var specialElementHandlers = Object.assign({}, defaultHandlers, {
        '#editor': function() {
          return true;
        }
      }; // missing closing parenthesis 
      
    • Aqarius@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      1 day ago

      Yeah, it’s not a joke, it literally happens all the time, and an error after block close generally means the system doesn’t think it’s closed, usually because a bracket isn’t paired off.

    • DudeDudenson
      link
      fedilink
      arrow-up
      2
      ·
      1 day ago

      No one seems to mention this but a lot of the time the code in the binary might not be the same code you see in your IDE so the line number doesn’t match. Intellij for example decompiles libraries when you open them and you have to press a button to download the actual source with all the comments and everything

  • _____@lemm.ee
    link
    fedilink
    English
    arrow-up
    16
    ·
    1 day ago

    that’s everyday with the legacy web app at work, it crunches up code in a templating process and all the errors become either completely meaningless or just “error 500”

      • _____@lemm.ee
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        1 day ago

        that’s IIS as well, I think it’s because we had our severs configured in a reverse proxy and hitting IIS and failing before the http serverhad returned a response caused the 502 error, completely useless error.

        (not very experienced with server configs so forgive me if the language isn’t 100%)

  • pageflight@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    1 day ago

    Me debugging SQL syntax errors in complied dbt models.

    I really enjoyed working with SQLDelight when I was briefly writing a Kotlin backend, sadly it wasn’t complete enough. (It “generates typesafe Kotlin APIs from your SQL statements.”)

    • Ephera@lemmy.ml
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 day ago

      I was kind of thinking that yesterday when looking at a Rust library. Rust is competent with line numbers, so you don’t really have an incentive for splitting files from that angle, but sometimes, folks just seem to keep adding to their files ad infinitum.

      Well, specifically that library has a few files with more than 1k lines. And I hope this one’s the largest at 4k lines: https://docs.rs/git2/latest/src/git2/repo.rs.html

      What also needs to be said, is that this library is actually maintained by the Rust language team. Really makes me want to open an issue to tell them that Rust has a pretty cool module system. 🙃