Mostrando entradas con la etiqueta assembly programming language. Mostrar todas las entradas
Mostrando entradas con la etiqueta assembly programming language. Mostrar todas las entradas

lunes, 4 de agosto de 2008

A programmer's madness.

And yet another description of a programmer mesmerized by his task, of which Ullman's book is full of:
He pushed away his plate. By now the water for this night's dinner had boiled, the past had cooked, been drained, and Ethan was sitting behind a plate of pasta with sauce from a jar, but his appetite was gone. He wanted to give up on this remembering thing. It was useless, disorienting. What he wanted was to find that clarity again, the astringent pleasure of the time after Joanna had left, when he was alone with his books and manuals, and he didn't think about her at all.

Because that's what happened while she was away: he forgot her. He was working on the most interesting project of his life, doing significant work, nontrivial work. A programmer can write code for years and never be involved in a project of lasting value. Ethan's work before going to Telligentsia was a compendium if disappointments: projects canceled when a vice president was fired, when a hardware manufacturer changed its pricing structure, when a company was bought by a bigger one. Telligentsia was his chance to build something that might be used for years —decades! Who could blame him for sequestering himself with books and manuals?

(Ullman: p. 302)

Haha! Pasta? Sauce from a jar? Ramen noodles anyone? Man, that sounds familiar! No wonder there are so many people who believe that geeks are almost autistic. But then, we can also find this high level of commitment and concentration in other fields. It's quite normal among artists, for instance, who are quite often accused of being egotistical. Perhaps there is a connection between the two activities after all. Perhaps the programmer is nothing but an artist who gives shape to the most important medium of our time: bits.

miércoles, 30 de julio de 2008

The complexities of event-driven programming.

A good description of event-driven programming:
He was afraid of the mouse. Among everything he had to learn, the mouse seemed the most impenetrable, and the more he read of the e-mail, the more afraid he became. He had never worked with a mouse before; neither had anyone else at Telligentsia, except for Harry, who had once read some code involving a mouse. There were perhaps a few hundred people in the world who knew anything about it, and most of them were working at Apple or at the two or three companies building mice. The documentation from SM Corp., the company that had built the systems Telligentsia was using, consisted of a few barely comprehensible pages, mostly of C-code samples, which Ethan had puzzled over in growing alarm. He felt horribly stupid about this device that had suddenly become so central to the workings of the system. Everything in the graphical user interface was centered on it: Where was the mouse? Was a button pressed? Which one? Single- or double-click? It was an "event-driven" system, code that was constantly being interrupted by the user through the movement and clicking of the mouse, code that was designed to be interrupted by the user's intentions: here, now here, now here. The systems he was used to, in contrast, moved from instruction to instruction under the direction of the programmer's imagination —if this is true, go here; if not, go there. Now he had to rearrange his mind. He had to know how these interruptions were being generated, what happened to them as they percolated up from the mouse, through the mouse device-driver software, through SM's mouse routines, finally to reach his code. He had to understand the mouse.

(Ullman: p. 43)


Obviously, thanks to abstraction layers, we don't need to do this anymore. However, it's still true that event-driven programming still requires a completely different mindset. Personally, as the Ehan Levin from the novel, I also come from the tradition where you directed the computer instruction after instruction and I still find the whole event-driven paradigm quite mind-boggling whenever I dare take a quick look. Perhaps that's why I feel more comfortable with scripting and Web development.

martes, 29 de julio de 2008

Programming as plumbing.

Programming as plumbing:
Ethan sat in his dining room and remembered the moment when his bluff and self-sell suddenly failed him, when he found himself muttering something about there being a "skills mismatch" between himself and the job. And then Harry leaning forward in his chair (with great difficulty, breathing at the mere exertion of shifting his formidable weight), telling him not to worry about not having finished graduate school: "It's all mostly useless by now anyway," he said. "Look, Levin. Programming starts out like it's going to be architecture —all black lines on white paper, theoretical and abstract and spatial and up-in-the-head. Then, right around the time you have to get something fucking working, it has this nasty tendency to turn into plumbing."

"No, no. Lemme think," Harry interrupted himself. "It's more like you're hired as a plumber to work in an old house full of ancient, leaky pipes laid out by some long-gone plumbers who were even weirder that you are. Most of the time you spend scratching your head and thinking: Why the fuck did they do that?"

"Why the fuck did they?" Ethan said.

Which appeared to amuse Harry to no end. "Oh, you know," he went on, laughing hoarsely, "they didn't understand whatever the fuck had come before them, and they just had to get something working in some ridiculous time. Hey, software is just a shitload of pipe fitting you do to get something the hell working. Me," he said, holding up his chewed, nail-torn hands as if for evidence, "I'm just a plumber."

(Ullman: pp. 27-28)

That sentence towards the end should be a classic: "Hey, software is just a shitload of pipe fitting you do to get something the hell working". Whoever hasn't heard of this or that programming language as an excellent glue to fit things together? For, in the end, that's what a programmer does most of the time. Yes, design is also a part of it. Yes, there are certain tecniques learnt from engineering disciplines that help. Still, for the most part, the priority is to get the code working, especially in this crazy world of ours where the product had to be released yesterday. The simile is great, I think.

The Bug.

Author of Close to the Machine, yet another cult book among geeks, Ellen Ullman is a computer programmer turned novelist. In The Bug, she describes the fate of a programmer, Ethan Levin, who struggles to fix an UI bug that only shows up sporadically and without any sort of regularity in its behavior. Deeply insecure about his skills because he doesn't have a computer science degree, Levin is in charge of doing the debugging in the midst of a personal crisis that drives his neglected girlfriend to the arms of a hippie. Ullman does a pretty decent job of portraying the overall programmer mindset to the lay reader, as well as the environment of extreme competition and even collective madness they often have to work in.

Technical description:
Title: The Bug.
Author: Ellen Ullman.
Publisher: Nan A. Talese/Doubleday.
Edition: New York (USA), first edition, 2003.
Pages: 356 pages, including postscripts.
ISBN: 0-385-50860-3

lunes, 28 de julio de 2008

C as a high-level assembly language of sorts.

So, how come the C programming language is still so popular after all these years? How come there are so many people out there still using it for their projects? Petzold gives us a clue:
I mentioned earlier that most high-level languages don't include bit-shifting operations or Boolean operations on bits, which are features supported by many processors. C is the exception to this rule. In addition, an important feature of C is its support of pointers, which are essentially numeric memory addresses. Because C has operations that parallel many common processors instructions, C is sometimes categorized as a high-level assembly language. More than any ALGOL-like language, C closely mimics common processor instruction sets.

(Petzold: p. 363)

Simply put, it still is the best programming language for systems programming in general. If you need to do something really complex without resorting to assembly language (i.e., an operating system or a heavy application, for instance), C is still a safe bet. Which brings up another issue: what if you are not a programmer? Well, I'd say even if you are not involved in any systems programming at all, you are better off being fluent in C for most of the operating systems out there are written in that language. You will need it, if only to troubleshoot and understand whichever problem you may come across of while running your favorite OS. Let's face it: gaining a decent understanding of how computing works without knowing any C is pretty tough.