Oh, I got hot sause all over my bazito!

You know what this is? It's a brain sucker. You know what it's doing? Filing its tax return

If you wish to make an apple pie from scratch, you must first invent apple pie

The Adventures of Little Ed Brave

Tell airport security your name is McCannister because you can hide anything in a cannister.

You know what? Nobody notices when this changes anyway.

There are 10 types of people in the world: Those who understand binary, and STFU

What happens in a black hole stays in a black hole

The black hole draws you inexorably inward. Time slows. You are likely to be eaten by a grue.

I'd diddle little umdidlie... if she weren't my half-sister.

Abortion prevents pedophilia. In more ways than one!
Get Firefox!
I wrote a haiku

which I was about to share,

but then I thought, "screw it."
Level 1

Notice to all users of the Holodeck:

There are safety protocols in place that cannot be deactivated without the approval of two commanding officers or the captain to protect users of the Holodeck from potential harm. However, every time the Holodeck is ever used in a nontrivial manner, no matter what the safety protocols say, the Holodeck turns into a deathtrap.

Unless you believe yourself to be adept at constructing a forcefield from your communicator and 19th century Earth tools, or you're at the very least not wearing a red shirt, you are strongly advised not to attempt to use the Holodeck until a designer comes up with a safety protocol that doesn't kill you whenever somebody looks at it funny. Even when you're not on the holodeck. Or in the same quadrant. Or time period.

In fact, if you are wearing a red shirt, Starfleet may not be the job for you

Ed
« Vader Does ItalyColonel Miyazaki »
Permalink 08/08/07 at 09:38:59 am, by Ed, 207 words   English (US)
Categories: Programming

Whilst debugging a problem deep in the bowels of the product I work on, I found something that, had I not read Worse Than Failure every day, would have hurt my head. Not complicated, no. Not remotely. Anybody could understand this. It's not terrible, it's not "who did this should be fired". It's just...

default:
assert(0 == 1);

Anybody can figure that one out. Here, we are making sure that zero equals one. Of course, this could never be true. The assert function exists usually for debugging purposes, to ensure that something is true, and if it isn't, we're in trouble because something went wrong. If it does go wrong, the assert throws a fit and causes the program to close. So in this case, we are simply saying "Make sure that something that is false is true". Probably because we should never reach this section of code, and if we do, we have a problem.

The problem I see with that is, there's a much simpler way to take care of that. Just throw an error. Why bother going through the hoops of writing code that makes poor monkeys' brains hurt when you could achieve the same results with a simple throw new Exception()? Bah, I'll never know.

No feedback yet

Comments are closed for this post.