Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Print Job


Apr03: The New Adventures of Verity Stob

Verity is the pseudonym of a programmer based in the UK. She can be contacted at [email protected].


You can send a page to spooler but you cannot make it print.

—Anonymous

Something intellectual this month, to raise the tone. Aspect-oriented programming is the topic du jour. I'll get on to it in a moment. Just need to make a printout of NTK webletter, http://www.ntk.net/ since you ask, to post to Mum. She's a patsy for the high-tech IT satire, the amusing rude word googles and the reviews of chocolate-and-mint flavoured colas, but she hasn't quite remistressed web browsing since I disabled Internet Explorer and substituted a reskinned Mozilla. It's part of her tertiary education in Right Thinking.

Pleggease ceggan yeggou teggurn thegge preggintegger eggon? Oh sorry, we all use the eggy-peggy code (put in "egg" before the vowel in each syllable) when we are talking about the pee-are-eye-en-tee-ee-are. That way, we think "Inky Jet" can't understand us, even if it is listening. It has something of an uncooperative nature. Yes please, the power switch is on the wall behind you. Ta.

Now aspect-oriented programming... What? No, don't worry about that noise. It always does that when you juice it up. I think it's cleaning its teeth, just like that praying mantis on the telly the other night (scientific name mantissa attenboroughis disgustingissimus), twitching its mandibles to clean off unsightly mashed ladybird stains. If you peer inside it now, you may catch a glimpse of its blue LED paper sensor. Yeah, I thought you'd like that, you boy, you. Just as they put blue tubular lights in restaurant kitchens to attract flies, so they put blue LEDs on computer equipment to attract techno-guys. Oooh I was just kidding you a bit. You should see your little face.

So, back at the plot, the aspect-oriented thing sounds peculiar but don't worry—it's a fine new way of grafting extra code into execution points within classes without inheriting or dirtying the source. Suppose you want to add in a logging feature to an old application that needed an audit trail. (Actually "adding logging" is the only easy aspect-oriented example that anybody can think of so far. Here is a tip-top Stob tip: Betcha five notional British pee [notional U.S. $0.08] that the next three aspect-oriented articles that you read after this one all do the logging example. It's like the polymorphic shape class in object-oriented programming, or the Singleton in design patterns. It's compulsory, not optional.) The point is that chances are, you want to add logging to lots of classes at once. It is obvious you don't want to spread the log-writing code...It's run out! Quick! quick! quick! Get the paper in before it gives up...

Damnblastcursehellswear. No, well you would think so, wouldn't you? But not with this printer. Once you've interrupted a job, you are stuffed. There's no point in putting paper in its tray—it doesn't want it now. If you like, you can try pressing The Button That Does Nothing for a bit. It's the one in the middle, by the picture of a stopwatch showing five seconds elapsed. Yes, I have tried holding it down for five seconds before. See? Mind you, perhaps that isn't a second hand. Perhaps it's a minute hand, or an hour hand. That must be it: It would resume a job if you hold it down for an hour...No, don't cycle the power until I've cancelled...oh never mind, too late. I didn't really want fourteen sheets, each with just one line printed on it thus

Vslbhpnaernqguvf,lbhzhfgorznq

but now that we have started, it probably is the best way to empty the various buffers. I've grown too old and idle to short the "ready" pin in the parallel cable with a paper clip. Look, here's a box of scrap, give it some of that to chew on and it will soon get tired.

Yes, I do realise it must be binary pixel data, thanks. (I'll have you know, in my youth, I wrote, in real assembly language actually, a graphics driver for a nine-pin, dot-matrix printer, the Migraine 8000. In fact, I devised the key simplifying strategy for driving nine-pin printers when programming down to the pixel level, viz ignore pin 9.) What baffles me with this printer is: Whatever you are printing, it always turns out that every 62nd character is a form feed. With predictable consequences for paper wastage in the event of the naughty, neglectful printer owner not keeping the paper tray full at all times. You'd have thought that the printer's manufacturer would arrange matters in the printer driver and the firmware so that this sort of thing couldn't easily happen, wouldn't you? Hey ho.

Oh look. All that exercise has made it thirsty, the poor little mite. It's turned on its "Give me more ink" LED (only yellow, sorry). Yeah, I've got some here. What? You think own-brand is a rip-off? Listen, I don't care about any Dr. Dobb's article you may have read (Ed Nisley's "All Your Drop Are Belong To Us," DDJ, September 2002, notwithstanding). These only cost a third of the price of a whole printer each, and look! nothing is wasted. You put the old cartridge in this special bag here and send it off, and they donate five notional British pee [notional U.S. $0.08] to a charity that organises pretty kittens for attractive orphan children. It's great to feel that one is doing good, simply by making a printout. Besides, remember the manufacturer's leaflet—you can cause printer fires, catch unsightly warts, and get hereditary arthritis if you don't use own-brand cartridges.

Now why hasn't its ink light gone out then? You don't suppose it wanted more three-colour ink, instead of the black we have just given it? We never do any colour printing on this machine, but perhaps it's bored with black ink. Perhaps we better have a look at its personal web site. You've not seen it? It's the usual sort of thing for a personal web site. A couple of not-very-good pictures of itself, some other pictures of its relatives and, if we are lucky, a blog entry indicating what it has been up to recently...or not, in this case. No, that'll be my fault; I've probably got the wrong version of the JVM installed.

'Scuse me one moment, I need to make a phone call. Hi, Mum. No, it's not working out. Yeah, look, could you have another go at clicking on the lizard's head? No, don't touch the HeggewPegaq-Ceggompeggard because lbhyybaylpnh
frvggbtbvagbvgfshaalfperraqhzczbqrn
tnva.Bulrflbhjvyy.Vpna'goryvrirnalo
bqljbhyqunirgenpxrqguvfsne

DDJ



Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.