During last few weeks I noticed quite a few blog articles and online discussions dedicated to something awful: bashing C as a language and C programmers who still use it and especially those who LIKE to use it. The bashing seems to be coming primarily from adepts of higher-level languages, filled with self-proclaimed superiority mixed with camouflaged attempts to proclaim the other side stupid. Even well recognized C hackers like Torvalds got their share of criticism in a rather rude manner.
And I have a big problem with that.
But before I explain myself, lets look closer what high-level language geniuses have to say. Summarizing, it predictably sounds like C is too low level and using it in 2007 is like programming in assembly language which is Forrest Gump stupid. More specific drawbacks of being so bare metal include but not limited to the following statements:
- Programming in C is too slow and unproductive.
- C programmers by default are performing premature optimization.
- C-style of memory management is inferior to automatic garbage collectors found in modern VM implementations.
- C programs have more bugs in them.
- C programs are prone to security vulnerabilities.
- C programmers write too many for loops and look stupid doing it.
- C is not that fast. Actually Java is almost as fast now!
- C programmers are not cost effective and picking C as a language of choice is bad business decision.
Dear Haskell People...
You see, most of you Haskell/Lisp/Erlang gurus are true intellectuals and are very capable. You write very well: many great “functional-style programmers” like you have nicely written blogs filled with sacks of good thoughts and ideas.
However, when I look around I rarely see any results of your work. I browse APT repository on Debian, sometimes I check out various shareware for Windows, I follow promising software reviews. I see interesting new projects pop up here and there, and almost everything is done in C. Maybe it is just me, but most of the software I'd personally use on my computers is written in that retarded and unproductive language you dislike so much.
I am counting real software, not software jobs. Because, as many of you already know, most software jobs exist out there solely to produce boring crap around SQL server of some sort for the enterprise with very few exceptions. That's the enterprise software forya. People still use it, but only if you pay them salaries. Here I want to concentrate on software people actually want to use themselves. Even pay for it. Real dollars, you know? And I don't see much of that written in higher level languages, let alone functional ones.
Moreover, looking around I can't help but notice that somehow those "stupid and ignorant" C programmers managed to build everything that powers the Internet and computers in general: GCC, Apache, Operating systems they run under, numerous tools, Gnome+friends, Doom, system utilities and personal money managers - the list is huge. Nearly everything is written in C. And it's not just legacy: if you focus on projects started within last 5 years the picture will not change much.
Meanwhile, higher-level language intellectuals produced very little. On my Ubuntu desktop I do not believe I have a single piece of software written in Haskell or Lisp. I tried Eclipse but continued looking for something usable until I discovered Vim. Even mighty Python has mostly been kept as a tool to write helper scripts as more powerful replacement for bash. I am not saying there aren't any programs written in higher level languages, I am just saying that ratio of C-to-everything-else is profound.
Why is that? Haskel/Lisp hackers, I enjoy reading books you write, blogs you maintain and I find your comments on most programming topics on slashdot very insightful. However, if your language is so superior and it makes you guys so much more productive, why don't you flood us with actual software written in it? Besides your own server-side web applications? I see so many articles and tutorials that end with "WOOW in 5 lines of code!" or "WOOW re-written in less than a week!" that it seems that all that increased productivity and your superior intelligence should compensate somewhat for your smaller number of heads.
Meanwhile, C programmers just get things done. This is why survival of any new high-level super language will always depend on having a reliable and easy interface to C. Why? Because the entire world is written in C by guys who are too busy coding and do not have time to bash cocky Haskell people in their blogs.
Peace. Respect. Love.
29 comments:
Provocative post! I must admit that on my machine I'm running:
* xmonad, a window manager written in Haskell (http://xmonad.org)
* darcs, a revision control system written in Haskell (http://darcs.net)
* hmp3, an mp3 player written in Haskell (http://www.cse.unsw.edu.au/~dons/hmp3.html)
* pugs, a perl 6 compiler written in Haskell
* ghc, a Haskell compiler ... written in Haskell
So C is not entirely dominant, however the ubiquity of GCC certainly
helps ensure C and C++ programs maintain their monopoly (at least on
Unix, I think things might be a bit different in Windows land), unlike,
say, Lisp compilers.
@previous Anonymous:
Your 'funcional' mp3 player is a frontend around C libraries: curses and some mp3 libs ;-)
This is a very interesting post and even as a functional programming advocate, I am forced to concede to your argument. C programmers get things done.
"And it's not just legacy: if you focus on projects started within last 5 years the picture will not change much."
And of course you are right in this aspect as well. The question we should be asking ourselves then is WHY do C projects and programmers seem to be able to get more projects out there that other people use? I have a few ideas:
(1) The number of C programmers SEVERELY outnumber the amount of functional programming advocates. Sure you see the more vocal population writing blogs, but in reality the vocal population is probably a far more significant amount of the population in a functional programming language than it is in C (no citation, alas). The reason I believe this is because of the way computer science students are actually taught how to programming (i.e. With C and Java). Many of these students (from my own observations, no citations again) generally do not do further research into programming languages and therefore never learn the "superiority" of those languages. This does not stop them from creating open source projects though.
(2) C is the de facto standard for writing applications, though its dominance is quickly ebbing away to the likes of Java. Again, this is mostly because of (1). If you're going to distribute your application as an open source project which people can compile and run on their machines, chances are they wont know how to do it if you do it in a functional language. Wings, for example, has incredibly complex instructions.
(3) Functional programming advocates are too busy writing blogs. (Yes, this one is a joke.)
I do not claim functional programming languages are BETTER than C though, merely that they should be considered when making your choice for a programming language in your project. C is good for some things, functional languages are better for others.
Found your blog from YC-News -- I agree with Anonymous that it's an excellent & provocative post.
I think there's a double-edged sword that helps explain both C's ubiquity and the reason many are loathe to use it. C is essentially the codification of how Dennis Ritchie liked to do assembler, in a machine-agnostic way, and it benefits from assembler's power while sacrificing relatively little (you're stuck with a few things reflecting Ritchie's style, like the calling convention, and the fact that you can local-goto, but not local-gosub). This is great, as it gives you gobs of power across many machines. That's a good edge of the sword.
The bad edge of the sword is that the libraries for C aren't anything close to universal, so while C stands bestride many architectures, using it locks you into *nix, Windows or another platform due to its libraries.
The reason why this's relevant is that all these great apps you cite for /your platform here/ were written in C for /your platform here/ by people who care about that platform, whereas the things being written by the acolytes of /new fancy language here/ are written by folks who care far more for their own productivity &c than they do for particular platform (or else they'd be imbeciles not to use the platform's native facilities). As a result, the kinds of software that're written in them tend to be the kinds of things that take advantage of platform independence.
I am a C coder myself, and it is a well known fact that C is good for some things (I specially like it to talk to hardware) and bad for a some others. The problem is that, most advocates say that "language x" beats C in any field, which is not true. C has its uses, pretty much like every other language has its use, the use that the person that developped tha language intended it for. Languages that try to accomplish everything (like Java), end up accomplishing nothing (like Java), and programmers that try to advocate why those languages are good for everything usually has not done a tenth of what they claim the language is good for because they are too busy advocating people to use the language to do those things, and no, this is not a joke. Far too much energy is wasted bashing C, and very little is produced by those.
Lets be honest!
All those high-level programming languages and their virtual machines or execution environments where made with, what else but C.
@Rafael,
That's just because mainstream OSes provide their interface in C (mainly). If you write a VM on Lisp machine, where everything---application and OS---was written in Lisp, using C would have been a poor choice.
That said, I don't really see the point of the battle between "C programmers" and "Blub programmers"; I write in Lisp/Scheme professionally, but I do write C as well, and mostly enjoy it.
Besides, any good programmer I know who is proficient in Lisp/Haskell/ML etc. is also a good C programmer. So, the real argument probably should be "Monlingual programmer vs multilingual programmer".
The main thrust of your argument is pretty silly - people use the language they know, or the ones their colleauges know, that doesn't make it a good language - so let me pose a side-question: What the hell are people doing using all those languages _in_between_ C and Haskell?
If you're writing low-level code, use C. If you're writing high-level code, use Haskell. If you need both, and enough high-level stuff that C becomes an impediment, your project is big enough to justify coding across two languages.
Those two languages have their niches. But what exactly is C++'s niche? Java's niche? I just can't imagine the situation in which using those languages is justified, except in terms of library support, but that's a _result_ of so many people using them already, so the mystery remains.
Yeah, I tried to learn Haskell but the tutorial had me type an entry the interpreter didn't like (Char.something, with no "import Char" or whatever syntax Haskell demands) and I got stuck.
If only the tutorial had actually been tested, I might have gone on and learned. Oh well, nobody will miss one fewer Haskell programmer...
Forest Gump is not stupid. Stupid is sitting through the entire movie and not getting that.
Dammit! Blogging sucks. Someone always gets offended. This time is was Forrest Gump's friend. Last time it was Shrek's nephew.
niceley said, it takes a good couple of years to be a c programmer - its engineering and of course with that you get power, the power to blow off your foot if you don't know what you're doing. It's a bit like comparing a dragline (http://en.wikipedia.org/wiki/Dragline) to a shovel in my mind, you wouldn't use a dragline to do the gardening, but digging a mine with a shovel is pretty pointless :-).
Its a lot easier to come from uni and learn a bit of scripting and make a little web site with a few pages, harder to make photoshop, hence what we see today - 1 photoshop, and a few competitors, a gajillion social web sites.
C programmers are greatest.
otherwise are dumbasses.
where greatest means the best in world
> Peace. Respect. Love.
That is a fucking lie. Your post is a giant flame. You could have made the same sort of points in a more reasonable manner, but you didn't, you are nothing but a troll.
I dislike the fact that C continues to be used so predominantly at the application level, simply because it can make for inefficient maintenance in the long-term.
Not that the high-level languages are all that. I've seen the light of implicit, ML-style typing - it's something above and beyond both the late-bound-dynamic and C-style systems that are in vogue, and I think that is far more useful than the functional programming styles closely tied to ML.
Functional programming is great in a mathematical sense because it's more generalized - imperative styles can be defined as a subset - but the biggest help any programmer can get IMHO is to find errors faster or stop them from happening.
I do appreciate that there are many experienced C programmers. But I feel like they'd get so much more done if they took a month or two out to investigate the best developments of modern PL design.
Cant type much, busy coding. While you were blogging 63 new libs submitted to hackage: http://sequence.complete.org/hwn. Enjoy
Lets write a c program that I can sell (and get money to eat and so on). Will I use visual C, Borland, GCC, which IDE will I use MS, Borland and so on. I need some graphics will I use GDI, GDI+, OpenGL, DirectX, hmmm what to choose.
Lets write an app in an FP language and sell it, there's a compiler over there, I wonder if it works, oh it doesn't produce shrink wrapped, needs a run time, it might work, s'pose I'll use it.now IDE, oh maybe I can use eclipse, or emacs someones done something there, I need some graphics, what do I do, wx seems to be supported, oh its alpha, maybe I can get openGL working...
qed
F# looks promising though
Basically, I think that each programming language has its use. For some tasks multiple languages can be used, and the choice is up to the programmer. Most of the time programming is economy-driven, meaning that the faster the program is written, the better. While it is true that in higher-level languages the same functionality can be written in a shorter, and thus hopelfully faster, manner than an equivalent program in a lower-level langiage, but much depends on what the programmer is proficient in. So in my opinion, most of the dicscussion on what is better/more useful/... is moot.
like C is too low level and using it in 2007 is like programming in assembly language
And why are you bashing assembly while using the same arguments against what could have been said about assembly vs c?
afaik before c came along ppl where selling software that was written in assembly. Most all software at that time was written in assembly.
gues what assembly got replaced, and possibly left behind, in area's and so will c. This also makes your remark about "This is why survival of any new high-level super language will always depend on having a reliable and easy interface to C." useless, wasn't C so great because you could use inline assembly?
tbh c++ has replaced c all over the place but you seem to count that as one language.
Because of dependencies increase as there is more software around(yes the industry has changed over the last 20 years). Ppl depend more on the software then ever before and there is more around then ever before. The result; replacing it takes longer.
But it's the stance as outlined above that's effecting the evolution the most, beeing glued in place. (which isn't necessarily bad.)
Anyways those arguments your defending against are mostly preemptive strikes to change the mindset of people that don't think about tomorrow and steps forward.
I wouldn't necessarily place you in that group. You think C deserves some credit for it's past and I agree. But in general that credit seems to be overrated and people shield them selfs against it. Hence the preemptive strikes.
The point is really: when does honoring the past move from quality assurance to a mere obstruction.
I hope that made some sense and wasn't offending.
greetings,
Michael B
This may amuse you...
I went back and visited a high energy physics group I used to work with recently. They're starting on the code for their data acquisition system. At one of the early meetings, people were hemming and hawing about trying to use scripting languages for fast turnaround, and which language, etc., etc.
Finally, an embittered postdoc just came out with, "Look, let's just do the whole in thing in C." The relief in the room was palpable.
But then, these folks only recently left FORTRAN 77.
(For the record, I do almost everything in Haskell these days, but it's mostly mathematical stuff for my own use, not software to fill gaps in systems.)
> * ghc, a Haskell compiler ... written in Haskell
It's never a good idea to list compilers for language X written in language X as examples of how much language X is used in real projects.
Welcome to Cisco, where we maintain 21 millions of C code for IOS XR, backbone for what you able to do everyday using your browser
Excellent Article. I will link to this article from our site. Take some time and check out ICanFreelance.com for any recruitment process outsourcing or outsourcing statistics.
Dear thank you sharing you information.it was very useful for me.because i am presses in this section....happy bloggingcompany logo design _ | _ logo design
What a post man this looks like emotional and artistic . I really appreciate your art work skills.I am used to searching such type of designs again very creative.green apartment living
Nice post. Great blog.
Clone Script| Super Bowl 2012|
cheap goose jackets online sale Denmark Canada, UK,
goose trillium parka jackets online sale Denmark Canada, UK,
Canada goose freestyle vest online sale Denmark Canada, UK,
Canada Goose Chilliwack Bomber sale online sale Denmark Canada, UK,
Canada Goose Mens Citadel jackets online sale Denmark Canada, UK,
cheap Goose Expedition Parka coats online sale Denmark Canada, UK,
canada goose snow mantra parka online sale Denmark Canada, UK,
Canada Goose Yorkville Parka Jackets online sale Denmark Canada, UK,
womens Goose Chilliwack Parka online sale Denmark Canada, UK,
womens Goose Expedition Parka online sale Denmark Canada, UK,
womens Goose Kensington Parka Jackets online sale Denmark Canada, UK,
womens Goose Montebello Parka jackets online sale Denmark Canada, UK,
Canada Goose Womens Solaris Parka online sale Denmark Canada, UK.
This is a very important issue and this slide is very helpful. I would mention that many of us readers actually are definitely blessed to live in a fantastic website with very many special professionals with beneficial points.Miami Beach Condos
Post a Comment