Ha. Speaks to my inner geek.
I’ve been thinking about writing an article on the sad realities of debugging a program and the effect that it has on us barely human programmers. Then I came across this post at 4 Lines of Code. It’s genius and I love it and it is all perfectly true. Somebody should be collecting these pearls of wisdom from blogs and making a book. Seriously.
We have examined earlier the fundamental laws of bug finding. You will probably know the fundamental stages of bug finding. The 6 basic stages of debugging are well-known among programmers and can be found in various blog posts. During debugging, developers and programmers go through a cycle of emotional states:
- DENIAL. That can’t happen.
- FRUSTRATION. That doesn’t happen on my machine.
- DISBELIEF. That shouldn’t happen.
- TESTING. Why does that happen?
- GOTCHA. Oh, I see.
- RELIEF. How did that ever work?
First (1) we have a stage of denial and surprise: you say that the bug isn’t possible, that it can’t happen, because you have not observed it before. You are surprised. The reason is (2) that is doesn’t happen on your machine or on your computer. You can not reproduce it instantly, and you have not seen this bug before. You get frustrated and sometimes a bit angry. Therefore you think that (3) it shouldn’t happen. Yet someone – unfortunately often a customer or a user – insists that it does. So you (4) ask why it is happening, and why it can happen. The only way to solve this problem is to find out what really happens. You start to examine logs and to debug the program, until you are able to find and to reproduce the bug. If you’ll do this long and hard enough then (5) you see the reason for the bug, and are able to remove it. You are trying to reproduce the bug again to see if it is fixed. Finally (6) you ask yourself how it ever work before. The longer you seek a bug and the longer the phases (1)-(4), the larger the relief in the end.
You can read the original post here: http://4loc.wordpress.com/2010/03/13/the-six-stages-of-debugging/
If you’re into development at all, be sure to check out 4 Lines of Code, it’s good stuff.
I just read this on Gizmodo (HT @penkin) and I find it quite interesting. I have thought about what the iPad could be good from since yesterday when it launched and couldn’t quite decide. I mean, I probably want one, purely cos its tech, but to be honest, it doesn’t excite me nearly as much as it should (and I do get very excited about new tech).
I think this article sums up the issues very nicely (missing one though, can you make a phone call from it?). You can read the full article here at Gizmodo: http://gizmodo.com/5458382/8-things-that-suck-about-the-ipad?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+gizmodo/full+(Gizmodo)&utm_content=Google+Reader
Big, Ugly Bezel
Have you seen the bezel on this thing?! It’s huge! I know you don’t want to accidentally input a command when your thumb is holding it, but come on.
This is a backbreaker. If this is supposed to be a replacement for netbooks, how can it possibly not have multitasking? Are you saying I can’t listen to Pandora while writing a document? I can’t have my Twitter app open at the same time as my browser? I can’t have AIM open at the same time as my email? Are you kidding me? This alone guarantees that I will not buy this product.
No front facing camera is one thing. But no back facing camera either? Why the hell not? I can’t imagine what the downside was for including at least one camera. Could this thing not handle video iChat?
So much for Apple revolutionizing tablet inputs; this is the same big, ugly touchscreen keyboard we’ve seen on other tablets, and unless you’re lying on the couch with your knees propping it up, it’ll be awkward to use.
No HDMI Out
Want to watch those nice HD videos you downloaded from iTunes on your TV? Too damned bad! If you were truly loyal, you’d just buy an AppleTV already.
The Name iPad
Get ready for Maxi pad jokes, and lots of ‘em!
No Flash is annoying but not a dealbreaker on the iPhone and iPod Touch. On something that’s supposed to be closer to a netbook or laptop? It will leave huge, gaping holes in websites. I hope you don’t care about streaming video! God knows not many casual internet users do. Oh wait, nevermind, they all do.
Adapters, Adapters, Adapters
So much for those smooth lines. If you want to plug anything into this, such as a digital camera, you need all sorts of ugly adapters. You need an adapter for USB for god’s sake.
It’s Not Widescreen
Widescreen movies look lousy on this thing thanks to its 4:3 screen, according to Blam, who checked out some of Star Trek on one. It’s like owning a 4:3 TV all over again!
Doesn’t Support T-Mobile 3G
Sure, it’s “unlocked.” But it won’t work on T-Mobile, and it uses microSIMs that literally no one else uses.
A Closed App Ecosystem
The iPad only runs apps from the App Store. The same App Store that is notorious for banning apps for no real reason, such as Google Voice. Sure, netbooks might not have touchscreens, but you can install whatever software you’d like on them. Want to run a different browser on your iPad? Too bad!
And you still have to carry your iPhone (that can do all of the above!?!) with you anyway to make phone calls. Seriously? Look, no doubt its great tech, but no multitasking? Are you kidding me? Ah, I see, for multitasking you run one app on the iPad and the other app on the iPhone you also need to carry. Nice.
One more thing: Objective C and Mac only development environment. Fail.
You know I am an Amazon fan boy, right? You should, I wrote a million posts on it and you have to agree, I do have reason to be an Amazon fanboy. Amazon is made of win and so is the Kindle.
But now, now they have taken my ‘fanboy’ affection to a whole new level, a semi religious experience even. They are releasing a software development kit for the Kindle and are planning to roll out an ‘App’ store by the end of the year. It’s almost like an omniscient deity was listening to my wishes… almost.
Just the other day, whilst waiting and reading my Kindle (that I love and adore like a child) I thought, damn, it would be really cool if I could download some apps for it. Just a nice little note application. Or, and here is the thing, if I could get to my GMail from my Kindle, my life would, pretty much, be complete.
Sadly, I live in a country where the telecoms industry is run by a capitalist Gestapo that firmly believe in raping their subscribers in every possible way for every cent they have. So in this particular hell hole, Kindle does not have open internet access, making the GMail thing somewhat complicated.
Anyway, the reason I had my semi religious experience and am now giggling like a school girl is because I will be getting apps for my Kindle this year, and, even better, I will be able to write my own applications. I cannot, fucking, wait. So I’ve submitted my email address to the limited beta about a million times and if anybody from Amazon happen to read this, I may actually be willing to give you money to be part of said beta for the KDK.
Quick Kindle specs: 532Mhz CPU, 2Gb storage (mine anyway), 600 x 800 6″ grey scale screen (16 shades of grey), USB port, 3G/EDGE/GPRS connectivity, runs Linux-2.6.10.
The Kindle screen refresh rate doesn’t lend it’s self very well to action games or video so I expect the applications will probably be text oriented and the games will probably be puzzle type games. This is all good in my boo… Kindle.
If you want more, check out these links:
Overall, the fiber produced by a llama is very soft and is naturally lanolin free. Llamas are intelligent and can learn simple tasks after a few repetitions.
I was speaking to a friend of mine (OneFlew) on IRC today (yes, it’s still around, and yes, I still use it) about the Real Programmers that he worked with in his career as a programmer. He told me about Russel Hollick, who was then (and, still is, it seems), the Research and Development director of SYSPRO Africa.
In OneFlew’s opinion, Russell Hollick is a Real Programmer of note. Russell, at the time (and hopefully still) programmed in COBOL. Now the discerning reader may note that Real Programmers don’t program in COBOL. Generally, this would be true, but the legendary feats accomplished by Russell using COBOL are, apparently, manifold. I didn’t manage to get a lot of detail from OneFlew but he described Russell as “my god, a fucking genius”. Russell was apparently a vi master of the 8th degree, and single-handedly bent vi to his will. His will being programming Object COBOL in vi. Just using vi in the first place places the man somewhat higher up on the ladder of Real Programmers.
One of the feats that elevates Russell to the realm of Real Programmer is that he went and wrote a printer driver in COBOL. Now, the COBOL that was forced down my throat while studying is a bit hazy these days but from the little bit I can remember, the language wasn’t exactly meant for bare bones systems programming. This petty restriction does not deter the Real Programmer. Russell apparently also had a knack for calling the Windows API from COBOL and knew it inside out (most likely, he still knows it inside out today).
What sealed the deal for me was the fact that Russell had a cup of coffee permanently attached to his hand, a sure sign of Real Programmerness. Also a sure sign of one-handed typing skill I guess. He drove a red Porsche Carrera. Respect. Real Programmers like fast cars, fast bikes are highly regarded.
As I mentioned before, Russel was (and still is) the R&D Director of SYSPRO, code for “he wrote the fucking product with his bare hands”.
So here’s to Russell Hollick, Real Programmer.
Some llamas appear to bond more quickly to sheep or goats if they are introduced just prior to lambing.
While trying to get my head together to write another post on atheism (because it’s the only thing that attracts attention to blogs apparently) I remembered a page I made a long, long time ago when I was new to this web development thing. I’ve always had a thing for Real Programmers; I respect the skill required back in the good old days of programming, when you actually had to understand how a computer worked before you could tell it what to do.
These days, you can be a programmer and not once in your entire career worry about op codes, memory addressing or garbage collection. If you have not at some point at least played with assembler, you are *not* are Real Programmer. If you have not read “The Art of Assembly Language Programming” or “IBM PC Assembly Language and Programming” you are *not* a Real Programmer. If you have never called an interrupt from a program, you are *not* a Real Programmer.
I don’t really consider myself a Real Programmer (I can’t program in FORTRAN for example and I often use interpreted languages like Python and PHP to do my job) but I love the idea of Real Programmers. I wish I was a Real Programmer, that I was around when the PDP6 was new and the IBM 704 was on it’s way out, being replaced by keyboard terminals. I guess, looking back, it is pretty cool that I was learning to program when the internet came into existence and that I know what a BBS is (and so do my parents, having paid the phone bills). Perhaps some new programmers will look at people like me and think something in the lines of ‘they used to do web programming with Perl and CGI on Redhad 1, heeeectic’. That would be cool.
If you want to know what a Real Programmer is, read “Hackers: Heroes of the Computer Revolution” (ISBN 0-385-19195-2) immediately. When you start sleeping in the ceiling of a lab just to be close to your computer, you can be considered a Real Programmer. Another epic piece of Real Programmers literature can be read here (I’m pretty sure that’s where the whole Real Programmers affirmations series came from anyway): http://rixstep.com/2/2/20071015,00.shtml: Real Programmers Don’t Use Pascal.
In memory of all real programmers everywhere, I re-post The Story Of Mel to kick off my series of “Real programmer’ affirmations.
The Story of Mel
This was posted to Usenet by its author, Ed Nather (), on May 21, 1983.
A recent article devoted to the macho side of programming
made the bald and unvarnished statement:
Real Programmers write in FORTRAN.
Maybe they do now,
in this decadent era of
Lite beer, hand calculators, and “user-friendly” software
but back in the Good Old Days,
when the term “software” sounded funny
and Real Computers were made out of drums and vacuum tubes,
Real Programmers wrote in machine code.
Not FORTRAN. Not RATFOR. Not, even, assembly language.
Raw, unadorned, inscrutable hexadecimal numbers.
Lest a whole new generation of programmers
grow up in ignorance of this glorious past,
I feel duty-bound to describe,
as best I can through the generation gap,
how a Real Programmer wrote code.
I’ll call him Mel,
because that was his name.
I first met Mel when I went to work for Royal McBee Computer Corp.,
a now-defunct subsidiary of the typewriter company.
The firm manufactured the LGP-30,
a small, cheap (by the standards of the day)
and had just started to manufacture
the RPC-4000, a much-improved,
bigger, better, faster — drum-memory computer.
Cores cost too much,
and weren’t here to stay, anyway.
(That’s why you haven’t heard of the company,
or the computer.)
I had been hired to write a FORTRAN compiler
for this new marvel and Mel was my guide to its wonders.
Mel didn’t approve of compilers.
“If a program can’t rewrite its own code”,
he asked, “what good is it?”
Mel had written,
the most popular computer program the company owned.
It ran on the LGP-30
and played blackjack with potential customers
at computer shows.
Its effect was always dramatic.
The LGP-30 booth was packed at every show,
and the IBM salesmen stood around
talking to each other.
Whether or not this actually sold computers
was a question we never discussed.
Mel’s job was to re-write
the blackjack program for the RPC-4000.
(Port? What does that mean?)
The new computer had a one-plus-one
in which each machine instruction,
in addition to the operation code
and the address of the needed operand,
had a second address that indicated where, on the revolving drum,
the next instruction was located.
In modern parlance,
every single instruction was followed by a GO TO!
Put that in Pascal’s pipe and smoke it.
Mel loved the RPC-4000
because he could optimize his code:
that is, locate instructions on the drum
so that just as one finished its job,
the next would be just arriving at the “read head”
and available for immediate execution.
There was a program to do that job,
an “optimizing assembler”,
but Mel refused to use it.
“You never know where it’s going to put things”,
he explained, “so you’d have to use separate constants”.
It was a long time before I understood that remark.
Since Mel knew the numerical value
of every operation code,
and assigned his own drum addresses,
every instruction he wrote could also be considered
a numerical constant.
He could pick up an earlier “add” instruction, say,
and multiply by it,
if it had the right numeric value.
His code was not easy for someone else to modify.
I compared Mel’s hand-optimized programs
with the same code massaged by the optimizing assembler program,
and Mel’s always ran faster.
That was because the “top-down” method of program design
hadn’t been invented yet,
and Mel wouldn’t have used it anyway.
He wrote the innermost parts of his program loops first,
so they would get first choice
of the optimum address locations on the drum.
The optimizing assembler wasn’t smart enough to do it that way.
Mel never wrote time-delay loops, either,
even when the balky Flexowriter
required a delay between output characters to work right.
He just located instructions on the drum
so each successive one was just past the read head
when it was needed;
the drum had to execute another complete revolution
to find the next instruction.
He coined an unforgettable term for this procedure.
Although “optimum” is an absolute term,
like “unique”, it became common verbal practice
to make it relative:
“not quite optimum” or “less optimum”
or “not very optimum”.
Mel called the maximum time-delay locations
the “most pessimum”.
After he finished the blackjack program
and got it to run
(“Even the initializer is optimized”,
he said proudly),
he got a Change Request from the sales department.
The program used an elegant (optimized)
random number generator
to shuffle the “cards” and deal from the “deck”,
and some of the salesmen felt it was too fair,
since sometimes the customers lost.
They wanted Mel to modify the program
so, at the setting of a sense switch on the console,
they could change the odds and let the customer win.
He felt this was patently dishonest,
which it was,
and that it impinged on his personal integrity as a programmer,
which it did,
so he refused to do it.
The Head Salesman talked to Mel,
as did the Big Boss and, at the boss’s urging,
a few Fellow Programmers.
Mel finally gave in and wrote the code,
but he got the test backwards,
and, when the sense switch was turned on,
the program would cheat, winning every time.
Mel was delighted with this,
claiming his subconscious was uncontrollably ethical,
and adamantly refused to fix it.
After Mel had left the company for greener pa$ture$,
the Big Boss asked me to look at the code
and see if I could find the test and reverse it.
Somewhat reluctantly, I agreed to look.
Tracking Mel’s code was a real adventure.
I have often felt that programming is an art form,
whose real value can only be appreciated
by another versed in the same arcane art;
there are lovely gems and brilliant coups
hidden from human view and admiration, sometimes forever,
by the very nature of the process.
You can learn a lot about an individual
just by reading through his code,
even in hexadecimal.
Mel was, I think, an unsung genius.
Perhaps my greatest shock came
when I found an innocent loop that had no test in it.
No test. None.
Common sense said it had to be a closed loop,
where the program would circle, forever, endlessly.
Program control passed right through it, however,
and safely out the other side.
It took me two weeks to figure it out.
The RPC-4000 computer had a really modern facility
called an index register.
It allowed the programmer to write a program loop
that used an indexed instruction inside;
each time through,
the number in the index register
was added to the address of that instruction,
so it would refer
to the next datum in a series.
He had only to increment the index register
each time through.
Mel never used it.
Instead, he would pull the instruction into a machine register,
add one to its address,
and store it back.
He would then execute the modified instruction
right from the register.
The loop was written so this additional execution time
was taken into account —
just as this instruction finished,
the next one was right under the drum’s read head,
ready to go.
But the loop had no test in it.
The vital clue came when I noticed
the index register bit,
the bit that lay between the address
and the operation code in the instruction word,
was turned on —
yet Mel never used the index register,
leaving it zero all the time.
When the light went on it nearly blinded me.
He had located the data he was working on
near the top of memory —
the largest locations the instructions could address —
so, after the last datum was handled,
incrementing the instruction address
would make it overflow.
The carry would add one to the
operation code, changing it to the next one in the instruction set:
a jump instruction.
Sure enough, the next program instruction was
in address location zero,
and the program went happily on its way.
I haven’t kept in touch with Mel,
so I don’t know if he ever gave in to the flood of
change that has washed over programming techniques
since those long-gone days.
I like to think he didn’t.
In any event,
I was impressed enough that I quit looking for the
telling the Big Boss I couldn’t find it.
He didn’t seem surprised.
When I left the company,
the blackjack program would still cheat
if you turned on the right sense switch,
and I think that’s how it should be.
I didn’t feel comfortable
hacking up the code of a Real Programmer.
This is one of hackerdom’s great heroic epics, free verse or no. In a few spare images it captures more about the esthetics and psychology of hacking than all the scholarly volumes on the subject put together. (But for an opposing point of view, see the entry for Real Programmer.)
[1992 postscript — the author writes: “The original submission to the net was not in free verse, nor any approximation to it — it was straight prose style, in non-justified paragraphs. In bouncing around the net it apparently got modified into the ‘free verse' form now popular. In other words, it got hacked on the net. That seems appropriate, somehow.” The author adds that he likes the ‘free-verse' version better than his prose original...]
[1999 update: Mel’s last name is now known. The manual for the LGP-30 refers to “Mel Kaye of Royal McBee who did the bulk of the programming [...] of the ACT 1 system”.]
[2001: The Royal McBee LPG-30 turns out to have one other claim to fame. It turns out that meteorologist Edward Lorenz was doing weather simulations on an LGP-30 when, in 1961, he discovered the “Butterfly Effect” and computational chaos. This seems, somehow, appropriate.]
[2002: A copy of the programming manual for the LGP-30 lives at http://ed-thelen.org/comp-hist/lgp-30-man.html]
If you are a Real Programmer or have worked with a Real Programmer I would love to hear your war stories and of your heroic programming feats of greatness, especially if I can re-post them with my Real Programmers series.
I used to work with a Real Programmer, Clive, the only person I consider to have been a mentor in my programming career. He used to program RPL on punch cards back in the day. When I picture Mel above, I think of Clive, who I will probably feature in some upcoming posts.
When correctly reared spitting at a human is a rare thing. Llamas are very social herd animals, however, and do sometimes spit at each other as a way of disciplining lower-ranked llamas in the herd. A llama’s social rank in a herd is never static.
“The best programmers are not marginally better than merely good ones. They are an order-of-magnitude better, measured by whatever standard: conceptual creativity, speed, ingenuity of design, or problem-solving ability.”
- Randall E. Stross
“For a long time it puzzled me how something so expensive, so leading edge, could be so useless. And then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match.”
- Bill Bryson
“Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.”
- Rich Cook
It’s quite amuzing (which is to say, I almost cracked a smile):