The Two Golden Rules

Having spent time with many languages and even more time brewing coffee trying to figure out what I just screwed up and why, I had one of those rare Zen enlightenment / Eureka! moments and ever since then my hacking hours have kind of mellowed: nine times out of ten now instead of boiling the cat or kicking the coffee machine I will just look at what is giving me grief and normally the resolution is to be found within the following two rules :-

1. You spelt it wrong.
2. See Rule 1.

That's pretty much it. If you remember those (2) rules, which neatly condense into one simpler rule then you can pretty much get by.

Anytime the <your-language-here> compiler blows chunks it will be due to a mis-spelled variable name, function name or trying forgetting to include a header file in which case the name you used *may* be correct and you *may* think that Rule 1 has been subverted but not so! Grasshopper, a spelling check is made with reference to a *lexicon* of known words, in this case the it will be the symbol table that the compiler builds as it chunders its way through your project files and so, if *you* forgot to include a header file then *you* forgot to build the dictionary correctly and thus broke the spelling check. See how easy it is. (2)/(1) Rules and no more headaches!

For example; Javascript and Actionscript will pretty much let you hang yourself in a variety of different ways but say nothing at run-time, particularly Flash. If you have ever read the Flash VM / SWF documentation you will realise that the overwhelming principle for the Flash VM is "The Show Must Go On!". How very British. Except it wasn't invented here.

These days things are better of course, we have AS3 and its improved compiler with improved error detection and typing and all that stuff and for Javascript, you *must* of course be using Firefox and Firebug for any decent chance at all. But in the *old* days life was tougher!

To this effect, if the Flash VM has any issues with code that *compiled* correctly but is complete nonsense then it will fail silently and just try to blag its way to the next frame and so on and so FORTH. FORTH for the Flash VM... Now that has me thinking... See y'all later... :)

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <pre> <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or class="OPTIONS" [title="the title"].
  • Lines and paragraphs break automatically.

Full HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or class="OPTIONS" [title="the title"].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.