Armen Chakmakjian

Archive for February, 2010|Monthly archive page

LOL this mornin…code smells

In Random on February 27, 2010 at 8:37 pm

Now I have heard everything. I was doing my Saturday morning ritual, Panera Bread, going through various reading material, both in print and online. Got a new copy of the IEEE transactions on Software Engineering and looked at the second article.

Now for those who’ve never been programmers of any sort, let me put it this way: the act and result of coding elicits the creative instincts in people many ways.  Sometimes its the algorithm itself, the steps to solving the problem at hand.  Sometimes it is in the descriptions and metaphors used to describe someone else’s code, which can range from naturalistic, mechanistic, industrial, post-industrial, dietetic, and space-age and sometime scatological.  We can say that a piece of code is “scary” or “tight”.  We can say it’s “shitty” or “clean”.  We can say it’s “spaghetti” or “straight-line”.   From the hardware side of things we have the concept of a “rat’s nest” and a “dead bug” (The former being a tangle of wires, the latter actually being a chip flipped on its back on top of another chip used process a signal in a different way because of a flaw found).  Anyway the “spaghetti” vs “straight-line” code are actually both pejoratives.

Spaghetti usually refers to code that is almost in comprehensible in the paths through which you go through it.  It’s sort of the software equivalent of a “rat’s nest”.  “Straight-line” usually means someone doesn’t know how to code, and just writes exactly what to do, line after line.  Usually people grow out of that with training (or they stop coding).

So back to my reading material.  The second article in this months Transactions got me laughing.  The writers introduced me to a new metaphor…almost a euphemism for shitty (since this is a trade and scholarly publication).   Here’s the name of the article:

A Method for Specification and Detection of Code and Design Smells

I almost spit up my coffee.  Actually I did spit up my coffee…when I read the first paragraph. And I quote:

“Software systems need to evolve continually to cope with ever-changing requirements and environments. However, opposite to design patterns, code and design smells – “poor” solutions to recurring implementation and design problems – may hinder  their evolution by making it hard for software engineers to carry out their changes.”

I was rip roaring at this point.  Smell? ok so I suppose by calling code “shitty” it evokes smell as well as other characteristics but “Smell” on its own just got to me.

About the third paragraph the writers pay homage to the ancient metaphor:

“One example of a design smell is the Spaghetti Code anti-pattern, which is characteristic of procedural thinking in object-oriented code.”

Why thank you…

Anyway the article goes on for a few pages and Section 2 is called “Description of Smells”

I was having a hard time keeping myself contained at this point.  Section 2.2 was “Detection Techniques” none of which were olfactory I was glad to find out.

Later on they provide a table of “Smells” creating a new category for bad code with this metaphor

  1. blob
  2. spaghetti
  3. functional decomposition
  4. swiss army knife

All I have to say is that abstracting that up to the metaphor of “Smell” just didn’t work.  Maybe this is a post-industrial answer to diving into the code…a biological explanation for what was once considered “detective” work.

They end the article by saying that “The detection of smells is important to improve the quality of software systems…”

I just don’t think I’ll be going around to the software engineers on my team asking them if they have found any smells in the code.   But maybe the idea will catch on and years from now, with noses curled we’ll look at our coding past and remember the day we had to refactor a smell…rather than talk about our coding “war-stories”


RIP Al Haig…

In politics, Random on February 21, 2010 at 1:15 am

So this morning I was reading the WSJ online and saw the update that Al Haig had died.  Haig was a staple in the news of the 70’s and the 80’s, coincident with my own growing awareness that the world had a lot of moving parts.

I remember at 16 watching the news in horror when Reagan was elected (in my youth I was an unabashed liberal…later I then went zealous conservative after Reagan…now it is more muddled, so leave me alone). Anyway, I found out about Al Haig on the news of the senate hearing confirming him as the new Secretary of State.  I heard he had something to do with Nixon.  That was bad.

I remember about a year later or so when I was walking through the Rec Complex at my high school, Fairfield Prep, I heard that President Reagan had been shot.  People were watching it on little motorola TV’s.  Then at the nightly news I saw the infamous Al Haig statement. “I’m in charge in at the White House until the Vice-President gets back” or whatever he said.

We were all of course mortified that someone shot the president, but more mystified by his statement.  It became a joke.  Any time the leader of some event or the captain of team was late, someone would shout out, “I’m in charge, I’m in control”

In later years, I’d use the same comment in emails whenever I was the only manager in the building for whatever reason.  “Being that this is my Al Haig moment…”  A few people got the joke…

A few years ago, I was listening to NPR and they played the tapes of the conversation between Cap Weinberger and Al Haig about what should be said to the press to reassure them that the wheels of government were ok.  In the end they did both think that what he was about to say rang true and would not be controversial:  That the White House was all set, that someone was taking care of things and that they were in contact with the Vice President…with that context it didn’t sound like the power-grab that the press played it up as.

Anyway, I guess I’ll hang up that joke for now.  It might spill out some day again.  And even less people will get it.

RIP General

Kindle subscription updates…

In Business & Finance, Kindle, technology on February 18, 2010 at 3:00 am

Well I still get the Atlantic.  At 1.25 a month I do get at least that much enjoyment reading it on the Kindle.

I just cancelled my free trial subscription to the Financial Times.  I did that with much regret and I might consider getting it again after trying out a couple of other subscription offers.  I really enjoyed the writing and the depth of the main articles and the breadth of topics overall.  My only limitation was time.  I just don’t have the time to read it every day in full and feel bad that I can’t make the time.

I’m now doing a trial subscription to The Economist.  I’ve read the economist here and there, on airplanes and in B&N over a cup of coffee.  I know the quality, lets see the presentation on the Kindle.  The Economist, unlike FT, got really panned by reviewers because of the cost.  You get less for more and no website access if you get the kindle edition.  You also get no ads.   In the end the review histrionics on the amazon site provided me with much entertainment.   We’ll see.

I already have a subscription to the online version of the WSJ, and in truth there are days that I feel like that THAT is overpriced.  I don’t know if I’ll try the trial of the WSJ on the kindle.  Reiterating what I tweeted a couple of weeks ago, the FT reads like what I remember the WSJ read like back in the 90s and early part of the new century.  Except for Mossberg and his pals, the rest of the material/writing has gotten worse.

Oo, the economist just finished loading…I will let you know what i think…

Some Twitter Stats…meaning also how much activity goes into my FB feed now…

In Random on February 10, 2010 at 2:57 pm

So I thought this was quite interesting as people claim that I am twittering all day.  In truth if you look at this graph, the cluster of my tweets are all after 8PM. Meaning, I don’t really tweet all day, just in a huge cluster at night.  Consider it like Leno or Letterman only in primetime.

And if you look closely, my overall tweeting has diminished greatly since hitting a peak in Jan of 2009.

One other trend that isn’t showing is that I’ve pretty much stopped using tweetdeck and go back and forth between peoplebrowsr and seesmic now.  I’m also not tweeting much from mobile, at all.

So this blogpost is off cycle for me (in the morning) but I thought it was interesting anyway.