Monday, July 30, 2007

A Few Words About Tea

I just bought several boxes of new tea for work. I am struggling to get one of them open (they are sealed with plastic wrap) and had no scissors (we aren't allowed to have them apparently). I was using a key to "slice" away a square of wrap at one end of the box, and got it removed, only to see the thin golden line of the "open" ribbon. Obviously a wtf-lol moment.

So it is with starting something new.

You have the excitement of just getting the thing open, but you really should take a step back and look at the entire package first.

Oh yes, it was Darjeeling.

Friday, July 27, 2007

Code Without Tests is Like A Life Without Sunshine

It is incredibly hard to move between codebases with/without automated testing, especially moving in the without direction.

I have never been so scared-shitless as when recently deploying a new build of such a codebase.

I have been very careful to avoid touching it as much as possible, but nevertheless must deploy it: the partially-to-untested work of others.

There were deployment and operational problems, mostly due to:

  • no automated tests,
  • no test suites,
  • insufficient test environment, i.e. not all devices present on-site are available for developers to test with,
  • no clean install environment, to test for installation issues.

It should be no surprise that we got bitten by all of the above. Nothing like doing your development in-the-field. Obviously this can't always be avoided, but taking measures can minimize it.

The sad part is we may not be able to reproduce the recorded defects, due to the aforementioned reasons. I'm only happy I won't be the one single-stepping through the debugger....

Yes, people still do that; the ones without tests. It's like using a microscope to inspect an elephant.

Thursday, July 26, 2007

Interview With A Vampire

The following is an indulgent self-interview with the author.

So The Gassy One: what kind of fucked-up moniker is that?

It's one that goes with the title of the blog.

And what's up with the Italian? Are you some kind of fascist?

That depends. It was just something I used to say, started during a trip to Italy, if-you-get-my-drift. Plus it goes with the moniker. I show up at the top of a Google Search by the blog's title, so I'm pretty happy with that.

And you won't translate that for us?

I think everyone can figure it out.

So what inspired this blog?

Mostly phone call rant sessions with other programmer friends. Also from reading lots of blogs; I track over 70 blogs a day, and add to that as necessary.

That's a lot of blogs. What do you supervisors think about all that non-billable time?

Let's just say the research usually finds its way into current projects. Next question please....

What's the fascination with UK English?

Started a long time ago, probably from watching Monty Python. I didn't start actually getting the idioms until well into adulthood. Then of course there are the accents.

So what is your favorite programming activity?

Most probably Refactoring. That activity of incremental improvement, the fight against Entropy. I certainly enjoy Test Driven Development techniques, and working on non-TDD projects is becoming a real sore spot.

What's up with all the Wikipedia shit? Are you some kind of shill or what?

Let's face it, there's stuff in here that not everyone knows about, including me, and the references are a boon to giving the reader something else to do, expand their horizons perhaps, within the context of this blog. I want to stay informational, and not link to ad-laden crap, if possible.

How noble.

(in the style of Commander McBragg) Yes, quite.

Wednesday, July 25, 2007

What Could Be Worse?

If you can't laugh at (and possibly learn from) your own mistakes, perhaps you can bask in the glory(?) of another's misfortunes.

I have to say that this is one of my favorite blogs.

Tuesday, July 24, 2007

A Word-to-Quadword About int

In UK English, they have turned a contraction into an even-shorter contraction.

The word in''t is a further contraction of isn't. Not sure of the actual spelling of this; first heard on the Chris Moyles Show or maybe Coronation Street.

Combined with some other delicious idiomatic grammar, you get sentences like

It in''t in t'tin.

Say that 3 times fast, then translate into US English.

And you thought in''t was a datatype....

Monday, July 23, 2007

Service Container is the Best Thing Since Timesliced Bread

Ever been struggling with the ever-morphing parameter list?

Or perhaps you've been struggling with coupling issues?

The Service Container is your salvation!

It is basically a dictionary keyed by type, typically an interface type. Need to pass that ICrucialInterface down the call chain? Just stuff it in there.

Important to recognize is that only the creator of the Service Container usually has the ability to populate it. Once populated, read-only access is assumed. This is accomplished with appropriate interfaces. In .NET these are called IServiceProvider (read-only) and IServiceContainer (read-write).

Service containers may be chained together in parent/child linkage. The holder of a reference to a child container also gains access to all "higher" levels of linkage.

The biggest benefit here is that you are future-proof. If the universe of parameters changes, there are no messy signature refactorings to contend with. Package boundaries remain pristine.

This is the classic early-vs-late binding tradeoff.

"So where's the down side, since you said it's a tradeoff?"

Ok, busted. There is one minor one, but this can quickly be turned into an advantage.

The bummer here is since you are now loosely coupled to the universe, you must physically dig every last reference out of the container before use. This can be advantaged by changing mindset to a dynamic mode, where nothing is required, and the logic accounts for this (unlike WestWorld....)

Couldn't find a reference to the ICrucialInterface? Either degrade gracefully (i.e. use the INotSoCrucialInterface), or throw an exception.

The chaining of Service Containers into a hierarchy can alter the scope of what is visible to downstream call sites. At any point, a caller can add to the container chain and use it in calls.

Thursday, July 19, 2007

What Skill!?

I tell you, they just think you are skilled in every aspect, just because you know a little.

It's like speaking a foreign country's native language, then all of a sudden they think you are fluent, and a torrent of language comes flying at you.

Anyway, they are trying to connect devices together over a serial cable.

"There's no way to tell if there's something running on the other side..."

Now mind you, this is an embedded systems person talking. I had to pipe up, since I actually had to learn about RS-232 communication.

"Yes there is, it's called 'handshaking'....

Monday, July 9, 2007

Non-determinstic finalization as a Design Pattern

Sounds like an April Fool's Day topic, doesn't it?

Or perhaps your mind is just reeling with the possibilities?

It is really the ultimate race condition; you never know when it will really be called, so it better be synchronized!

Forget for a second that we are talking about finalization, but you really do want that to be thread-safe. Not much tolerance for freeing unmanaged resources multiple times.

Think of it for a second; a system where everything gets constructed, but then nothing happens until things start destructing, and destruct they will!

Don't be afraid to abuse your garbage collector. Lock away, allocate more; let your conscience be your guide....

Disclaimer

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