104
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?
  • 2
    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
Add Comment