Intermediate scopes in Oberon-07
In the entire PO2013 system with850 procedures (of which only 17 are local ones), there is only ONE local TYPE declaration and only 8 local CONST declarations.
Since this example has been cited several times now: I think that it tells more about the programming style preferred by Niklaus Wirth than about the actual value of local declarations. Being able to declare types locally is not so much about information hiding as it is making the code easier to understand.
That may be true. OTOH, the authors of System 3 (ETH Oberon), Oberon V4 (Linz Oberon) and A2 (formerly) - all considerably larger systems and Original Oberon - also don’t seem to use local procedures or locally declared types very much. And I don’t think the authors of these systems blindly follow someone else’s programming style.
I only declare TYPEs if I use them several times (and as base RECORD of a type inheritance hierarchy) To be able to use them several times, I normally declare them on module level. With the one exception I mentioned in an earlier mail: local redefinition of parameter TYPEs only used in that procedure. Jörg
Am 11.02.2018 um 18:10 schrieb Andreas Pirklbauer <andreas_pirklbauer@yahoo.com>:
In the entire PO2013 system with850 procedures (of which only 17 are local ones), there is only ONE local TYPE declaration and only 8 local CONST declarations.
Since this example has been cited several times now: I think that it tells more about the programming style preferred by Niklaus Wirth than about the actual value of local declarations. Being able to declare types locally is not so much about information hiding as it is making the code easier to understand.
That may be true. OTOH, the authors of System 3 (ETH Oberon), Oberon V4 (Linz Oberon) and A2 (formerly) - all considerably larger systems and Original Oberon - also don’t seem to use local procedures or locally declared types very much. And I don’t think the authors of these systems blindly follow someone else’s programming style.
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
participants (2)
-
Andreas Pirklbauer -
Jörg Straube