Group: comp.lang.c++
From: Ian Collins
Date: Monday, April 07, 2008 3:26 PM
Subject: Re: Is the concept of class optional in C++?

jacob navia wrote:
>
> But I think that is wrong. One of the central concepts in C++
> is the concept of class and inheritance, and all its associated baggage
> like constructors/destructors/copy constructors/ what have you.
>
You have become completely fixated with constructors and destructors.
Why are you so obsessed with them? As an implementor of a C compiler
system do you feel threatened?

Constructors and destructors are a tool, you can use them in your code
or you can ignore them in favour of initialisation and destruction
methods. Obviously you will then have to to handle your own memory
management, but there's nothing in the language to prevent you making a
rod for your own back.

I'm still looking forward to seeing your pure C implementation of RAII,
a point you continue to evade.

> This is not optional at all.
>
> Another C++ concept are templates. They are a central part of C++ and
> its standard library.
>
> These are not "optional" features.
>
Some here would argue that templates should not be written in
application code but only in libraries. Most of the C++ code I see
uses, but does not introduce, templates.

>
> I tay by my definition. The concept of class and inheritance is
> one of the central concepts of C++ and it is not optional at all.
>
OO is one of the paradigms supported by C++, but it isn't the only one.
One of the beauties of C++ is you can replace most inheritance with
composition by using - templates!

--
Ian Collins.

Safety Articles | Usenet Groups | Usenet News | Bluegrass