learning C

Werner Schiendl ws-news at gmx.at
Mon Mar 12 10:43:27 EST 2001


The main use of a higher level language is to hide some of the bare bones
programming from you.
If you use some library in python (maybe one provided through an extension
dll) you do not know how things work in detail and you still use it. Why is
this more safe than the C++ way of things.

I agree that you have more control in C, this is true of course.
Even more control is provided in assembler and finally, nobody hinders you
to type in hex codes yourself ;-).

But I found numerous problems in C with uninitialized data (or
make-sure-it-is-initialized routines invoked everywhere and eating up
performance, except for the location where the problem really appeared in
the end).
I consider the guaranteed contruction of objects in C++ an obvious
advantage.

The decision to add the reference style parameters is not what I like most
about C++ because of the reasons you mentioned.
I tend to avoid non-const reference parameters whereever possible.

Passing arguments by value is almost everywhere avoidable by passing const
reference parameters.
Implicit conversion and construction of (temporary) objects can be avoided
by the implicit keyword, class factories and other means.

C++ design is maybe more difficult than C for small systems.
I think large systems are complex anyway, no matter which language you use.

By defining your own types that represent the problem space and hiding the
bits from the higher levels of the system C++ helps you structure your
system and keep it manageable much better than a set of procedures where
only documentation tells you what belongs together.

Object oriented design is better suited for large systems than procedural
programming from my point of view.
The next step would be component technology, but this leaves the programming
languages issue.

A badly designed system is bad, not matter which language.
In object oriented designs, tools may be able to get more information from
the sources.
But the only things that helps is to improve that thing (or redo it, if this
is cheaper)

regards
werner






More information about the Python-list mailing list