5 ms·
Respect C Programmers
Recently I just got fed up with unfair criticism of C...
- MuddyMo 19y agoI wonder why this post isn't getting any love?
- Goladus 19y agoI didn't vote it up mostly because I didn't feel strongly one way or the other about it. It's unclear whether the author really understands why C was chosen for many of the apps he lists as evidence that C programmers deserve respect.
- DocSavage 19y agoThis is why I didn't vote it up. The blog post makes a weak argument in support of C; namely, most foundational code is programmed in it. If you go back through computer eras, you could craft a similar argument for each of the dominant languages of the time (including assembly). I agree with Goladus that the author never says why C is appropriate or best for some of those apps he cites.
- DanielBMarkham 19y agoI gave it some love. I especially like the part about "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." It seems his argument is that there is some evolution at work in the marketplace. Instead of arguing the "bestness" of language X or Y, simply look around and see what is thriving and what isn't. That would be a great discussion to have here. I'd add more, but I think I'd sound like a troll. Good article.
- byrneseyeview 19y agoIf you're going to decide that an idea is right based on how many people agree or disagree with it, you have a problem: anyone who creates something new is tied for wrongest person ever. Also, http://www.paulgraham.com/avg.html http://www.paulgraham.com/avg.html
- DanielBMarkham 19y agoI wouldn't judge anything by how many people agree or disagree with it. I would simply acknowledge that a lot of people feel one way or the other. Why not view programmers as customers, and languages as products? Are the customers buying the products that provide them the most value? I believe your argument is that they are not. Then why? Are they dumb? Misled? Controlled by people who don't know any better? It just seems like there is some missed communication going on here. I know I'd like to see somebody who is an expert in both functional programming and some ornery imperative/OO language, like C++, make some observations. By expert, I mean several non-trivial deployed production systems in each language, not somebody who played with language A in college is now infatuated with language B. As for me, I'll pick whatever language makes my startup get to market and adapt to customer's needs the fastest. I hear PG says that's probably one of the functional languages. I'm game. I can prototype and change a web site very quickly in several other languages (with the right tools), I'm always willing to see if something else will work better. But I can certainly also make the observation that there must be a lot more functional programmers who moved to imperative programming than the other way around. Surely they all can't have done so for the reasons I've outlined above.
- davidw 19y agoLanguages as products rings a bell: http://www.welton.it/articles/programming_language_economics.html http://www.welton.it/articles/programming_language_economics... A lot of the 'value' in a language is its network of users. For every X users, depending on how much your average user is likely to contribute back (some constant C), there will be Y contributions in terms of libraries, help on lists, user groups, articles, things like that.
- cellis 19y agoawesome post. flame me. i think PG is one of the smartest people in Web 2.0, but I'm not drinking the lisp koolaid. I write in descendants of c - C++, C# and php.
- brlewis 19y agoI won't flame you -- I agree that it's pointless to bash C programmers. However, you should note that C# is mainly a descendent of Java. When you use it you've been dragged about halfway to Lisp, even though you get to keep your curly braces and semicolons.
- Goladus 19y agoSome things I like about C: 'void' means an empty parameter list, a function that returns no result, or a pointer to anything. There is an array type, which you declare with brackets[10]. It's a real type on par with all the other real types in the language. Yet, accessing the values in an array is done exclusively via pointer arithmetic. int foo(); declares a function with unspecified parameters, unless it is C++ where it means no parameters. char x[5] = "Hello"; //Is an array of 5 chars, and has no string-terminator char x[] = "Hello"; //Is an array of 6 chars, with string terminator. You can declare functions that take matrices of variable size, but only in one dimension. int bar(char mat[][4][5]); Unless you're using variable-length arrays which were added to C in 1999, but aren't widely supported in compilers.
- MuddyMo 19y agoExcellent examples of C annoyances.
- rob 19y agoI'm learning to develop OS X apps and have been learning C / Objective-C and have to say I enjoy it.
- gommm 19y agoObjective C is a heck of a sweet language.... It's one of the few C based object oriented language that feels enough like ruby to make me like it ;-)
- mynameishere 19y agoC and C++ and Java, etc, were written for practical reasons, and they attract practical followers. When someone writes a blog post about Java, it's rarely to show a "trick" or to prove superiority, but rather to solve some problem. If I'm typing away in Java, you KNOW I have an end-goal. No one plays around, because...it's not a toy. It's like saying, French is a more beautiful language than English (it is, you know). But compare the import/export ratio of the film and popular music industries. I can't recall the last French pop song I heard... Wait, I do: http://www.youtube.com/watch?v=2-sUzR71wpQ http://www.youtube.com/watch?v=2-sUzR71wpQ
- Zak 19y agoMost of the blog posts I've read about Java lately are indeed about solving some problem. Unfortunately for Java's reputation, the problem is usually the lack of ability to perform one of those "tricks" that "toy" languages like Lisp can do. As for C, I suspect there's more information about C "tricks" online than all other languages put together. For example: http://www.ioccc.org/ http://www.ioccc.org/
- geebee 19y agoI haven't noticed as much C-bashing. It always seemed to me that people recognize that C programming is pretty damn hardcore, and that the people who have mastered it are accomplished programmers. I still see quite a bit of reverence for kernel programmers. Yeah, there's some C bashing, everything gets bashed. But Java has taken much more of a beating lately than C. Otherwise, I largely agree with the article (although I don't actually think C particularly needs defending right now). The only point I disagree with in this article is the exclusion of server-side web applications when he says "show me the code." Server side web apps aren't the dull, stateless things they used to be - trememdous innovation is taking place here.
- cstejerean 19y agoOne of the big reasons a lot of code is written in C is because a lot of schools, especially in Europe and Asia teach C/C++ starting at the high school level. Even US schools used to do this until recently (a lot have switched to Java now). So it makes sense that a large percent of the open source software is written in C/C++.
- michaelneale 19y agoBy "school" you mean College or University I presume? (which is what most of the english speaking world calls them). Otherwise highschools are far more advanced in the US then I am led to believe ;)
- cstejerean 19y agoDon't be fooled, high schools int he US are pretty terrible in general. Most of the math and science I covered in high school in the US I learned through 8th grade in Romania. But the AP level courses are great. The high school I attended taught C++ as the AP course (switched to Java the year after I took the course).
- rms 19y agoMy relatively well-off public high school had an elective year long programming sequence that was half Pascal and the second half C++. Then, AP Computer Science was taught in C++. Right after I graduated, AP Computer Science switched to Java and my school started teaching C++ as the first programming language, then Java, then Java again for AP CS.
- Zak 19y agoA lot of software has a base runtime written in C with much of the higher-level functionality written in a higher-level language. Firefox does this with Javascript and Emacs does it with Lisp.
- davidw 19y ago"Ousterhout's dichotomy", although I'm sure it predated him: http://en.wikipedia.org/wiki/Ousterhout's_dichotomy http://en.wikipedia.org/wiki/Ousterhout's_dichotomy
- far33d 19y agoC is the language of the operating system. It's also very portable. It doesn't require that any other packages be installed - it compiles to machine code. LISP/Haskell/Python/Java don't have this quality, and so desktop software will probably always be dominated by C and it's sad offspring C++. Other "high level" languages are however, becoming increasingly dominant on server-side or hosted products, since the developers can control the execution environment closely.
- Goladus 19y agoLisp compiles to machine code. Here's a page on how to do it with clisp: http://clisp.cons.org/impnotes/image.html http://clisp.cons.org/impnotes/image.html
- Zak 19y agoClisp compiles to bytecode, not native machine code. Saving an image with :executable set bundles a copy of the Clisp runtime and your program's bytecode in to one file. Most other Common Lisp implementations do compile to native machine code, but not all can bundle the runtime with an image. Similar tools exist for other languages which require the language itself to be present while the program is running.
- jey 19y agochar*____="RDCO$Utho{kfah||0R}wq5\x7fy8Z;";int main(int _, char**______){return _>!0xBADC0DE?main(!0[______],&____):! (-_)[*______]?!putchar(10):putchar((*______)[-_]^-_)?main( --_,______):0xDEADBEEF^!!"Valid C89 but not C++ nor C99";}
- ptn 19y agoAlso, you don't really understand a high-level language unless you understand C. (I'm mostly talking about Python and Java here.) If you think of Python lists as dynamic arrays of pointers to void, the world suddenly becomes easier.
- cstejerean 19y agoIt does? I think that actually makes it less clear what lists in Python are actually good or bad for. I think thinking of them in terms of a linked list in C is a much better abstraction.
- ptn 19y agoA linked list in which every node is a void pointer. But that would be kind of the same. What I meant is that knowing how you would have to implement each of your high-level data structures in C helps you understand some of the problems you encounter when working with them. For example, now I know the difference between these two Python lists: l = [[1,2] for i in range(6)] and l = [1,2] * 6
- ced 19y agoI think of a list just as "a list". An ordered collection of anything. "Linked list" is not an abstraction (at least, not in Python), it's an implementation detail. And IIRC, Python lists are not actually implemented as linked cells, so they have different performance characteristics.
- mojuba 19y agoC is as essential as electronic engineering. More generally, a programmer's learning path should go through (a) understanding how machines work (b) understanding C and (c) understanding the rest. You will never truly get the idea of Lisp or Python unless you know the lower levels, including the intermediate ones, which is C in particular.
- ptn 19y agoI totally disagree. C is definitely *not a good language to learn to program in. I actually think that programming should be learned the other way around.
- mojuba 19y agoWhy?
- ptn 19y agoThere's too much to worry about; besides, being efficient isn't an issue when you are a beginner. Better to learn with a language that hides the low-level details so you can focus on actual programming. In other words, I think that you should learn first how to teach the computer to do stuff and only after having done that for a while should you try to understand how the computer interprets the instructions you give it. Of course, you could take the very first steps in any language (except maybe Intercal), but once you get to strings and the like, C is more likely to make it more difficult instead of easier.
- cstejerean 19y agoIt's interesting trying to watch a non-programmer try to learn a language like C, C++ or Java and try to figure out the reason for all the boiler plate code to get something simple done. They ask questions like: Why does printing "hello, world" require more code than "print 'hello, world'"?
- tokipin 19y agoi once let a friend use my TI-89 for a couple of minutes. he wanted to program a game for it. when i checked to see what he had written so far, it said "there is a ball" although hilarious, it's an ideal that shouldn't be laughed at
- henning 19y agoLousy troll.
- tx 19y agoGuys, many of you missed my point. The post was not about C. It wasn't about the language, it was about people. I wanted to point out that C programmers, as a group, are getting things done. I suspect there aren't that many of them, there are fewer people programming C these days as compared to Java or C#. But they produce spectacular number of open source products we all use. Respect them for that. That's all.