Programming Gotchas

What are gotchas? They’re itty-bitty details that will bite you because you didn’t say the secret word or rub your belly 3 times while pressing the Enter key. Gotcha!

Internet Explorer

  • You can’t have a popup window with a space in the name.
  • When making an HTA, don’t open links inside the HTA. You can’t use javascript:void(0) links, as it tries to open it as a new page and you get pleasant security warnings. Use “#” (which, unfortunately, can cause you to jump around the screen. Then use #top…)

Firefox




Programming

  • Always, always rebuild clean. Check this first – you could be using old files, be in the wrong directory, or in the wrong terminal window.

Shell Scripting

  • Beware newlines: Ran a commmand like this ver = “svn info | grep “Revision” | gawk …” to parse some input. Unfortunately, did not “chomp” off the newline at the end. The newline went into other commands, caused problems, and was hard to see.

Javascript

  • object[name] != object['name']. Beware a string in variable name and the string “name”. Confusing? Yes. Maybe there’s something to hungarian notation after all (no, no, just kidding!)

  • CSS: font-size: 10px becomes variable object.style.fontSize in javascript. CSS proprties without dashes are the same (i.e., height).

  • onpaste/oninput detects paste events inside an input area from the mouse (onkeypress won’t work).

Apache

  • Need the qsa flag in order to pass the query string through for mod-rewrite rules (otherwise, you just get the page and not the query).

WordPress

  • If your comments disappear suddenly, do a repair table with PhpMyAdmin (Operations > Repair Table)

Join 450k Monthly Readers

Enjoy the article? There's plenty more to help you build a lasting, intuitive understanding of math. Join the newsletter for bonus content and the latest updates.