Profanity. It can look like a key party got out of hand in there. Use g for a string variable at least once.
Ask HN: What horrible things do you do in your own code when no one is watching?
21–30 of 40 posts
What's the significance of using 'g' as a variable name?
Re: Ask HN: What horrible things do you do in your own code when no one is watching?
#22Profanity. It can look like a key party got out of hand in there. Use g for a string variable at least once.
I got bitched out by a boss once for using the number 666 in a unit test.
Re: Ask HN: What horrible things do you do in your own code when no one is watching?
#23I'll write tests when the product makes money.
At least write test on payment stuff, I learned the hard way by screwing up payment system when user emailed me why he can't go through payment.
It really amazes me how many companies (especially the ones with an avaricious reputation such as health insurance companies) don't take the payment system seriously.
Re: Ask HN: What horrible things do you do in your own code when no one is watching?
#24Re: Ask HN: What horrible things do you do in your own code when no one is watching?
#25Perl one-liners in bash scripts. The kind that don't use spaces or bracket. Of course one-character variable names and use of special variables like $\, $| or $& (http://perldoc.perl.org/perlvar.html). Execute code withing regular expressions. Almost obfuscation. I assume they break whenever a new minor version of Perl is released.
Re: Ask HN: What horrible things do you do in your own code when no one is watching?
#26Like 3 nested listcomps on one line (Python).
Re: Ask HN: What horrible things do you do in your own code when no one is watching?
#27Skipping tests...
Story of my life, unless someone is paying for it.
Re: Ask HN: What horrible things do you do in your own code when no one is watching?
#28Ditch optparse or argparse -- "flag = '--flag' in sys.argv" or "if len(sys.argv) > 1: arg = sys.argv[1]" will usually do...
Nice. Haha I use a switch statement:
process.argv.forEach((arg, i, argv) => {
switch (arg) {
case "--foo":
foo = argv[i + 1]
break
case "--bar":
bar = argv[i + 1]
break
}
})Re: Ask HN: What horrible things do you do in your own code when no one is watching?
#29Writing an entire app in a single file that ends up being a few thousand lines of code. It started as a few hundred, but grew from there (like always), and now there's no turning back until it's launched and validated! No use wasting time refactoring until I know it'll work.
Re: Ask HN: What horrible things do you do in your own code when no one is watching?
#30Writing extensive TODO comments for future features instead of actually implementing them. Never read a single ToDo comment afterwards. Ever.