Saturday, August 25, 2018

"There's No Time!"

A man was driving to a meeting and he was very late.

Every few minutes, he looked at his watch, gritted his teeth, then stamped his foot down on the accelerator.

Friday, August 24, 2018

I Can't Believe Some People Still Need Virtual Method Calls Defended

In the 1990's, a lot of people labored until the belief that indirect (virtual) method calls were expensive. After all, you have to read a value out of memory and then use that as the address of a call! How could it ever compete with the one-clock-tick-long conditional jump?

I hear this less today but I still hear it every once in a while and I'm shocked when I do because it was nonsense, even in the late nineties.

In terms of performance, it didn't matter, then, and it doesn't matter, now. I'm only addressing it because a belief that discourages the usage of virtual methods is a dangerous one which must be disabused.

Thursday, August 23, 2018

A Brief Examination of Coupling

What is coupling, exactly?

A good working definition of coupling is as follows:
A certain kind of change to X triggers a corresponding change in Y

Wednesday, August 22, 2018

Tuesday, August 21, 2018

The Coder's Code

The Boy Scout Rule states, roughly, as follows:
Always leave the trail better than you found it.
I think we can translate this to a Coder's Code. It can even be relaxed a little and still create the same effect:
Always leave the code as good as you found it or better. 

Monday, August 20, 2018

Opposition in Code Qualities Tends to Be Illusory

Generally, when it seems like two code qualities oppose one another, it means something that you're missing a piece of the puzzle.