• Haus@kbin.social
    link
    fedilink
    arrow-up
    28
    ·
    edit-2
    1 year ago

    Bad variable names and then awful “temporary” log lines… I feel attacked this morning. ;)

    • LasagnaCat@lemmy.world
      link
      fedilink
      arrow-up
      9
      arrow-down
      2
      ·
      edit-2
      1 year ago

      It blows my mind how often i see people using temp logs for debugging when breakpoints exist

      • deegeese@sopuli.xyz
        link
        fedilink
        arrow-up
        16
        arrow-down
        1
        ·
        1 year ago

        When the issue is only seen after hours of runtime, logging is more practical.

      • XTornado@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        Idk… I had problems in the past with weird bugs where the breakpoints do not match the right line although using sourcemaps and all that so sometimes you end up doing stuff like this. Or if you want to know how many times something executes without well having to “continue” on each breakpoint or similar.

  • sebi@lemmy.world
    link
    fedilink
    arrow-up
    21
    ·
    1 year ago

    This is a professional debug techique, what are you talking about? But I rather use ‘Hii’ with various (but not ascending) amounts of i’s.

    • andrew@lemmy.stuart.fun
      link
      fedilink
      English
      arrow-up
      6
      ·
      edit-2
      1 year ago

      Sometimes I use various swears. Depends on how long I’ve had to debug. Also depends on whose work I’m debugging and whether they’re in earshot. Usually it’s just my own sketchy code though.

    • dbilitated@aussie.zone
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      I’ve used a regex to add a console log to the top of every method with the method name before.

      the things you do when you’re desperate.

  • elxeno@lemm.ee
    link
    fedilink
    arrow-up
    4
    ·
    1 year ago
    var num =0
    ...
    console.log("Here " + num++)
    ...
    console.log("Here " + num++)