[Oberon] Class Methods Vs. Procedure variables in Records
andreas_pirklbauer at yahoo.com
Tue Jan 3 12:44:01 CET 2017
This topic has been the subject of intense debate at the Institute of Computer Science at ETH Zurich around 1988-early 1990s. It's hard to convey the full spirit of these discussions so many years later, but I'll try to summarize some of the key aspects that were discussed back then, at least as far as object-oriented programming is concerned. One key topic was of course whether the language should be "instance-centered" vs. "class-centered".
First, a language called Object Oberon was devised and implemented at ETH Zurich. It was essentially a class-centered derivative of the original Oberon language (adding a keyword CLASS and class methods, etc). I have used it extensively. Among other things, that project demonstrated that adding a class mechanism to an existing language can be achieved with relatively little extra effort. And indeed, the compiler's complexity increased only moderately (10-20%). Then Oberon-2 was devised, which essentially removed the CLASS keyword and added type-bound procedures instead, i.e. classes where now again also called what they really are - namely records. It too was not significantly more complex than the original Oberon language and compiler. Of course much simpler than the OOP languages that emerged during that period (we were still in a pre-Java world back then and had to put up with C++ or the like).
But even though it was demonstrated that the additional complexity of the compilers for Object Oberon and Oberon-2 remained within tolerable bounds, the debate was not about that, but rather whether the notational conveniences justify the conceptual complications.
The "defendants" of the original Oberon language (instance-centered with procedure variables) argued that while it is true that class-centered languages (with class methods, a.k.a. type-bound procedures) offer a somewhat more convenient notation, increased security, and also more efficient upcalls, this was considered a marginal advantage. It was believed the object-oriented programming style should be confined to a few select cases only, i.e. one should use it only where it is justified and deemed appropriate - whatever that means (seen from today's point of view, where Java has achieved such a dominant position, and where it seems that almost everything has to be a class, this may sound strange, but back then the OOP style has not yet gained widespread adoption and many ideas were still in flux). The "case study" cited as proof was of course the Oberon System itself: It showed that the entire Oberon system could be programmed in conventional programming style, except for one area: the viewer system, as everyone knows who contributed to or extended the viewer system.
It was a lively debate, to say the least.. But in the end, the question remained open. This is, I believe, one of the reasons why we now have two main version of the Oberon language: Oberon and Oberon-2.
Personally, I believe Oberon7 is enough for many purposes, and that certainly includes system design. And that is why I decided to stick to the original Oberon language in Experimental Oberon. But that is entirely my personal bias. From an educational point of view, I would consider using Oberon-2 instead, as it very nicely and cleanly demonstrated the various OOP concepts. But in any case, more important than the choice of the language is, I believe, to teach the debate.
Srinivas Nayak sinu.nayak2001 at gmail.com
Tue Jan 3 05:17:06 CET 2017
All,In Oberon we have Procedure variables in Records.In Oberon2 we added/appreciated Class Methods.But Oberon7 we only retained Procedure variables in Records.In the evolution of Wirthian languages, when Oberon allowsobject oriented paradigm, why still we thought,Procedure variables in Records is the way to go with Oberon7?In other words, why we decided and retained Procedure variables in Records,but didn't go for Class Methods? Any disadvantage of Class methods?Why we think, Procedure variables in Records is more elegant than Class Methods?Where can we find discussions/decisions on these two constructs by masters?Kindly note that, in this query,my focus is on Language design, rather than Language use.With thanks and best regards,Yours sincerely,Srinivas NayakHome: http://www.mathmeth.com/sn/Blog: http://srinivas-nayak.blogspot.in/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Oberon