Feb 20, 2014

Conrad's Programming Axioms

Here's a good set of general laws for the universe: laws of the universe. Here are my programming axioms:

Ledlogic's Axioms

  1. If you change your program to generate a different result, and the results do not change, it's not using your code.
    • It may not have compiled successfully, and in the state where previous code is not deleted, you are essentially running old code.
    • Your code is in a different class, it has been overridden.
    • You are editing code in a different branch, or in a compiled directory not the source directory.
    • You code was not deployed (to all servers?), or a subsequent deployment overwrote your code.
    • There's an error in previous code failing before your code is executed
  2. The smallest change to your code that will cause it to fail is precisely one character.
    • Adding a ` to the first line in an XML file.
    • Adding a semicolon after an if in Java/Javascript.
    • Missing a semicolon (or including it) in SQL depending on the file type.
  3. If you log information, log actual information.
    • What was the condition in which it occurred.
    • A needle is easy to find if you don't throw it in the haystack in the first place.

No comments:

Post a Comment