Other's experiences with C++

Hans-Dieter.Dreier@materna.de Hans-Dieter.Dreier@materna.de
Tue, 15 Dec 1998 13:03:55 +0100


--e7Dj9J8V9y0OSiMcy1NhumWGjmxXdqx1
Content-type: text/plain; charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

I found reading in the newsgroup comp.lang.c++.moderated quite interesting.=
 It shows many facets of language design (traps to fall into as well as nic=
e ideas) that can only be gotten from extensive use of a language by many d=
ifferent persons with very different opinions and programming styles. C++ i=
s especially good suited for this as it satisfies all of the above conditio=
ns and is quite complex (IMHO rather too complex).

Example: The notion of a "const leak" (what a term! It means that the compi=
ler complains about violation of constness somewhere and the programmer can=
't find the reason), or the statement that const is hard to fit into a larg=
e project afterwards.

As I'm viewing "const" primarily as some form of pre-/postcondition (BTW, i=
s there a shorthand term for this? I'll call it PPC here), the above statem=
ents should apply to general PPCs as well. A suggestion that can be derived=
 from the discussion mentioned could be to include *two* sets of PPCs: One =
generated by the user, stating the user's intentions, and one generated by =
the compiler, reflecting the current state. The compiler would compare thes=
e and see whether a user PPC is violated. A user could use copy & paste as =
a rather painless way to add PPCs. It would also help finding PPC related p=
roblems and enhance automated documentation.

Another discussion thread was about the use of name spaces: When to use, wh=
ich names to choose, how deep to nest and so on.

A lesson to be learned from this was that deeply nested namespaces with len=
gthy names may render error messages unreadable (as well as programs, BTW).=
 As a consequence, language designers should think about ways how the quali=
fication mechanism (:: . -> in C++) can be streamlined without sacrificing =
ease of use, security and clearness (use of aliases; transparent names whic=
h do not need qualification; ...).

--

MfG

Hans-Dieter Dreier
(Hans-Dieter.Dreier@materna.de)=

--e7Dj9J8V9y0OSiMcy1NhumWGjmxXdqx1
Content-type: text/plain; charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

IDENTIFIKATIONSANGABEN:
a15976a.txt IA5 DX-MAIL X.400 User Agent=

--e7Dj9J8V9y0OSiMcy1NhumWGjmxXdqx1--