Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
WAT the WTF do programmers use as debug strings? (zachholman.com)
7 points by _kcn8 on Nov 6, 2013 | hide | past | favorite | 10 comments


    "\x1B[1;36;40m" "\n" "\x1B[0;37;40m"
I keep a file sitting around with versions for different colors/languages.


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


Any chance you could chuck those on a gist? Sounds mighty handy!


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.


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 ...


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


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).


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


I use the ever eloquent, "yolo".


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




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: