[Oberon] Oberon-1 or Oberon-2?

Diego Sardina sardinadiego at gmail.com
Tue Oct 28 07:40:36 CET 2014


>> Approximately 20 years ago, I heard a guest lecture
>> of Prof. Wirth. [...] He did not like type-bound procedures,
>> saying that they were some kind of constant
>> record components and that procedure variables
>> should be used instead.

> Linux kernel is extensively using procedure variables. Having some
> limited experience with programming the Linux kernel, I do not think
> this is a good recommendation. In the Oberon/Component Pascal community
> the procedure variables are frown upon, because procedure variables put
> emphasis on run time debugging and testing as the main methods, similar
> to development of Linux kernel. Why does anyone want to eat this crow?

I like method suite :-)

Type-bound procedures are nice but it isn't the only way to achieve
dynamic dispatch. They are also limited to single dispatch, C++ guys
are indeed used to create a pointer to function table (method suite)
or to use the visitor pattern when they need double/multiple dispatch,
and these cases are not uncommon (just consider an AST, for example).
Advanced OOP only benefits from method suite. Also, in my experience,
I never had hard time to debug procedure variables, at the end method
suite is a very simple technique.

One of the major criticism of method suite is the initialisation of
procedure variables that is considered error-prone. I never had this
problem. By the way, today, classes are generated with tools or IDEs
and method suite was illustrated via a template class in the Project
Oberon, leading the reader to think about this concept via an automated
tool, the fact that it doesn't exist isn't a problem of the Oberon
language.

IMHO

-- 
Diego Sardina



More information about the Oberon mailing list