Tuesday, October 21, 2008

Pledge Drive

Since my local Public Radio Station is having their periodic Pledge Drive, I figure "Why the Hell Not?" I will try my best to emulate the mood, and if you stop reading before the end of this post, My Job Here Is Done. On the upside, my Pledge Drive will only last for One Post, and not an entire week, so you can tune back in tomorrow without fear!

This is a shameless plea for membership, in the form of Followers! If you are on this blog already, chances are you didn't get here by accident. But hey, maybe you did!

If you are here visiting for The First Time, please take a moment and register as a Follower. Consider this the blogging equivalent of a donation to TEEG, to keep us operating for another year!

In return for your patronage, I promise to continue to provide the quality ranting you've come to expect from TEEG. Not to mention those comics imported all the way from ToonDoo at great embedding expense to us.

As you can see from The Gutter, we have surprassed our blogging target of 30 posts for the year, with more quality mumblings in-the-pipe. You can guarantee the continued flow of vitriol by simply registering as a Follower. So just go ahead and click on that link!

Because as you know, without the support of Followers Like You, blogs like TEEG will just cease to exist, and you will be left with mindless crap like CNET News to fill your RSS Aggregator with!

It is your Followership that keeps this blog from being overrun with blocks of Google AdWords so thick you can't even find the delicately-crafted prose we are so proud of here at TEEG.

I think I'm gonna yak now....

Okay, but register first! It's way less painful than hitting a click-through ad, which generates fractional-pennies for us, but no prestige....

Thursday, October 16, 2008

PSA For Control Structures

Stay tuned for an Important Message from The Code Nazi....

I think it's time we increased awareness of our use of control structures! Here is my cartoonish attempt to make everyone more aware of how they use if statements:

As you know, p and q are our old friends from Probability Theory. In the realm of if, our friend p is the probability we will reach the if branch, and our other friend (portrayed as El Diablo in the comic) q is the probability we will reach the else branch.

Now, some programmers, who really suck by-the-by, practice what I call the Optimistic Programming Model. This is a delusional dream-world where no remote resource is ever unavailable, there is no network latency, disk space and memory are unbounded, and nothing else runs on the user's platform but your stuff.

You can easily identify this style by a distinct lack of tests for API failure coupled with a typical lack of exception handling to scope errors, when problems arise (and they do).

The user's experience with this style of system is rarely satisfying, as the system is extremely brittle, sensitive to the smallest perturbation in its environment.

My ultimate anecdote of this goes way back to a previous job in a different century, where everything was in PDP-11 assembly, and we also wrote the OS as well. Somewhere in the system, someone decided that execution would never get here (there was even a comment to that effect), and programmed a HALT instruction.

In our system, a HALT would dump the CPU right to the debug console ODT and its delightful @ prompt.

This wouldn't hurt so bad, except we were running a factory automation supervisory control platform. You know execution found its way to that location eventually.

For extra credit, calculate the number of pissed-off plant management personnel the execution of that instruction generated.

See this blog post for an analysis of someone's work in this field. Yes folks, CreateWindow() can fail.

Hey, didn't you say "Else-less If Kills You Stiff"?

I did. Good thing we have TDD and coverage analysis tools, for those smart enough to use them.

The really bad part is we rarely know even estimates of our friends p and q! By ignoring one branch of the decision, you are ignoring an untold percentage of problems that are the responsibility of that branch, whether you did it wrong or ignored it completely!

This leads to the polar opposite programming model, the Pessimistic Programming Model, where everything that can fail is treated like it will fail, return values are accounted for, and every if has its else. This alone can relieve some level of exception handling, because you covered your probabilities completely.

Just remember, if you think "it will never get here" you are wrong. It will find its way there, just when you are ready to leave on vacation....

Thursday, October 9, 2008

Message To CEOs and Our Government

Danger Will Robinson! Eco-Political tirade ahead...

I am totally convinced that if we go after everyone who escaped the total tanking of our financial complex with big fat paychecks in the 10s-of-millions of US Dollars, we can recoup several hundred millions, which can be put to good use on the Big Bailout itself.

And as for that Big Fat Party AIG threw, all I can say is "Good thing I wasn't there with a CCW!"

Thanks to our de-regulation-oriented political party, the abject greed of these useless fucks is laid bare for all to see, and boy are we pissed!

Not that any of you CEO-fucks would care, but here is a chance for you to actually do the right thing for everyone for once in your greed-infested lives, and give that fucking money back to us, it's ours!

And if that doesn't work, here is a plea to anyone willing to subvert the system for you to declare it Open Season on overpaid executives, wink-wink-nudge-nudge.

Wabbit season!? Duck season!?

No, it's CEO Season...

Disclaimer

Look, this is humor, so put away the flame-thrower! Just have a laugh and go on your merry way....