Archive
Chain Of Responsibility
One of the well known design patterns in the object-oriented software world is named “Chain Of Responsibility“. The UML sequence diagram below shows an example of how the software objects in the pattern collaborate with each other in order to ensure that a user initiated help request is handled somewhere in the GUI of an application.
As you might surmise, the world of hierarchical superiority has an analogous pattern, err anti-pattern, named “Chain Of Irresponsibility“. Do ya think I need to add words to explain the inter-object collaborations for this pattern as shown in the UML sequence diagram that follows?
In case you were wondering, S = Senior, BM = Bozo Manager, and DIC = Dweeb In the Cellar.
The Language Of The Language
I found it amusing that “Gotcha” number 9 in Stephen Dewhurst’s wonderful “C++ Gotchas: Avoiding Common Problems in Coding and Design” is titled “Using Bad Language“. At first, I thought: “Come on, why require such stuffiness and rigid formality on matters so trivial?“. However, upon reflection, it does make sense that the careless abuse of the “language defining the language” can contribute to time being wasted and bugs being inserted and BBoMs being created.
Since it’s a powerful general purpose programming language, C++ is necessarily complex. Thus, it requires a creative mangling of the English language to carefully define C++’s features, syntax, semantics, and usage idioms. Understanding and memorizing this myriad of details in order to continuously move toward excellence is a time consuming process – no matter what those “Learn C++ in 24 hours” type books promise.
I consider myself a decent, intermediate level C++ programmer, but I’m constantly probing, sensing, and discovering new terms along with having to refresh my memory and understanding of “the language of the language“. How about you? Do you practice continuous learning and refreshment about your job and tool set?
Moving, Initializing, And Hotdogging
In an interview with C++ creator Bjarne Stroustrup, Danny Kalev asked Bjarne several questions about the major features being incorporated into the venerable C++ language via the C++0x standardization effort. Here’s one such Q+A exchange:
I know, I know. The “*” should be a “+” in the free function declaration box above. But does the typo really detract from the message being conveyed?
So, how hard is it to write a move constructor implementation? It’s as hard as this:
Notice how the lower level reference-to-a-reference (i.e. rvalue reference) feature in the Matrix move constructor enables the higher level “move” feature to be easily written. This capability to move big stuff around instead of copying the behemoth will be a great addition to the language, especially to library writers, no?
Bjarne’s examples of the new “uniform and universal initialization” C++0x feature jacked me up too:
We can use the {…} notation for every initialization and wherever we initialize an X with {v} we get the same resulting value. That’s a major improvement over C++98’s non-uniform set of alternatives using the =v, ={v}, and (v) notations:
With any new and powerful tool, there’s always the danger of “hotdoggers” conniving to show how much smarter than you they are. Here’s a typically wise and insightful, and universal quote from Bjarne on the topic:
Before we get to benefit from the simplifications offered by C++0x, we may go through a period where too many people try to show off their cleverness by enumerating language rules and digging into the most obscure corners. That can do harm.
You’re not one of “those” people are you? I’m not. Luckily, I ain’t smart enough to be a hotdogger. But if I was brilliant…….
Note: I know that the code above is really C, but it was the first googled C++ example I stumbled across.
Related Articles
- Bjarne Stroustrup Reflects On 25 Years of C++ (developers.slashdot.org)
- Bjarne Stroustrup on C++ Inception (thebitsource.com)
Exit = Treason, Voice = Mutiny
In “Three Ways Of Getting Things Done” (hierarchy, heterarchy, autonomous responsibility), Shell chemicals ex-CEO and Celltech founder Gerard Fairtlough defines the only two ways that subordinates can take action against hierarchies as: exit and voice. Of course, the 2000 year old dictatorial mindset that’s firmly cemented into corpo CGHs everywhere always unconditionally interprets DICster exits as treason and DICster-voiced opinions that counter hierarch-imposed policy, mutiny. The reason: the paternal self-perception of infallibility. If you think you’re perfect, “they” must be traitors and mutineers, no?
In times of institutional stability, when the DIC exit rate is low and the frequency of counter-voice is low, subordinate exits and counter-voices are ignored by the self-proclaimed best and brightest. When the exit and voice rates rise high enough so that their corrosive effects on the corpricracy can’t be ignored any longer, the treason/mutiny interpretation auto-kicks in as a self-medicating defense mechanism – and it’s back to business as usual. Even when the base of the pyramid becomes a hollow and voiceless shell incapable of feeding the ravenous fat cats up the chain of infallibility with spiritual adoration and material wealth, it’s……. still business as usual. In fact, it’s always business as usual until external forces inevitably and surely cause it to become unusual.
Out Of Body, Head, And Mind
I’ve heard and read about people who’ve supposedly undergone “out of body” experiences. Hell, I haven’t even had an “out of head” experience, let alone a body-vacating one. Now, “out of mind” experiences are a different story. Those are where you remain in your head (so you’re still in your body) but not in your mind. In your body, in your head, out of your mind. Yepp, I’ve experienced several of those. As a matter of fact, I think I’ve been out of my mind ever since I started writing this stupid blog. Agree?
How about you? Which “out of” experiences have you had?
Buzz Me, Please
Check out this graphic that I borrowed from “LinkedIn Reveals the 10 Most Overused Job-Hunter Buzzwords“.
Oh crap! Do I use any of these hoytee-toytee terms in my own dishonest LI profile? Wait…. checking….. checking…. Nope! Phew, I thought I might have opened a gaping hole in my armor that would have exposed me as the true hypocrite that I am.
Here’s some advice for recruiters and hiring managers to consider. If you use any of these words-du-jour in your own profile, replace them with something authentic. Then, discard any candidates you stumble upon that use them in their profiles and resumes.
Note1: Being the lazy and useless sod that I am, I didn’t actually check my profile for bozo buzzword usage. So, if you find any of these laughers in there, call me out.
Note2: On my final proofread of this post prior to publication, I actually did search my profile for bozo buzzword usage and….. D’oh! I had actually started my summary off with “I have extensive experience..”. Bummer. Of course, I covered my tracks by changing the opening to “Over the years, I’ve acquired lots of experience…”.
Before And After
Networks make organizational culture and politics explicit – Michael Schrage
First there was the industrial revolution, then the information revolution, and now the network revolution. Spontaneous, rapidly forming, and self-organizing networks are popping up everywhere to expose dishonesty, unfairness, and corruption where power is concentrated in the hands of a few self-important fatheads. Look at Wikileaks, the Iranian election, and more recently, Egypt and Tunisia-fish. Networks are slooowly forcing bozeltines, against their gold-plated wills, of course, to behave more honestly and equitably. Who knows, maybe man’s inhumanity to man will be eradicated some day and networks will have played a key role in its demise? Prolly not in my lifetime, but maybe in yours.
A Delighted Customer
Being a crusty ole’ curmudgeon, it’s not often that I’ve been delighted as a customer of a product or service, but it’s a wonderful feeling when it does happen. Last week, when I parked my car at the gym at 6:00 AM, I noticed a crack in my windshield just below the steering wheel. Upon further inspection, I discovered that the crack stretched across the entire length of the windshield. D’oh!
After exercising, I called my State Farm agent at 10:00 AM. During the call, after I told the agent my story of woe, she connected me with an Accurate Auto Glass (AAG) employee. Right then and there, the AAG employee set up an appointment to have a technician drive out to my workplace and replace the windshield in the parking lot sometime between 1 and 2 PM.
After expecting a call when the technician was supposed to arrive and still not hearing from him/her by 3 PM, I gave AAG a “WTF?” call. The AAG worker pulled the ticket and said the job was completed. Sure enough, as I walked out to the parking lot with the AAG person still on the phone, I did indeed find that the job was completed. Whoo Hoo – delight city! After telling him that AAG rocks, I hung up the phone – as a delighted customer of both State Farm and AAG.
Do you get delighted often by vendors you buy stuff from? Do you delight your own customers? Do you know who your customers are?
American Idle
Are you as talented as I am for probing your environment, filtering out stuff that doesn’t fit within your entrenched UCB of the world, and whole-heartedly embracing ideas and thoughts that match it? The blabber that follows is, as Pink Floyd would sing, “just another brick in my wall“.
In 1932, the brilliant Bertrand Russell wrote his essay “In Praise of Idleness“. Here’s the brick mortar, in the form of quotes carefully plucked from Mr. Russell’s essay:
I think that there is far too much work done in the world, that immense harm is caused by the belief that work is virtuous, and that what needs to be preached in modern industrial countries is quite different from what always has been preached.
In these days, however, no one will deny that most enterprises fail. That means that a large amount of human labor, which might have been devoted to producing something that could be enjoyed, was expended on producing machines which, when produced, lay idle and did no good to anyone.
I want to say, in all seriousness, that a great deal of harm is being done in the modern world by belief in the virtuousness of work, and that the road to happiness and prosperity lies in an organized diminution of work.
Work is of two kinds: first, altering the position of matter at or near the earth’s surface relatively to other such matter; second, telling other people to do so. The first kind is unpleasant and ill paid; the second is pleasant and highly paid.
These landowners are idle, and I might therefore be expected to praise them. Unfortunately, their idleness is only rendered possible by the industry of others; indeed their desire for comfortable idleness is historically the source of the whole gospel of work. The last thing they have ever wished is that others should follow their example.
The conception of duty, speaking historically, has been a means used by the holders of power to induce others to live for the interests of their masters rather than for their own. Of course the holders of power conceal this fact from themselves by managing to believe that their interests are identical with the larger interests of humanity.
Recursive Interpretation
In their classic book, Design Patterns, the GoF defines the intent of the Interpreter pattern as:
Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.
For your viewing pleasure, and because it’s what I like to do, I’ve translated (hopefully successfully) the wise words above into the SysML block diagram below.
Moving on, observe the copied-and-pasted pseudo-UML class diagram of the GoF Interpreter design pattern below. In a nutshell, the “client” object builds and initializes the context of the sentence to be interpreted and invokes the interpret() operation – passing a reference to the context (in the form of a syntax tree) down into the concrete “xxxExpression” interpreter objects in a recursive descent so that they can do their piece of the interpretation work and then propagate the results back up the stack.
In their writeup of the Interpreter design pattern, the GoF state:
Terminal nodes generally don’t store information about their position in the abstract syntax tree. Parent nodes pass them whatever context they need during interpretation. Hence there is a distinction between shared (intrinsic) state and passed-in (extrinsic) state.
Since the classes in the Interpreter design pattern aren’t thinking, feeling, scheming humans concerned about status and looking good, the collection of collaborating classes do their jobs effectively and efficiently, just like mindless machines should. However, if you try to implement the Interpreter pattern on a project team with human “objects”, fuggedabout it. To start with, the “client” object (i.e. the boss) at the top of the recursion sequence won’t know how to create a coherent sentence or context. Even if the boss does do it, he/she may intentionally or unitentionally withhold the context from the recursion chain and invoke the interpret() operation of the first “XXXExpression” object (i.e. worker) with garbage. When the final interpretation of the garbled sentence is returned to the boss, it’s a new form of useless garbage.
On it’s way down the stack, at any step in the recursive descent, the propagated context can be distorted or trashed on purpose by self-serving intermediate managers and workers. Unlike a software system composed of mindless objects working in lock-step to solve a problem, the chances that the work will be done right, or even defined right, is miniscule in a DYSCO.















