[Oberon] Oberon for a C++ user.
Srinivas Nayak
sinu.nayak2001 at gmail.com
Thu Sep 29 08:42:43 CEST 2016
> The question to ask, is what do Namespaces in C++ offer, as I have always
> thought of a module like a namespace per file. i.e. each module is a
> namespace. However sometimes direct comparison between two things is not
> entirely accurate, i.e. namespaces are not exactly the same as modules
>
> I just noticed that no where in your messages did you really link
> namespaces to oberon modules. Since the title is oberon for a c++ user I
> thought it would be handy to compare namespaces in C++, to modules in
> Oberon, since I have always found them similar
>
> Do namespaces in C++ support encapsulation and abstraction? I have always
> thought of modules as separating code into different files so that it is
> not one large long standard pascal program in a single file. In plain C
> you could separate code into different source files, however it all had a
> single global namespace so procedure_one would conflict with procedure_one
> in another file if it was part of the same program, so you used a
> namespace prefix per each function:
>
> module1_procedure1
> module2_procedure2
>
> where module1 and module2 are the namespaces respectively. I.e. plain c
> did not have actual namespace feature, you just created the feature
> yourself using underscores.
>
> Sorry I'm trying to explain this without using complex confusing lingo
> such as abstraction, encapsulation... The way I see it, is just
> "separating concerns". I believe N. Wirth has described modules somewhere
> as separating concerns also.
I see, in C++, class, namespace, file, these three things overlappingly offer
different concepts. It make a lot of confusion. Added to it, a class can even span
5-10 different files! So a lot of hodge-podge. In C there is a "file-scope" even.
In Oberon I see, one concept supported by one feature only. Ex. Abstraction,
i.e. selective exposure, is supported only by Module.
No other language features supports the same. Similarly, Inheritance, supported by
Record extension only. Modules can't be extended. Can any other thing be extended?
So I feel Oberon is cleaner from learning point of view.
One day I was thinking, Oberon is a bad language!
Because it doesn't allow us to find its deficiencies ?
With thanks and best regards,
Yours sincerely,
Srinivas Nayak
Home: http://www.mathmeth.com/sn/
Blog: http://srinivas-nayak.blogspot.in/
More information about the Oberon
mailing list