martes, 29 de julio de 2008

Great description of a programmer mesmerized by his activity.

Sorry for the long quote, but I think this ought to be one of the best descriptions of a programmer (Ethan Levin, the main character in the novel) mesmerized by his programming work:
He was running the compiler when the bug report came across his desk. The compiler, the program that translates a programmer's code into machine-readable bits —Ethan Levin had laid his code before its merciless gaze, and now he stared into his screen to see its verdit. Was he aware of the tester passing behind him? Did he take any notice of how carefully she slipped between his whiteboard and his chair, holding in her stomach so as not even to brush against him? No, of course not. Oh, all right: perhaps peripherally. Literally in his peripheral vision he might have seen her, and the thought "tester" might have formed in his brain, which would have led to the automatically accompanying idea that testers only bring news of trouble, and so why bother with whatever trouble she was bringing him now?

He was occupied by other troubles. Warning messages were scrolling up his screen, the compiler's responses, notices that this and that little thing in his code might not be legal, might not parse according to the rules, might prevent the compiler from turning his routine into an "object file," a little file full of ones and zeros, ready to be linked up with other object files to create the executable program. He wasn't getting fatal errors —no, not on this pass. There was nothing yet that caused the compiler to issue the awful message that began "Fatal error" and then, abruptly, stop. But such fatalities had already befallen him many times this morning, how many times, he'd lost track —twenty, fifty, a hundred? On each occasion, he had fixed whatever little thing wasn't legal, didn't parse, prevented his code from becoming machine-readable bits; and then he ran the compiler again.

Warning. Warning. Warning. Fatal error. Stop.

Fix the little thing in the code that wasn't legal. Run the compiler again.

Warning. Warning. Fatal error. Stop.

Fix the next little thing.

Warning. Warning.

"It'll compile this time" was the only thought Ethan Levin kept steadily in mind, over and over, on that morning of March 5, 1984. Even the phone had to go on ringing —once, twice, three times— until it reached him, three rings to get inside his window of attention so tuned to the nervous refresh rate of the screen: Warning. Warning.

"What! Are you still there?" said the voice on the phone. "You're supposed to be here!"

He sat confused for a moment. Yes, he knew the voice was Joanna's, but the words "there" and "here": What exactly did they mean? Then, all at once, his attention snapped into focus: It was Joanna, he was supposed to take her to the airport, and he was late.

"I'm leaving!", he said.

"I mean now. Are you leaving now?"

"I'm leaving, I'm leaving," he said again, but vacantly, automatically, because despite himself, his eyes had been drawn back to the screen, to the irregular pulse of the messages as they appeared: Warning. Warning.

"Hello? Are you there?"

"Yeah, yeah. I'm here," he said, jusr as the compiler suddenly displayed the message "Fatal error: MAXWINSIZE not defined," and came to a stop.

"Shit!" Ethan Levin muttered under his breath.

"Ethan! You're compiling! I know it!"

"Yeah, yeah, sorry," he said to Joanna McCarty, who, as his girlfriend of four years, knew all too well the sort of exclamations he made when he was programming and compiling. "Sorry," he repeated, but again automatically, because —though he knew better than to do this now— his mind immediately began ranging over the places where MAXWINSIZE should have been defined. On one side of his attention was Joanna, the month-long trip to India she was taking with Paul Ostrick, husband of her best friend, Marsha Ostrick, and the promise Ethan had made to take them to the airport —and be on time! he swore! But on the other was his sudden and unexpected problem of MAXWINSIZE, this branching trail of questions that led off in many directions, curious and puzzling, down which his mind involuntarily started traveling...

"It's an airplane, Ethan! It's not going to wait for a compile!"

"Shit! Yes! I'm leaving now."

"That's like now now, right? Not like a one-more-compile now?"

"Now now," he repeated, as much to himself as to Joanna. "Now now."

Still, even after he'd stood up and grabbed his jacket from the back of his chair, the face of the screen drew him back. He sat down again, reread the messages on the monitor, typed a command to the system that set it searching the entire code library for all occurrences of MAXWINSIZE. Yes, much better now. The system would tell him where the problem was. Then, tomorrow, he'd fix it.

(Ullman: pp. 17-19)

Who hasn't experienced something like this? Programming, unlike many other human activities —especially the ones we do while at work—, does have that extraordinary ability to suck you in. Viewing the code, writing it, compiling it, testing it, you lose track of time, forget whether it's daytime or nightime, and quite often even disregard basic human needs, such as eating too. The only other activity I can think of that's similar in this respect is any artistic endeavor. It shouldn't surprise us then that so many people speak of programming as an art.

No hay comentarios: