On Sat, 2012-08-25, Johannes Bauer wrote:
> On 25.08.2012 11:33, Nick Keighley wrote:
>
>>>> Because I do not want C++!
>>>
>>> And nobody forced you to. I merely asked and you respond with such a rant.
>>
>> he appreciates the useful-ness of standard containers but doesn't want
>> the rest of the baggage that comes with C++. Idiomatic C++ doesn't
>> look a lot like C.
>
> You are correct. However, it all depends on the usage. Nobody forces you
> to use virtual methods, operator overloading, function polymorphy and
> design patterns. They make the language look *very* different to C,
> which is probably what you were referring to with "idiomatic C++".
>
> However, one can also use C++ and just take advantage of containers,
> leaving the rest.
Well, not really. C++ features are interconnected. When you do your
container stuff, you'll sooner or later notice you want constructors,
some operator overloading, references ...
Some of the things you mentioned can be ignored though. Run-time
polymorphism (your "virtual methods" and "function polymorphy" above)
is pretty well isolated, and I usually don't bother with it because I
find the results hard to understand. Design patterns aren't forced
down your throat either -- it seems to me C++ programmers don't love
them nearly as much as the Smalltalk/Java/.NET people do.
> I would argue that this yields understandable syntax
> that even a non-C++-programmer can understand easily.
I'd put it less strongly: understandable, and not completely alien to
a C programmer. She'd need to study C++ first, but brainwashing would
not be necessary.
/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
|