103
Comments
  • 4
    I wouldn't say print("test") is that badass as depicted.
  • 2
    I like doing it as stupidly as possible.

    works in JS.

    debug = function (msg, status) {

    let currentStatus;

    if(status === 0) {
    currentStatus = "[+]";
    } else if(status ===1) {
    currentStatus = "[*]";
    } else if(status === 2) {
    currentStatus = "[!]";
    }

    console.log(currentStatus + " " + msg + "\n");

    }
  • 3
    Nothing wrong with simplicity 🤷‍♀

    Powerful debugging tools often have side effects as well. Some make your code slow, or interact with code in unpredictable ways... so if some dump or log statement works for your purposes, why not.

    One trick I find essential though is to add some kind of test to the CI/deployment which fails if debug statements are present.
  • 0
    Is there other way with php?
  • 3
    I don't do print("test"). I do print("aaaaa"). Most people some know it's power
  • 1
    @Ranchu

    let currentStatus = ['[+]', '[*]', '[!]'][status];
  • 1
    @AlgoRythm This is great.
    Actually thanks, I'll use it
  • 1
    Print("ass")
    ...
    Print("butts")
    ...
    ...
    Print("big butts")
    ...
    ...
    ...
    Print("asses")
    ...
    Print("ass butt")
  • 0
    I agree with you
  • 0
    @Jemis Thanks for sharing this post!
  • 0
    Great info
  • 0
    Think of it like a beginner guitarist learning how to strum a chord. This isn't a rock star solo, but it's the foundation for learning to play a song. https://fnafonline.io
  • 0
    printf(“i am here”); you know for the control flow
  • 0
    When tackling a complex issue, don’t just rely on one tool—leverage a combination of IDE features, network analyzers, and other debugging aids. The key is to be methodical and use each tool to its fullest potential to pinpoint and resolve issues.
  • 0
    When tackling a complex issue, don’t just rely on one tool—leverage a combination of IDE features, network analyzers, and other debugging aids. The key is to be methodical and use each tool to its fullest potential to pinpoint and resolve issues.
Add Comment