reasons to learn c

i found an article using Digg, which gives ten reasons, why every programmer should learn C.

i personally think, that a programmer should learn C. it’s used in many areas, so it comes handy on such cases. but there’s no need to learn a lot of it. there’s no need imho to learn how to write complex programs in it. just learn the basic stuff (hello world, fibonacci, read/write files, basic string-manipulation, etc.).

but the arguments proposed in the article seem wrong/incomplete for me. well, some of them are mostly correct, some are half-correct, and some are plain wrong. generally the problem with it is that the author seems to have come from a C/C++/Java/C# world, so he completely ignores the rest (ruby, python, smalltalk, lisp, haskell, ocaml, erlang etc.)

so let’s look at the arguments:

1) C is lower level then other programming languages (C++, Java). Programming at a lower level allows you to further your understanding of computers, as a whole.

this is correct, but if it is so, why don’t you learn assembler? it’s even lower lever than C.

>

2) Device drivers and operating systems are written exclusively in C. Now, you may never write a device driver or an operating system, but what if you are ever required to modify one?

while it’s correct that most of the operating systems are written in C, not all of them (for example, House is an operating system written in haskell).

also, for a programmer there are usually a plenty of new technologies he can learn about, so he should always think about if it pays off or not. and, well, for me, writing op-systems and device drivers does not seem that interesting.

>

3) What if you ever want to get a job programming microcontrollers? They are programmed in C. Are you going to limit your possible list of jobs because you didn’t want to learn a new language?

again, the same as #2. it depends on whether you’d like to program microcontrollers or not.

>

4) C programs are smaller and faster then any other program created in a different language. Sometimes your program needs that speed boost that only C can give it.

not true.

  • if we follow his analogy (lower-level language means faster programs), then we can also say that Assembler is faster than C
  • on the other hand, the optimizers for higher-level languages are becoming faster and faster… like java’s Just In Time Compiler etc. check for example The Computer Language Shootout. you will see that the C solution is not always the fastest (sometimes java is faster for example). of course, the C version is always very fast, no question there. but saying that it’s always THE FASTEST, is wrong.

>

5) If you have learned C, you can learn any modern programming language. The reason behind this is that all modern programming languages are based on C (Java, C++, C#, etc).

somehow the author of the article does not realise that using phrases with “all” is very dangerous. did he really check all the obscure, niche programming languages and made sure that they are all based on C?

for example, i’m pretty sure Brainfuck is not. but to come back to “more mainstream” languages, most of the functional ones (like OCaml, Haskell or Lisp do not look like C programs at all (just btw: all 3 of the linked programs were faster in the binaryTree test than the C version :)

>

6) Because C has been around for many years, it has a large community and collective code base. This allows you to quickly and efficiently implement new algorithms or functions that have been programmed before.

ok

>

7) C is the language of the Open Source community. The Open Source poster child, Linux, was coded in C. If you know C, you can participate in and contribute to numerous Open Source communities like Source Forge.

all what he says here is true. but, check this Source Forge statistics:

the most used language on SF is (at least was at the point where it was measued in 2006) Java, followed by C++, followed by C. (and btw. check the “popularity” of C in the graph. see the sinking blue line? :)

in other words: while it’s true, that there are many C projects on SF, there are more java projects there. so if you base your decision purely on SF-popularity, Java is a better choice.

8) C is the only language that teaches you what pointers really are. C# and Java skip the subject completely. It is pointers that give C its power.

true. but using this argument, i could say, that if you don’t use C, you don’t need to have/use/understand it’s power. so why bother with pointers?

for some strange reason, many people think that pointers are the most important concept in programming. there are many other hard (imho much harder than pointers) areas in programming, like concurrency or distributed-programming.

>

9) C is still the most commonly required language for programming jobs. It is well worth your time to get C under your belt.

hmm.. i would like to see the statistics… i also cannot dig up a statistics currently, but if i remember correctly, visual-basic was also quite popular… >

10) Anything that has a microprocessor in it has support for C. From your microwave to your cell phone, C powers technology.

how is this different from #3?

Trackback URL for this post:

http://www.nekomancer.net/trackback/144

Comments

Maybe the original post was

Maybe the original post was a bit to absolute I still think know C is a good idea. Look at this new school, http://neumont.edu, they teach mainly C# and Java as a side note. No C or C++.

Hi, I have been looking for

Hi, I have been looking for sites like this for a long time. Good luck.