Live data from Hacker News

Ask HN: What horrible things do you do in your own code when no one is watching?

news.ycombinator.com

21–30 of 40 posts

Re: Ask HN: What horrible things do you do in your own code when no one is watching?

#23

I'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?

#24

Profanity. It can look like a key party got out of hand in there. Use g for a string variable at least once.

What's the significance of using 'g' as a variable name?

Not just variable name a "string" variable name,

See g string ^^

Re: Ask HN: What horrible things do you do in your own code when no one is watching?

#25
Perl 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?

#28

Ditch 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?

#29
Writing 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.
Post reply on HN