Me and my C

Around 2001 it was time to end the DOS era. So I switched to Linux. I never liked Windows and I was not in the position to have to use it for any kind of professional reason. So that was easy: Slackware Linux it would be.
Running Linux is almost synonymous to running C-compiled software. Some parts are written in assembly, but the majortiy was made with the GCC compiler. I won't be hard on the GCC compiler. It is a very good C compiler. Period. So on the new platform, I'd better do as the romans. So I bought some books about C and C++ for Linux.

Mistake. I should have learned from the past. GCC may be a very fine compiler, the language itself still remains terrible. I read the following books on the subject:

You see, I read my share of books. Most books were not finished due to my limited brain capacity. When the authors started to explain about inheritance, operator overloading and con/destructors, I got lost in the haze.
I just cannot understand why a compiler would pull up a smoke curtain for me, just to make things more unclear. Is it to be so macho that you can say: "I'm a seasoned C++ programmer"? A compiler should protect the programmer against the power of a CPU and operating system.

I can use parts of the C programming language, but when the specific instructions appear, I have to let go. I'm particularly pissed off by statements like:

     **p++^=q++=*r---s;

     a==b?a=b:b=a;
   
Many years I have looked for a way to express my negative feelings towards C and especially C++. And now I found a document on the internet. It is a PDF file written by P.J. Moylan from the universiy of Newcastle in Australia.
The article is called The case against C and you can download it from this site. Mr Moylan comes to the same conclusion as I (and many other sensible people): why use a 30 year old language with 20 years lack of progress when there are good and modern languages abound?

Some clippings from Mr Moylan's paper (to wet your appetite)

One of the biggest obstacles to the future of computing is C. C is the last attempt of the high priesthood to control the computing business. It's like the scribes and the Pharisees who did not want the masses to learn how to read and write.

Jerry Pournelle

C is a medium level language combining the power of assembly language with the readablility of assembly language.
Real programmers can write 'C' in any language.
Much of the power of C comes from having a powerful preprocessor. This preprocessor is called 'programmer'.
By analysis of usenet sources, the hardest part of the C language is the comment.
C++ will do to C what Algol 68 did to Algol.
C was made to be a portable assembler for the PDP-11 computer. And it still is. Unfortunately we do not use the PDP-11 anymore.
Adding object orientation to C is like adding air conditioning to a bicycle.

The C++ hype.

When reading the books about C++, I saw a lot of credits to just about any programming language around. Stroustrup seems to have studied all non-C programming languages to extract parts from them, in order to insert these into C, to create C++.
There's only one language that is NEVER mentioned or credited: Modula-2. And this is strange, since almost all 'new' aspects of C++ over C have very strong resemblance with the way used by Modula-2.

Now, I cannot prove this, but I think Stroustrup just copied the concepts of Modula-2 into C to get the 'modularity' he's so proud about. In a way I think he just doesn't want to admit the shear genius of Niklaus Wirth who -was- able to construct a modular language.

My belief grew stronger when I found the following article: Interview with Stroustrup Here's how the interview starts:

Q : When you formulated the C++ language, did you use ideas gained from other "up and coming" object languages at the time, such as Modula-2?

A : For C++, I used ideas from C, BCPL, SIMULA, ALGOL 68, Ada, ML, and others. I knew Modula-2 -and at least a dozen other languages- at the time, but I don't recall any direct influence from Modula-2.

I cannot imagine this is true. How can a genius from Denmark know about all the languages about and not be influenced by the only language that resembles C++ in respect to modularity and such? To me, these are the words of a bad looser...

Here's another article about C/C++ . The following text contains some extracts from this article:

Pros:
  1. Many people know this language, and we don't have to readapt another language syntax, as it is the one (now ANSI C) standard in system programming.
  2. We may compile test programs immediately, without having to wait for the kernal and compiler to be done.
Cons:
  1. C/C++ is a static language like Pascal, it is not possible to program while running.
  2. C/C++ knows only early binding (i.e., it only compiles directly executable code), hardly knows about dynamic library linking. C/C++ considers a program to be complete, finished, and run in the absolute without interaction with other programs, but through the operating system.
  3. As it's a low-level language, and weakly typed, it is easy for novice programmers to make errors, such as adding characters to pointers, which may not only crash programs, but cause OS general protection faults as well.
  4. C++ is not actually a superset of C. Minor incompatibilities can cause errors if they are treated as consistent.
For the people who like to see how a really well designed object oriented language looks like (when compared to C) check out the Modulator page about Oberon or Critically following C webpages.

I assure you: I don't hate C. I just cannot understand why people use a weak language for tough applications. Read the PDF file called The case against C and make up your own mind. It's not too late yet and there are good alternatives around for all platforms.
The XDS Modula-2 compiler is available for Windows and Linux and can process Modula-2 and Oberon sources. Go for it. Save the Free World.

Page created June 2005,

Page equipped with FroogleBuster technology