Null references redux

language_fan foo at bar.com.invalid
Sun Sep 27 10:36:05 PDT 2009


Sun, 27 Sep 2009 12:35:23 -0400, Jeremie Pelletier thusly wrote:

> language_fan wrote:
>> Sun, 27 Sep 2009 00:08:50 -0400, Jeremie Pelletier thusly wrote:
>> 
>>> Ary Borenszweig wrote:
>>>> Just out of curiosity: have you ever programmed in Java or C#?
>>> Nope, never got interested in these to tell the truth. I only did C,
>>> C++, D and x86 assembly in systems programming, I have quite a
>>> background in PHP and JavaScript also.
>> 
>> So you only know imperative procedural programming + some features of
>> hybrid OOP languages that are not even proper OOP languages.
> 
> This is what I know best, yeah. I did a lot of work in functional
> programming too, but not enough to add them to the above list.
> 
> What is proper OOP anyways? It's a feature offered by the language, not
> a critical design that must obey to some strict standard rules.  Be it
> class based or prototype based, supporting single or multiple
> inheritance, using abstract base classes or interfaces, having funny
> syntax for ctors and whatnot or using the class name or even 'this', its
> still OOP. If you wan't to call me on not knowing 15 languages like you
> do, I have to call you on not knowing the differences in OOP models.

I must say I have not studied languages that much, only the concepts and 
theory - starting from formal definitions like operational or 
denotational semantics, and some more informal ones. I can professionally 
write code in only about half a dozen languages, but learning new ones is 
trivial if the task requires it.

Generally the common thing for proper pure OOP languages is 'everything 
is an object' mentality. Because of this property there is no strict 
distinction between primitive non-OOP types and OOP types in pure OOP 
languages. In some languages e.g. number values are objects. In others 
there are no static members and even classes are objects, so called meta-
objects. In some way you can see this purity even in UML. If we go into 
details, various OOP languages have major differences in their semantics.

What I meant above is that I know a lot of developers who have a similar 
background as you do. It is really easy to use all of those languages 
without actually using the OOP features in them, at least properly (for 
instance PHP does not even have a real OOP system, it is a cheap rip-off 
of mainstream languages - just look at the scoping rules). I have seen 
Java code where the developer never constructs new objects and only uses 
static methods because he fears the heap allocation is expensive. 
Discussing OOP and language concepts is really hard if you lack the 
theoretical underpinning. It is sad to say this but the best source for 
this knowledge are academic CS books, but nowadays even wikipedia is 
starting to have good articles on the subject.



More information about the Digitalmars-d mailing list