p = &(*p)->next; // Learning C

bg_CLooking back on 25 years of experience in C programming I consider C still to be the queen of languages to write complex, fast, and powerful programs although there are many other powerful new languages today. C++ is even more powerful in several applications but it bears the risk for novice users who are familiar with C to produce a horrible C/C++ code mix.

In courses and workshops in C programming I often encounter similar questions or assumptions which are very often simply wrong. From those experiences I derived a set of rules. Although written in respect to C, many of them apply to most other programming languages as well.

  1. It (the language) does not magically solve your problem. You cannot solve a problem (i.e. write a program) if you didn’t understand the problem (You cannot build a ship if you do not know why it keeps afloat.).
  2. An IDE does not solve your problem either. It also won’t write the [essential parts of the] program for you (That’s true even for the most heavy-weight dinosaur-like IDE’s such as MS Visual…).
  3. Your program does exactly what you told it to do. It does nothing else magic in the background. If you didn’t tell it to do something, it simply will not do it (things like freeing memory, enlarging arrays,…).
  4. The C language (and the compiler) follows some strict rules. They do not change under some magic circumstances.
  5. If you avoid using pointers because you were told that they are dangerous you should either start to understand pointers or stop using C. They are one of the most powerful tools of C. Driving a car without gas pedal is boring, too 😉
  6. Unpracticed programmers produce bad code. Thus, practice!

Comments are closed.