• 2deck@lemmy.world
    link
    fedilink
    arrow-up
    30
    ·
    2 天前

    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.

  • madcaesar@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 天前

    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.

  • NotSteve_@piefed.ca
    link
    fedilink
    English
    arrow-up
    12
    arrow-down
    2
    ·
    2 天前

    It drives me crazy that half my coworkers do this, including a senior dev. I’ll be on a call trying to help debug something and it makes it so difficult not being able to set a breakpoint

    • andyburke@fedia.io
      link
      fedilink
      arrow-up
      27
      ·
      2 天前

      I console.dir and debugger; and breakpoint all day. You are allowed to mix your strategies.

    • RheumatoidArthritis@mander.xyz
      link
      fedilink
      arrow-up
      5
      ·
      2 天前

      I used to do debuggers until I started doing embedded and dipped my feet in multithreading (2 different projects). After many hours lost because the debugger straight lied to me about which line of code has been executed, a colleague suggested that I just do a printf like a filthy beginner. And 🤩it worked🤩 and I never went back to the unreliable world of debuggers. Even though now I’m mostly working with single-threaded python scripts.

    • Quantenteilchen@discuss.tchncs.de
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      2 天前

      There are literally university courses which confidently state “Console logging is far more used and better so we won’t talk about a debugger here”!

      Like sure, it’s very likely to be used far more, but that doesn’t mean you shouldn’t at least offer some courses or modules about proper use of a debugger…

    • Victor@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      15 小时前

      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.

  • DrDystopia@lemy.lol
    link
    fedilink
    arrow-up
    6
    arrow-down
    1
    ·
    2 天前

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

    • kubica@fedia.io
      link
      fedilink
      arrow-up
      17
      ·
      2 天前

      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
    1
    ·
    2 天前

    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
      1
      ·
      15 小时前

      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.