Saturday, November 3, 2012

“Go To” Statement Considered Harmful...

I've been programming computers for over 40 years now, in more languages than I can remember accurately.  Those languages include dozens of machine languages, close-to-machine languages (C, especially) and dozens more high level languages.  A few years before I started programming, the pioneering computer scientist Edsger Dijkstra published his famous monograph Go To Statement Considered Harmful – and, silly me, I thought that every living programmer was very familiar with it.  It was the seminal work that led to the notion of “structured programming”, which in turn quickly advanced into a rich and diverse set of programming language design ideas that is still evolving today.  Mr. Dijkstra started it all with that paper.

Last week, I discovered that several of my colleagues – all much younger than I – had never even heard of Dijkstra's monograph.  Worse, they'd never heard of the notion that “go to” statements were harmful.  They knew they shouldn't use them, but really didn't have any idea of why.  It was just something they'd been told.  I sent them a link to the paper, which is reproduced online.

For some reason that I can't quite identify, I found this just as shocking as the day a few years back when I discovered that many quite effective young programmers had no idea how computers actually worked.  I'm sure it has something to do with the fact that both of these things are central to my practice of the programming art.  That makes it difficult for me to understand how anyone could effectively practice programming without the same understanding – but the evidence is agin me...

2 comments:

  1. Maybe it will put your mind at ease a tiny bit to know there's at least one programmer under 30 who has read his Dijkstra and knows his way around computer architecture.

    ReplyDelete
  2. Oh, I didn't mean to imply that NO younger programmers know these things; I know plenty of them that do. It's rather the other way around: I'm still amazed that ANY competent programmers don't know these things...

    ReplyDelete