3 ms·
True, the efficiency argument is wrong. Thinking about your algorithm and knowing where you actually need to be efficient are far more important. What I apprec
by michaelfeathers 10y ago
True, the efficiency argument is wrong. Thinking about your algorithm and knowing where you actually need to be efficient are far more important.
What I appreciate about C in particular is that it seems harder to "program by accident" than it is in most languages. C was my first language. After I learned C, I programmed in a higher level language for a while later before discovering that its runtime threw exceptions on 'array subscript out of bounds.' I discovered it by looking over someone else's shoulder in a lab. I realized then that I had just learned not to do that because C was so unforgiving.
We can argue whether the kind of discipline of thought that you gain from that experience is good or even useful today, but I suspect it is. It's different from learning how to do mental math in a world full of calculators - that's just raw mental exercise.
- Retra 10y agoI think that C is a very good first language to learn, not because it hardens you against errors, but because it has a very simple mental model that you can use to understand how other might languages work in terms of C semantics, which provides useful clues for what the costs are for features in those languages.
- Roboprog 10y agoI'm pretty sure that if C was the first language presented to me back in college, I would have found a new major. C was more convenient than doing assembler, but not much more, compared to say Pascal. (Having learned BASIC, FORTRAN 77, Pascal, PDP-11 ASM, Lisp at school, and some dBASE at work, before we switched over to C at school, which seemed like a big step backward) var s : string; multi : integer; ... s := 'Hello' + ' ' + 'world'; multi := 616; writeln( s, ' ', multi : 4); vs char s[ 256 ]; int multi; ... s = strcat( strcat( "Hello", " "), "world"); multi = 616; printf( "%s %d4\n" s, multi); It's a shame no work was put into good Modula 2 compilers (for various platforms) around 85-90, rather than running with C as the standard. Imagine all the security disasters that probably would have been avoided.
- Retra 10y agoC was my first language, and I did find a new major (Physics/Mathematics.) I only considered going back for a CS degree after learning Haskell.