#Which C++ version?
20-Aug-93 09:17:30
Sb: #36457-#Which C++ version?
Fm: Greg Comeau@Comeau Cmptg 72331,3421
To: Steve Bennett/SYSOP 76702,1071
>It is possible to code in ANY language in such a fashion that the code is
>clear, efficient, relatively easy to debug and maintain, and can be picked
>up and understood by anyone who understands the language it is written in.
That last clause is very supporting. But I am not at all convinced one
can reach that kinda goal with "ANY" language.
>It simply takes the correct attitude and a willingness to spend the time to
>do the job right….
I know what you are speaking of here. Especially when you raise the point
where it is possible to write bad code in any language. However, certainly
some languages are more efficient than others (but probably not to the
extext that say the press would have you believe, for instance, for years it
was touted how efficient C was over other language, and although C is
efficient more or less as a GP lang, indeed so is something like Pascal),
certainly some are cleared and easier the debug and so on. Even some "same"
language are clearer, easier, etc than themselves so to speak. For instance,
1993 BASIC is surely clearer, easier, whereas 1980 BASIC was not. Was it also
make more compilicated? Absolutely. Or take the case of this thread:
C to C++. Surely C++ is more compilicated and continues in C's "ugly"
fashion, however, it capability in "aiding the algorithm" in its power of
expression that class et al gives it certainly is for some sense of clarity
and so on. Re C++ efficiency, on average, it is just as fast (or slow
depending upon your perspective!) as an equivalent C program. Assuming both
are well written whatever that may mean.
>Some languages make
>it more difficult to do it that way, but anyone determined to write bad code
>will find a way, by accident or purpose…
This is all I'm saying but applying it to both ends of the stick.
That is, not only can some language let you sink easier, but IMO some
languages let you swim better too.
> Again, it's a matter of additude.
Definitely one piece to the formula, but the forumla it is not.
>C++ does a very good job of guiding programmers into writing better code. My
>biggest problems with it are more personal irritations rather than flaws in
>the language.
I generally won't contest that one. In fact, as much as I obviously like C
and C++, tons irritates me about both.
>(For example, I happen to be one of those old C nuts who
>seriously prefer the old style function declarations, although seperate
>prototypes are nice…)
I can see you saying that you prefer the K&R function syntax over the ANSI C
syntax (really C++ where it was borrowed from), however, I cannot see you
saying that you prefer the semantics of the K&R style.