Software engineering bromides revisited

27 July 2009 - updated 31 July 2009
Tags for this page: 200907 software
[Site traffic Strip-O-Meter]

Click to censor the Strip-O-Meter.

People who care about such things are talking about an article by Tom DeMarco in IEEE Software entitled Software Engineering: An Idea Whose Time Has Come and Gone? (PDF file). Well, that's what I said 13 years ago. At the time I was taking, and hating, a second-year university software engineering course; I'd just come off a co-op term working in the real world making actual software people would use, and I wasn't too thrilled to be told a pack of lies about how the ricidulous "methodologies" of software engineering were not only helpful, but absolutely necessary, when I'd just seen validation of my long experience as an amateur, writing software and learning what actually worked. I wrote the article below, and it stayed on my Web site for a long time, and then I eventually took it down because I was remodelling, it had never attracted the attention I'd hoped for, and I didn't want to continue maintaining it and a bunch of other old material. This January (2009) one of my friends who actually works in the industry - I did a few more co-op terms and then headed for the academic path instead - was telling me how he thought I should put the "bromides" article back up. He said other people were catching on to similar ideas, he'd even discussed it with some famous software engineering writer whose name I don't remember (could even have been Tom DeMarco, could have been anyone) who had agreed substantially with my friend's description of my ideas, and the only problem was I'd been ahead of the curve writing about it in 1996. So, maybe the time for this article has finally come.

Do bear in mind that this was written in 1996; both I and the business were younger and less experienced at the time. Not everything I say below is still expressed in exactly the terms I would use today. I think the central idea, though, was and still is right. Software isn't and shouldn't be engineering. If we must have a paradigm to understand it we'd be better off using some other, more creative, field of human endeavour. I said "journalism." DeMarco likens it to raising a teenager - and good on him for mentioning that "The very idea of controlling your child ought to make you at least a little bit queasy," which is something else I like to talk about but won't discuss further right here. Now, my old article.

Software Engineering Bromides (June 29, 1996)

I started writing computer software around 1983. I learned BASIC out of a book, and nobody told me anything about software engineering. Back then BASIC was real BASIC - not "Quick", not "Visual", not even "GW". Real BASIC with variable names consisting of either one letter, or one letter followed by one numeral. Real BASIC with line numbers on every line. And LET was not optional. And THEN could only be followed by a line number for the implicit GOTO.

Now, I'm sure that there was software engineering occurring even back then but it was no big deal. I mean, software engineers in 1983 would be the slide-rule boys in an IBM dungeon someplace feeding punch cards into a hopper or punching COBOL on a tape. And IBM's always been a little starched anyway. Welcome to 1996 - everyone's coming out of the closet and software engineers are no exception.

I've been in the industry. Four months of paid full-time employment as a software development co-op student may not seem like much, but as a cap to 13 years of hobby interest/addiction, I think it's enough to qualify me as a commentator. I've written real commercial software, and done it well, and now I'm back in school and the academics are trying to tell me what the real world is like.

Academics teaching software engineering are like virgins teaching sex.

Don't take this as a rant against the University of Victoria's Computer Science 265 class, which I'm currently taking. In fact, please don't - I don't want to get in trouble! Rather, this rant is a rant against the tired, commonplace statements ("bromides") that plague software engineering in general.

Software == hardware

The whole term "software engineering" is suspect. It suggests that software engineering has something to do with engineering. Believe it or not, some people even think that software engineering actually is a kind of engineering. This myth is surprisingly pervasive - lots of programmers graduate with B.Eng. degrees and go off calling themselves engineers, and they get hired as such.

Why do I say that software engineering, isn't? There are several critical differences. For one thing, all other kinds of engineering deal with physical objects of some kind. Bridges, if we have to use a stereotype. Software engineers don't produce anything tangible. Sure you can pretend that a computer file is a real object and you can get philosophical and raise issues about the fundamental nature of reality and the blurred line between hardware and software, but the fact remains: you can jump off a bridge but you can't climb a B-tree.

That may seem irrelevent, but how about this one: physical engineering disciplines are very straightforward. There may be 207 different kinds of bridge, but those are the only reasonable kinds of bridge. You can't think of a new kind of bridge different from those and expect it to work. Engineers will use innovative approaches but it's not their place to invent them from scratch. It is engineering's job to apply the techniques discovered and created by other people.

A junior civil engineer who gets creative with a bridge design will be shown the door in short order; vastly different the situation of a creative hacker. Good software usually involves hacking actual new ideas from the untamed wilderness of the mind. Other forms of engineering are seldom like that. No value judgement either way, I'm just saying the two are different.

If we have to go looking for an established paradigm for creating software, I think writing is the appropriate one. We can write software the way we write text. I think that's a good description of the programming style I use in my personal (not paid) projects. Don't specify, outline. Don't inspect, proofread. When I write code for other people at work or in class, I write it in the style they want. But if they ask me how I think things should be done, I tell them.

Writers have a whole set of established techniques for controlling the creative process, and I think a set of journalism classes would do the average programmer a lot more good than trying to make us build software the way we build bridges. Software isn't like bridges. It's not like magazine articles either, but it's a lot closer. We can, and should, apply the existing procedures for magazine articles to software programming. They'll work a lot better than the procedures we use for bridges.

Like most bromides there is a grain of truth in this one. It's certainly true that a wizardly hacker can go off and write code and then drop dead or leave the company and nobody will be able to work on the code again because it wasn't done in any organized way. I've seen code like that and, I must admit, I've even written code like that. We do need organized approaches to software and it's a good idea to look at other fields for inspiration. I just claim that journalism is a better model for software than is any kind of engineering.

Structured programming

You know they tried to put one over on us before. I'm thinking of the bromide of structured programming. You remember that one? The idea was that we could solve all our software problems by following a certain process. I'm not sure I can summarize the philosophy of structured programming in a few sentences, but it's a very specific and organized way of building code. "Divide and conquer" are watchwords of structured programming - you split the major task of the program into smaller subtasks, split those into even smaller jobs, and eventually you've reduced it to thousands or millions of instructions which constitute your program. This is called "top-down design".

Structured programming also involves code structures which help organize the instructions along the lines of your design. These include loops, if-then-else constructs, subroutines, and so on. A structured program is like a set of nesting boxes, all one inside another, except some of the boxes are more like Klein bottles and contain themselves (that's called "recursion"). When you arrange the little boxes inside the big boxes you aren't allowed to think about what's inside the little boxes because it's not supposed to matter. That's why structured programming discourages the GOTO statement - it's like a hyperspace wormhole that digs into the inside of a box and connects it to the inside of some other box, which means that you can't consider either of them in isolation anymore.

Structured programming is good because software is really complicated stuff. When faced with 200K of source, you absolutely have to have some kind of structuring device if you want to be able to understand the code or explain it to others. In fact, I would say that a lot of the ideas of structured programming are inevitable, because there is no other way to handle big conceptual structures. Funnily enough, however, really great software is often written bottom-up or middle-first or in some other unauthorized way. Why?

I claim that humans normally think in a holistic, all-levels-at-once manner. When we think about a program we want to write we do not, by nature, first think of its major task and then split it down and then split those down and so on. Rather, we jump around and consider several levels at once. "Hmm. I want to write an install program for this server and I could represent the .INI file as a single-linked list and I wonder if the windowing toolkit has an outline control and how many bits is a socket address?"

Good programmers are people who can concentrate on one level at a time. Great programmers are people who can concentrate on one level at a time and still not lose track of the other levels that their minds inevitably generate. You can join high-level systems together better if you have a good idea of how they work on the lowest nuts-and-bolts level. Other (not software) engineers seem to understand that, so maybe it's one thing we should embrace from that tradition.

So, in addition to learning from journalism, we should learn from nuts-and-bolts engineering. These days software is too big for one person to design alone, so we have to have teams and specialization, but that doesn't mean we have to bury ourselves in specialization. You want one person to work on assembly language subroutines and one on combining high-level OOP modules? Fine. But make sure the OOP expert knows what a register is, and give the assembly hacker some abstract algebra courses. They will work better together if they have some notion of what each other are doing.

Good programmers can separate the different abstraction levels of a project. That is, for instance, what the OSI networking model is all about. I've learned that that's an unrealistic ideal. In real life, you can't totally separate the levels. You can't design a transport layer protocol without knowing a little about the network and session layers. You need organization and boundaries between the parts of a program, or everything will fall apart. But those boundaries had better be written in pencil.

Design specs and code inspections

As far as I can tell, the idea of a specification is that it's a good idea to know what something is supposed to do before you build it. This is presented as if it were a profound insight, and taught in programming and management classes at a cost of thousands of dollars per person.

Code inspection, on the other hand, involves the concept that once you've built something, it's a good idea to look at it and make sure you built it right before you try to use it. If you've got the people power, it's a good idea to have someone look at it other than the person who built it in the first place, because everyone's biased about their own creations. Like design specifications, this is a very good idea.

My question is, why are we bothering to talk about these things? Shouldn't it be obvious that specification and inspection are good? By making a big deal of them and writing textbooks and having classes, we're making it too complicated. The academic establishment is perpetuating the concept of programming as a difficult, black art, that you need years of training and hard work to learn.

That's elitism. What ever happened to systems with a programming language in ROM, where everyone who used one learned to program as a matter of course? How come we don't see programming books written for seven-year-olds anymore? A loop is a loop is a loop, and will be while(1). The concept isn't any more difficult now. Modern C with a good compiler isn't really any harder than the cryptic old BASIC interpreters. But now we've bogged ourselves down so much with common sense dressed up as real progress, that we've convinced ourselves programming is hard.

I don't really mind being part of a technological elite. It's kinda fun. But there is real magic in programming, and I'd rather spend my time learning that instead of bromides about work habits. If we're going to call ourselves elite, let's deserve it. Let's study the new and subtle stuff, not the obvious conclusions we should already know.

Conclusions

All the ideas I've attacked here have some validity. That's why so many people believe them unquestioningly. I say our faith in the tenets of software engineering must be tempered with reason. It's not enough to just follow a checklist of top-down design and specification, implementation, inspection, testing, or whatever other methodologies you're going to use. Even the word "methodology" is excessively dignified. You should use a given technique because it makes sense, not because it's next on the checklist. Stop mooing and start thinking, people!

In the highly competitive world of software, I think that sensible approaches must eventually evolve. I would like to see the academic discipline of Computer Science lead the way by discovering some more intelligent ways of thinking about software, ways that don't involve regurgitating checklists of obvious facts disguised as deep wisdom. Isn't discovery what science is all about? But it's pretty comfortable to wear guru robes and sit at the top of the mountain telling novices things they already know. I'm afraid we will see the academic establishment doing that for some time to come.

Comments

def0 from 195.16.247.24 at Mon, 27 Jul 2009 21:17:11 +0000:
Good article.

The toolbox of Software Engineers has grown since 1996, probably because they needed to find something that actually works. I never got anywhere whenever I tried the Top-Down approach. I doesn't work, and I'm not sure why. How can a complex problem not be broken down into smaller parts? It would have to be, if the burden of solving it is to be spread across the shoulders of many. Yet Bottom-Up is the only thing that works, and for that, you'd have to have at least some idea what parts you are going to need to solve the big complex problem.

Small, independet "black box" parts are a good idea for another reason too: They can be reused. This is why we have libraries. This is what they are for. And also UNIX command line tools follow this idea of specialised, reusable, small parts.

The Software Devolpment Cycle, where a product is gradually incremented with user feedback, is really unavoidable. It does not need to be taught how to do that; if anything, it should be taught that software can not be produced like, say, a table: a complete and finished product, working according to specs. If it is used at all, there will be user feedback, and it will have to be maintained.

(And mech engineers wonder how software can rot without the wear and tear of moving parts.)

That common sense (with all its fallacies) is taught – in all sober seriousness – as Arcane Arts is probably a transplant from Economics: Accouting and management is what a lot of early commercial software was written for, after all. (Hence COBOL.) However, collecting best practices and teaching them, even and especially if they seem obvious, is also a tradition of artisans, and not at all stupid. What should be obvious in hindsight is not always easy to discover by oneself. And in applying techniques, fast (for it always has to be ready by yesterday), the How is often more important than the Why.

I wouldn't compare software to magazine articles. Journalists are usually paid by the word, and have to write to fill an area of a fixed size. This would be like judging the quality of software by how closely the number of lines of code or number of operations matches an arbitrary but constant number.

To me, software is like poetry: A poem tries to encode as much information as possible in as little space as possible, utilizing context and pre-existing information in the recipient. Just like good software should. A poem is structured, like software, and in this very structure itself implicitly encodes part of its meaning.

(It is funny, therefore, that programmers, of all people, when contrasting the nature of code comments against actual code refer to poems as instances of "prose".)

While programs are like poetry, and writing both well requires remarkable skill and training, being able to put words in rhythmic meter, matching rhymes and metaphors would hardly contribute to better or even just more readable code. The tool of the ink-wranglers that would benefit programmers most is probably creative writing.

My father is an engineer, my mother is a writer. An engineer applies scientific knowledge to practical tasks; a writer creates works from words. A programmer does both. I don't think software engineer is a completely wrong designation (even if the pointless litany of "paradigms" is), but I like software architect better. Software is not like a house or a building, but like an architect, a programmer builds things for a dedicated purpose, has to respect the whims of the customer, and yet, inevitably, despite regulation towards uniformity that may exist, does it in a distinctive, personal style.

I also agree that programming should not be a black art for the initiated only. Precise thinking and formulating is something that everybody would benefit from, and a computer is a mercyless teacher in those regards. Not everybody has to be a wizard, though, and most would not want to be. Mechanical engineers are perfectly happy with Matlab; they have other things to worry about than type safety or data hiding, in fact they perceive those as obstacles. They are not programmers, even though they do program. (And not rarely with a mouse.) There is no danger that if programming were as widespread as reading and writing, or as simple as uttering a well-formulated request, guru-dom would become an idle exercise devoid of merit.

anonymous from 206.248.139.25 at Tue, 28 Jul 2009 05:08:26 +0000:
When I talk to software engineering academics, they speak about context. When I speak to bloggers, they speak of absolutes.

Just an observation.

Matt from 216.59.243.141 at Tue, 28 Jul 2009 12:05:31 +0000:
def0 - I'd like software to be like poetry, but I think it's understandable, given how much poets get paid, that that's not the paradigm people like the IEEE are trying to promote...

As for "anonymous", why not address the real issues instead of posting vague generalities that don't really mean anything? If you're not even putting a pseudonym on it, you have nothing to lose.

Matt from 208.54.5.56 at Tue, 28 Jul 2009 15:56:36 +0000:
I think a lot of people who don't fully grasp the software engineer concept naturally don't understand the ideas behind it. I see the difference as being in the approach to the problem. A software engineer will decide how to approach the goal based on previous work (design patterns, data structures, etc.) And choose the most appropriate for the task. They build individual components of the system. All bridges don't look the same, use the same parts or even serve the same purpose (golden gate bridge vs. a rope bridge).

Matt from 128.100.5.116 at Tue, 28 Jul 2009 16:15:54 +0000:
For clarity - "Matt" from 216.59.243.141 is me, Matthew Skala, the author of the page; "Matt" from 208.54.5.56 is someone else.

trythil from 165.124.223.118 at Tue, 28 Jul 2009 22:59:56 +0000:
Re: design specs and code inspections being "obvious":

These may be the equivalent of "aim before shooting", "look before you leap", etc., but getting people to actually do them isn't always that easy. Where I currently work, we had no code review system until I instituted one (just for my current project, though), and there are some people I work with for whom design-before-code is something that they have to be forced to do, despite repeated demonstrations that an hour or two spent in roughing out a design can save you a day or two in writing tests and production code.

Now, I don't think we need lots of formalities for design specs and code inspections: for many software projects, it's either infeasible or just doesn't matter. I know many people who use UML, but only a few actually try to use it as a full-blown programming language. Many other software developers I've talked to use a small subset of it (subsets of class and sequence diagrams, mostly) as a vehicle for exploring designs on whiteboards or whatever is convenient. Code reviews are similar: I find that minimally-structured spreadsheets and some sort of task tracking system work well enough for small teams. (YMMV, of course, depending on team size, type of project, and so forth.)

But I don't think that doesn't mean that we shouldn't say _something_ about it, Something like Martin Fowler's UML Distilled may be a good start.

barry from 81.149.216.63 at Thu, 30 Jul 2009 14:16:49 +0000:
Here I am on a quiet Thursday, idly googled "igo users forum latex go baduk" because I want to know how to make the 1 on a blackstone get it's serifs and I stumble upon Matthew Skala's home page .. and that leads via Tom Marco article to here .. and this thread is live !!

I wrote my first program 'after school club' at 14, so that's the late 60's, in 1980 I had the job title 'Software Engineer' simply because it was the only way a major oil corp could justify the pay.

Later in the 1990's I think I really began to understand Engineering - and yes, when that is Software, it is all about "Being Structured", "Code Inspections", "Design Reviews" and "Automated Regression Testing" which doesn't seem to have a mention ... We were lucky to get allocated 2 cpu hours every night on the corporate mainframe to put the beast through it paces after every days changes.

I agree design is a random process - but the results must be auditable.

A final thought - I was an average programmer/software designer .. I've met programmers at least 10 times better than I ever was, and far too many that were a 100 times worse.

Barry
PS if you know how to make the 1 on a blackstone get it's serifs then get in touch .. back to Google..

Axel from 65.94.186.73 at Fri, 31 Jul 2009 18:34:39 +0000:
Bless you. One reason I chose Forth to be my lifetime language is that I felt it encouraged programming as an art rather than a bureaucratic process. Oddly enough, I was a baby journalist in an earlier incarnation, on another planet (Lois Lane never gave me a second look). So maybe there is something to your analogy.

Of course early microcomputer users *had* to program, no matter how anarchistic or hackerish. In my ideal world people would use computers more like a Stradivarius than like a vending machine.

Add Comment

Your name (required):
Your email address or URL (optional):
Type "bonobo" for anti-spam purposes:

Do not enter a fake email address. If you don't want to provide one, just leave it blank. Comments with fake email addresses will be deleted.

This form is for posting public comments to be read by other people who visit this Web site. If you have a software support question, or other material directed to the page author instead of to the general public, please send email instead.

All the data you enter, and your IP address, will be saved and displayed. Don't enter secret information. HTML is not accepted; it will be displayed as plain text. Your comment will only be added if you enter valid data in all required fields; if it isn't, use the back button and try again.

I, and I alone, reserve the right to remove postings for any reason.

Copyright 2009 Matthew Skala
Updates to this site: [RSS syndication file]