• henfredemars@infosec.pub
    link
    fedilink
    English
    arrow-up
    98
    ·
    3 months ago

    All the debugging tools in the world doesn’t beat an excellent sense of intuition and putting that print statement exactly where it needs to be.

      • flying_sheep@lemmy.ml
        link
        fedilink
        arrow-up
        23
        ·
        3 months ago

        He works on Linux where he controls the whole stack down to the metal and I love that for him, but other people have to call library code, and them debug that if it doesn’t work as they thought it would.

      • Cubes@lemm.ee
        link
        fedilink
        English
        arrow-up
        4
        ·
        3 months ago

        The problem is that sometimes it’s not your code that you’re debugging

  • xmunk@sh.itjust.works
    link
    fedilink
    arrow-up
    41
    arrow-down
    1
    ·
    3 months ago

    echo __LINE__ . "Moo\n";

    Honestly if you’re not including the LoC in your debug statement I don’t even fucking understand you.

    But yeah, senior devs know the power of breadcrumb debugging (because most of us were deeply scarred by gdb).

      • alqloe@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        3 months ago

        I always combine that with objects with the shorthand notation. So you always know what variable has what value without having to remember in what order you printed the variables.

        console.trace({i, list});
        // {i: 1, list: [0, 1, 2]}
        
    • psud@aussie.zone
      link
      fedilink
      arrow-up
      6
      ·
      edit-2
      3 months ago

      Don’t you want it to look a little nicer? echo __LINE__ . “: Moo!”;

      I mean, presuming cowsay is unavailable

  • Gamma@beehaw.org
    link
    fedilink
    English
    arrow-up
    31
    ·
    3 months ago

    And when you need something more complex

    console.log(1);
    […]
    console.log(2);
    […]
    console.log(3);
    
  • SteveFromMySpace@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    24
    arrow-down
    1
    ·
    3 months ago

    I feel kind of bad for shooter on the left just using stuff a lot of competitive shooters use and getting roasted for it incessantly lol

    • tyler@programming.dev
      link
      fedilink
      arrow-up
      46
      arrow-down
      1
      ·
      3 months ago

      wait she’s getting roasted for it? I haven’t seen that. It just looks like people are making fun comparisons to me.

    • Gsus4@mander.xyz
      link
      fedilink
      arrow-up
      10
      ·
      edit-2
      3 months ago

      Anybody who knows about this: how do those gizmos help? E.g. earplugs are useful without performance-enhancing.

      • kboy101222@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        20
        ·
        3 months ago

        Once you’re at this level, you’re looking to get improvements of a fraction of a percentage. I don’t know the specifics cause I’m not a pro shooter despite being American, but from other high level skill people I know, you hit a point where improvements basically plateau and you have to resort to increasingly niche products to obtain non skill improvements. If you want proof of that, check out calligraphy and fountain pen communities. The amount of money some people spend on things I didn’t know existed is wild.

        (No bad judgement to those folks, I’ve gotten hard into map making and 3d printing lately, so I’m right behind you)

      • variants@possumpat.io
        link
        fedilink
        English
        arrow-up
        10
        ·
        3 months ago

        Adjustable frames help keep the lens at the correct angle for your eyes if you tilt your head a certain way from my understanding. So if you tilt your head at a certain angle you can adjust the frame to keep your prescription from getting out of focus at that specific head tilt

        • virku@lemmy.world
          link
          fedilink
          arrow-up
          4
          ·
          3 months ago

          It is also an adjustable, external retina that allows you to let just enough light through, apparently.

    • Aabbcc@lemm.ee
      link
      fedilink
      arrow-up
      3
      ·
      3 months ago

      “Hello worl” if I need something quick

      “AAAAAAAAAAAAAAAAA” if I’m lazy and don’t want to have to hunt the output logs for it

  • Kojichan@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    3 months ago

    Ahhh, my favourite debugging combo…

    echo "<pre>"; print_r( "We are here, we are here!" ); echo "</pre>"; die();

    Also fun at parties, hanging out asynchronously, is the ever popular PHP Mail to see if something ran in the background properly, or to get output.