

WAT the WTF do programmers use as debug strings? - hodgesmr
http://zachholman.com/posts/debug-strings/

======
forgottenpass

        "\x1B[1;36;40m" "\n" "\x1B[0;37;40m"
    

I keep a file sitting around with versions for different colors/languages.

~~~
splawn
Thank you for this idea! My worst days will now be in color from now on. :)

------
bandy
Really? I give location and context and the Why of the message. I make sure
that every message is unique (unlike the code I changed in a certain once-
prominent US firm's three-letter operating system) as well. I clearly know
nothing and shouldn't be in the profession.

~~~
caruana
really? i think you might be mistaking exception logging for quick debug
lines, like when a certain line isn't being hit for some reason and you just
want to quickly know if it does hit. you would clearly delete these quick
messages before checking in. No need to get so dramatic ...

~~~
bandy
Really. Identical error and debugging messages that might as well have all
said "Foo!" across a 300,000+ LOC subsystem.

------
RossM
In PHP I tend to do something like:

    
    
        dd(__DIR__.'/'.__FILE__.':'.__LINE__);
    

Which prints out the current script and line, and then stops execution (where
dd is var_dump+exit).

------
jweather
"this should never happen" and/or "how did you get here?"

------
claudiowilson
I use the ever eloquent, "yolo".

------
NoodleIncident
herp, derp, flurp, and slurp are immensely useful words for one-off variables
in an interactive interpreter.

