• solomonschuler@lemmy.zip
    link
    fedilink
    arrow-up
    1
    ·
    9 hours ago

    Madness. When I started using gdb in C it was lifesaver to find any runtime errors in my code. Coming from what is the shit of C compilation and runtime errors it saved what would effectively be hours of inserting printf statements to find the error.

    It depends how well a language specifies where the runtime error is occuring. I just get “segmentation fault (core dumped)” as my runtime error which could mean any for loop or iterattive sequence in my program.

  • 2deck@lemmy.world
    link
    fedilink
    arrow-up
    29
    ·
    28 days ago

    To me logging combined with a quick compilation has a good flow to it. Causes you to consider what you want to see and doesn’t change the workflow if multiple stacks are involved.

  • vala@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    14
    ·
    27 days ago

    As someone who knows how to use a debugger, I can say for sure that log debugging is fine and often my first approach. If you have a good mental model of the code and the issue, it’s usually just 1-2 logs to solve the problem.

    • Victor@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      27 days ago

      Not sure why you would say that. An alert() does not show you where in the code the alert was called from. A console log would show you.

  • madcaesar@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    27 days ago

    Honestly I use debugger when I have to go deep into some library’s bullshit code. My stuff should be stable clean and understandable enough to quickly see what’s happening with console log.

    If I were to find myself needing debugger all the time with breakpoints and all this shit, it means shits has gone sideways and we need to back up and re-evaluate the code.

  • DrDystopia@lemy.lol
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    28 days ago

    It’s like the real life kraken, I’ve never seen it but the name causes dread.

    • kubica@fedia.io
      link
      fedilink
      arrow-up
      15
      ·
      28 days ago

      This is what peak performance looks like:

      console.log("before dothething");
      let r = dothething();
      console.log("after dothething");
      console.log(r);
      
  • RustyNova@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    28 days ago

    I am guilty of this but for a different reason: setting up debugging for clis in rust is hard

    I love the debugger. I use it all the time I can. But when debugging cli it’s a pain as you need to go back in the launch.json file, remake the argument list, then come back to run debug, find out why tf it doesn’t find cargo when it’s the PATH… again, then actually debug.

    • Victor@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      27 days ago

      I don’t feel at all guilty of doing this. Whatever works. Usually nothing is so complicated that I need to debug properly, instead of just inspecting some value along the way.

      In fact, if it gets the bug resolved, it is—effectively—debugging.