Geek Smithology

April 23, 2006

Coca Cola Blak

Filed under: Taste by Nathan @ 4:42 pm

Apparently I’m late to the party, but I just heard about Coke Blak, a coffee flavoured soda.

Thought 1: “This is disgusting”
Thought 2: “Is there anywhere I can find this in Calgary?”

April 20, 2006

SOA – Who cares?

Filed under: Craft of Dev,Industry by Nathan @ 9:14 pm

…’SOA’ might have meant something once but now it’s just vendor bullshit.

So relates Tim Bray in a recent blog post, and I say “hear, hear!” Whether an open SOAP layer over a JMS queue or a RESTful HTTP GET from one Perl CGI script to another, anyone that’s been in the trenches for a few years has done SOA.

Yet, the architecture astronauts have struck again, claiming that every system and process can be reduced to a series of “services.” But this abstraction is so high (and leaky) that businesses are lead to believe that unless they spend thousands of dollars on middleware and employ a team of EAI surgeons, they are doomed. I admit that these solutions can be appropriate, but I also smell charlatans with hammers seeing a lot of nails. Eventually ESBs and MOM will go the way of the RDBMS, making the transition from proprietary goldmine for experts to commodity for the masses. Even now there are open source alternatives (like Mule) emerging.

So what’s the point? We, as an industry, need to stop pushing architectures to proselytize on behalf of vendors, and start producing solutions based on what our clients actually need. And when the next “paradigm shifting” tool arrives, we don’t hold it high as the new aegis under which we play upon FUD to fill industry coffers.

Rather, we relegate the gewgaw to the toolbox — where it belongs.

April 19, 2006

Expertise is Overrated, or Why I Hate Design Patterns

Filed under: Craft of Dev by Nathan @ 3:00 pm

I know, let’s build a Facade using a Strategy that takes a Command to build its Memento and we can modify it using a Builder! Oh, and I think it should be a Singleton.
– famous last words, number 629 in a series

A few weeks ago, a colleague mentioned in passing that he had spoken with a more junior developer who was attempting to bridge the gap between procedural and object oriented programming starting with Design Patterns. Talk about shifting paradigms without a clutch!

According to the Dreyfus model of skill acquisition, experts come to rely on intuition and experience whereas novices depend on explicit instructions and detailed rules. Yet many a sage ur-guru has suggested the path to object oriented enlightenment crosses through the valley of the Gang of Four. I call this the expert’s folly.

Design Patterns are descriptive, not prescriptive. While the wizards may describe their caching policy as a “Decorated Proxy” using a convenient shared vocabulary, novices barking their shins in the dark create Singletons and States without any regard for data encapsulation, domain modularity, or coherent behaviour. It’s the Golden rule turned lead. Experts feed advice they would like when following the Platinum Rule would yield smoother sailing.

It is often said that those who can, do; those who cannot, teach. But that glorifies the wrong side of the scale. It’s easy to perform based on your intuition, but very difficult to teach based on your understanding. I think this ancient aphorism needs an update:

Those who cannot teach, merely do.

April 18, 2006

Continous Integration: A Pit and a Pendulum

Filed under: Craft of Dev by Nathan @ 6:54 am

Discomfort sets in slowly. Inexorably, what began as mere annoyance blossoms into full blown torture. As minutes tick by, that splash of crimson in the corner gives rise to feeling of uneasiness, tension; creeping dread. Am I in some phantasmagorical horror prison under the relentless march of some medieval inquisitor? No, I’m on a project when the build is broken, the team is looking at it, and the ETA is a Carmack-esqe when it’s done.

The build machine in a continuous integration environment can be seen as the heartbeat of the project, but it’s also a mood ring and Neal Peart wrapped up in one tiny little package. When the build is green, all is well; when it’s red, all bets are off.

Most breaks are nothing more than a forgotten file; they are fixed and forgotten almost instantaneously. But disquiet sets in when the build stays broken and anguished cries of but it works on my machine! hang heavy in the air (like a dulling wine). Developers accustomed to four or six commits a day are dragged kicking and screaming out of the zone as all hands reluctantly find their place on the deck.

We come out scathed and unscathed in our own ways, but the moral our inner Aesop craves is thus: continuous integration is about creating an atmosphere of peace and love and the accompanying desire to maintain equilibrium. Developers start to get uncomfortable if more than a few hours go by without making their mark in the world and see keeping that little icon green as something meaningful: pleasure via pain prevention.

How singular is the thing called pleasure, and how curiously related to pain, which might be thought to be the opposite of it; for they never come to a man together, and yet he who pursues either of them is generally compelled to take the other.
– Socrates

A journey of a thousand miles begins with a single step; a software project consisting of a thousand stories begins with a single commit.

April 17, 2006

I’m a bad fan.

Filed under: Sports by Nathan @ 3:46 pm

The Avs didn’t win their division this year. I should feel something, but I don’t. Even though the dozens of Flames “fans” that have materialized since Kiprusoff started pulling the bandwagon two years ago are chiding me and my team, all I can say is “well, they had their 10 years, it’s nice someone else can win.” And I’m glad it’s Calgary – while I find their style[1] insomnia-curing, Edmonton or Vancouver winning the division would be a travesty. In typical non-sensical sports fan style, I hate Vancouver because Bertuzzi is a jerk and the Sedin twins are ugly. And Edmonton? As a resident of Cowtown, while I don’t cheer for the Flames, I do cheer against the Oil.

I’m funny that way.

Do I think the Flames will win the cup? Only if Kiprusoff remains uninjured. Calgary is a low-scoring, grinding team that relies on their goalie more than anyone since the 1993 Canadiens. Yes, Iginla is great[2], Phaneuf is the real deal, and there is a handful of other contenders, but if Kipper blows a hip… Plus, they’re coming in as one of the favourites instead of a “we-made-it-on-the-last-day-of-the-season” Cinderella story, and the Detroit of 2006 is not the same as the Detroit of 2004 (as another President’s Trophy will attest.)

Of course, if New Jersey proved anything back in 1995, it’s that you can bore your way to a Stanley Cup. Oh, and that “winning goal” that didn’t count last time? It wasn’t a goal. I just wanted everyone to know.

Am I bitter? Of course I am.

I’m funny that way.

[1] I know, I know, not generally a word one hears when describing the Calgary game.
[2] But watching Iggy shine in the Olympics (moreso in 2002 when he was on a line with Sakic and Yzerman) shows you just how much the Calgary game stifles what he could be.

April 16, 2006

The World is Not Your Ashtray…

Filed under: Grab Bag by Nathan @ 3:28 pm

…but it is my lavatory. Kidding!

Saw a post over on the Dilbert Blog about smokers rolling down the window when they smoke in their cars. Personally, I can’t imagine why the hell somebody would want to smoke with the windows up, and while the stink sickens (if you don’t smoke, a single cigarette a block away will be noticed), the practice, as a whole, doesn’t really bother me.

What does really bother me is smokers that throw the butt out of the window after they’re done, especially if it’s still lit. Sometimes I feel like running them off the road. Of course, a lot of these butt throwers drive SUVs, and if Hondas are bad for smoking[1], they’re even worse for running SUV’s off the road.

We’ve all got our bad habits (and, really, smoking is a rung up from watching Temptation Island on purpose and liking it), but that doesn’t mean we have to be jerks about it.

[1] When we bought our Honda, an ashtray w/ lighter wasn’t even an option…

April 5, 2006

TDD: Rocky Lhotka doesn’t get it

Filed under: Craft of Dev by Nathan @ 10:12 pm

I detest what you say, but will defend to the death your right to say it. – Hall

…but you’re wrong. – Smith

I enjoy debate. I like comparative discussions about technologies, and learning about how people think and how they work. And I can generally sense that point at which the only solution is to agree to disagree.

But when somebody who is clearly misguided starts spouting off about something they obviously have not investigated in a forum where they can have undue influence, I get a little belligerent. You know how it gets: blood spilled, oaths sworn, composure lost.

I heard this during my commute and I was so infuriated I had to write something. In Episode 169 of the .NET Rocks! podcast, guest Rocky Lhotka spews more misinformation about Test Driven Development (TDD) in four minutes than an hour’s worth of MSDN articles.

Shall we?

Rocky: My major critique, really, is that it I think comes out of a different world from most of us that have spent many years working in the Microsoft space. I think a world where the tools that we’re used to, that we just take for granted, haven’t existed.

Haven’t existed? I’m currently developing in C#, but I come from the Java space. They have IDEs that have long since eclipsed Visual Studio as the brightest star in the IDE firmament.

Rocky: So test driven development comes from the premise that you don’t have Intellisense and all of these other cool things, most of which we lose if we sit down to start writing tests before we start writing code.

In my experience, Intellisense is useless exactly once during the TDD cycle: when the method doesn’t exist. But naming that method is a design decision and I’m comfortable with no Inellisense. It turns out that when you’re calling a method from within a test, there is a subconscious mental shift towards designing for usability rather than writability. A testable method is a callable method. Method names stay sensible, parameter lists make sense, and side effects are minimized. Oh, and after I type the name, I just press Alt-Shift-F10 and generate the stub.

Rocky: I think it’s really a subtle ordering of events. If you sit down and say I’m going to write all my tests first. I’m going to write a bunch of code to test things that don’t exist. Well, this is true, but on a larger system I’m not convinced that that’s overly realistic.

Nobody doing TDD writes all their tests first. You write a failing test. You pass the test with the minimum amount of code possible, then you write the next test. Generally you’ll be writing 5-10 lines to test things that don’t exist. But then you make it exist. That’s the point. As for larger systems, TDD enforces modularity and clean tier separation. So it’s still a good idea.

After this, one of the hosts puts his foot so far into his mouth it comes out the back of his head…

DNR: I’m almost seeing that the antithesis of test driven development is this fast refactor cycle that we get into writing code where I write a bit of code, I look how it behaves, I write a bit more code, then I refactor it to consolidate some functionality and then do it again…something that really fights against test driven development.
Rocky: Interestingly, at least in theory, both ideas come from the same space (Agile) so you wouldn’t think they’d fight, but they do.
DNR: Because if I’ve gone through the effort of developing that test so that I have a standardized behaviour, I’m not willing to refactor it and break my tests.

I’m only willing to refactor if I have a comprehensive set of unit tests to back me up. If I break a test, it means I broke the system.

What happens if you refactor and there are no tests to break? Maybe you didn’t break anything. Maybe you did. Maybe your customer will find out for you. Refactoring without unit tests is the software equivalent of Russian Roulette. Remember the Deer Hunter, my friends.

Remember the Deer Hunter.

Powered by WordPress