Wed 19 Nov 2008
“Please” and “Thank You” Macro
Posted by Scott Westfall under Programming
[8] Comments
Though I now work as a programming manager I have been a programmer for many years. Programmers typically share many characteristics in common. Among them, a certain inpatience with inefficiency. I’m not sure if that trait was there before we became programmers or whether it is something we learn through years of coding. Perhaps we start with that characteristic and it gets nutured through our programming experience.
Regardless, I’ve grown weary of some wasteful pleasantries, and I’ve been trying to make things more efficient. In particular, I’m tired of saying “please” and “thank you” all the time, particularly with my wife. After nearly 25 years of marriage, haven’t I proven my love and respect? Do I need to continually show it through endless “pleases” and “thank yous”?
So, I asked her if she could just assume that every request I ask is automatically preceeded by a “please” and followed by a “thank you”. I mean really, if she expects one every time, why not just assume it’s there in the first place?
In programmer parlance, this would be equivalent to writing a macro. Macros are substitutions that are inserted inline so that the code is altered, as though the substitution were there all along. I won’t bore you with the syntax, but if you’ve used macros before then you know what a time-saver they can be.
Unfortunately, my wife didn’t go along with this notion. It appears that her ability to execute macros is substantially less effective than a C compiler. So, she still expects a tedious “please” and “thank you” for each request. Sheesh!
Some programmers have taken this notion of macros a little too far. From the many programmers I have worked with, I have noticed the following macros in use:
The Greeting Macro — this is a common one, where the programmer has fully eschewed any responsibility for saying “Good morning”, “Hi”, “How’s it going?” or any of the regular acknowledgements of the other person’s existence.
The “Yes sir, I’ll get right on it” Macro – with this macro, a programmer will no longer let you know that they have heard and understood your requests. You must infer that they will comply because they have ceased their efforts to make you feel stupid for asking.
The “No I don’t think you’re a complete moron” Macro – here, the programmer has given up with trying to smile politely and respect your opinion. The macro is intended to soften his critical and belittling demeanor. It is important to note the stress on the word “complete” in this macro.
The Personal Hygiene Macro – I know it’s boring to shower every day, but the rest of us really appreciate it. Trust me on this one!
please_and_thankyou(“If you enjoyed this article, leave a comment.”)
November 19th, 2008 at 10:12 pm
like it!!!
November 20th, 2008 at 10:25 am
macro(witty and endearing blog commentary);
November 20th, 2008 at 10:32 am
spot on, or whatever kids say nowadays
November 20th, 2008 at 10:58 am
I see you grew up in procedural style. Today’s OO kids would call it a “Please”-decorator!
November 20th, 2008 at 11:06 am
@hfaber: Actually, I spent most of my time doing OO coding, but Java and C++ don’t have an OO construct that illustrates the point as well.
I could have used a mixin from my old LISP days defining before and after methods for “Please” and “Thank you”, but I thought that might be a tad obscure.
You gotta love programming: there are so many ways to skin a cat that you have to wonder why any cats still have skin.
November 20th, 2008 at 11:26 am
haha. funny. thx.
November 20th, 2008 at 2:10 pm
Yeah, I can’t really think of any Java or C++ constructs that illustrate this, but Python has the perfect construct – decorators!
http://www.python.org/dev/peps/pep-0318/
November 21st, 2008 at 5:04 pm
NUnit attributes!
2
3
4
5
6
7
8
9
10
public class SpousalRequests
{
[TestFixtureSetup]
public void SayPlease(){}
[TestFixtureTearDown]
public void SayThankYou(){}
[Test]
public void AskForRemote(bool bIsLost){}
}