Why I've grown to loathe C
Ever since I stopped using C as my primary / go-to language (currently erlang and perl, but including pascal, smalltalk, java, lisp, and eiffel at times) I've always had this vague hatred of it, but its always been hard to quantify, with any attempts to discuss this usually being met by responses that were inevitably fanyboish, both pro, and against.
Witness Damien Katz's recent - and unintentionally hilarious - Unreasonable Effectiveness of C, and its followup (no, I'm not going to fisk them - read them, preferably not while drinking anything to avoid spit-takes). It pretty much sums up the fanboy position for any language, best summarized as
All this, until Dr. Rustom Mody came to the rescue - his brilliant C in Education and Software Engineering is the definitive answer to the canker-sore that is C (to me at least...)
Just go read it - it sez everything that I want to say (but just a lot, lot better).
An excerpt from Section 5 - Consequences of C as a mother-tongue
Witness Damien Katz's recent - and unintentionally hilarious - Unreasonable Effectiveness of C, and its followup (no, I'm not going to fisk them - read them, preferably not while drinking anything to avoid spit-takes). It pretty much sums up the fanboy position for any language, best summarized as
- Take everything that matters to the project you are currently working on
- Explain why your preferred language is the single best language to implement whatever it is
- Hint that pretty much everything else doesn't even come close
- Throw in a grab-bag of other random features that - of course - your language does best
- And for bonus points, pull a Karl Rove and claim that a few well known weak points are actually strengths (buffer overflows are useful! They help identify security threats! Also puppies! And kittens!)
All this, until Dr. Rustom Mody came to the rescue - his brilliant C in Education and Software Engineering is the definitive answer to the canker-sore that is C (to me at least...)
Just go read it - it sez everything that I want to say (but just a lot, lot better).
An excerpt from Section 5 - Consequences of C as a mother-tongue
The harm done by an overly early introduction to C is large although invisible. C-mother-tongue programmers are life long bound to find simple, elegant yet wonderfully rich ideas like Object Oriented Programming, functional programming, modularity, CSP etc. as difficult, unnatural and ‘advanced’. If these claims seem like exaggerations, it is only because of human beings’ ability to unlearn. The amount of stuff which a C programmer knows, but subsequently must be discarded as being operational, machines-pecific, implementation-specific, sequential-paradigm specific, contrary to robust software engineering etc., is incalculably large.There is more, much more. Go read the whole paper - its worth your time...
Just as a C programmer finds it difficult to grow upwards towards more high level languages, he finds it difficult to grow downwards as well. Experience with engineers (B.Techs) who are first trained on hardware, suggests that an assembly language programmer can learn C much faster than conversely. Surprisingly, an assembly language programmer can also learn higher level languages (eg. functional and object oriented) more easily than expert C programmers. The reasons seem to be that
- Assembly language programmers are acutely conscious about the drudgery that low level programming entails. C programmers however have a persistent illusion of working in a higher level language.
- The assembly language programmer has a firm foothold on computational processes even if his/her understanding is entirely operational.
Comments