Looking back at the subject of functional programming, it appears that its truly relevant contribution was certainly not its lack of state, but rather its enforcement of clearly nested structures, and of the use of strictly local objects. This discipline can, of course, also be practiced using conventional, imperative languages, which have subscribed to the notions of nested structures, functions and recursion long ago.Note the use of the singular contribution. Basically, he thinks functional programming had one good idea, and the imperative languages already copied it decades ago. If that's his view, why would he spend much more time talking about FP and Lisp in particular?
On closer inspection one realizes that the need for protection and classes of programs arises from the fact that programs are possibly erroneous in the sense of issuing requests for memory outside their allocated memory space, or accessing devices that should not be directly manipulated. If all programs were written in a proper programming language, this should not even be possible, because – if the language is correctly implemented – no reference to resources not named in the program would be possible.Surely he's absolutely right? If a language completely prevents you from even mentioning resources that you aren't supposed to have access to, why would you need memory protection?
Nevertheless, the careful observer may wonder, where the core of the new paradigm would hide, what was the essential difference to the traditional view of programming. After all, the old cornerstones of procedural programming reappear, albeit embedded in a new terminology: Objects are records, classes are types, methods are procedures, and sending a method is equivalent to calling a procedure. True, records now consist of data fields and, in addition, methods; and true, the feature called inheritance allows the construction of heterogeneous data structures, useful also without object-orientation. Was this change of terminology expressing an essential paradigm shift, or was it a vehicle for gaining attention, a “sales trick”?To some extent, I see where he's coming from, in that inheritance is the only clear new idea in OOP. But what Wirth is seriously overlooking here is the human dimension of programming. That is, object-oriented programming languages significantly bias things so that average software developers are more likely to do "the right thing". Yes, you could definitely do object-style programming in C or Pascal, but these imperative style languages also make it easy to take ugly shortcuts with global variables, overly long procedures, and more.
"Don’t you see that the whole aim of Newspeak is to narrow the range of thought? In the end we shall make thoughtcrime literally impossible, because there will be no words in which to express it. Every concept that can ever be needed will be expressed by exactly one word, with its meaning rigidly defined and all its subsidiary meanings rubbed out and forgotten. Already, in the Eleventh Edition, we’re not far from that point. But the process will still be continuing long after you and I are dead. Every year fewer and fewer words, and the range of consciousness always a little smaller. Even now, there’s no reason or excuse for committing thoughtcrime. It’s merely a question of self-discipline, reality-control. The Revolution will be complete when the language is perfect."Orwell, of course. And to be clear, I'm not suddenly accusing you of being a secret fascist here, but it's just such a great line about the perfection of languages that I couldn't pass up the chance to wheel it out.
x+++++y
but that's a strawman argument against ++. Just because I can write run-on sentences in English doesn't mean that I should or will (and this applies to a number of C language features like the preprocessor). Just to remind myself of the pain, I wrote a typical systems coding problem in C and Pascal and it was just as painful as I remember it.Nevertheless, the careful observer may wonder, where the core of the new paradigm would hide, what was the essential difference to the traditional view of programming.The difference is this - before there was OO, we tried to write code to get as much of the benefits as possible:
The designer of Pascal retained the goto statement (as well as the if statement without closing end statement). Aparently he lacked the courage to break with convention and made wrong concessions to traditionalists. But that was in 1968.Edsger Dijkstra's letter Go To Statement Considered Harmful was published in the March 1968 issue of CACM, when Wirth was editor. Pascal was designed in 1968–1969 and published in 1970.
« Older A study-based analysis of UK gaming magazines in t... | There has never been another l... Newer »
This thread has been archived and is closed to new comments
If all programs were written in a proper programming language, this should not even be possible, because – if the language is correctly implemented – no reference to resources not named in the program would be possible.
That was a little... naive, a stark contrast to something like Marcus Ranum's six dumbest ideas in computer security, which is also a good read.
Still, I think this sort of historical record is important. "This is what we tried, it didn't work and this is why. If something in our assumptions has changed, maybe you can make it work, but if not, don't waste your time on it."
posted by mhoye at 7:51 AM on October 3, 2012 [1 favorite]