LWN.net Logo

Quotes of the week

Quotes of the week

Posted Sep 15, 2007 18:13 UTC (Sat) by pphaneuf (guest, #23480)
In reply to: Quotes of the week by nix
Parent article: Quotes of the week

C does try hard to avoid people using different subsets, by the simple solution of providing so little that you have no choice but to have a very large common subset between different projects (some stuff is not that used, like C99 variadic macros, and other not at all, like trigraphs).

Me, I like type checking (no, this filetype_t enum is not compatible with that filemode_t enum, thank you!).


(Log in to post comments)

Quotes of the week

Posted Sep 15, 2007 21:06 UTC (Sat) by nix (subscriber, #2304) [Link]

Variadic macros do get used, but mostly in header files, often below
comments reading something like

/* Deep magic below. No user-serviceable parts inside.
You have been warned. */

Quotes of the week

Posted Sep 16, 2007 2:35 UTC (Sun) by pphaneuf (guest, #23480) [Link]

For sure, but in my opinion, this is also where something like the implementation of the C++ "function", "bind" and "lambda" go. They are incredibly easy to use ("function" behaves just like a function pointer, basically, only better), but yow, here be dragons in the implementation! I'm responsible for at least one pre-"function" implementation of that idea, I suggest using the standard one over implementing your own any day of the week!

While I am myself a C++ programmer, and I feel that nowadays, C has more or less been obsoleted by C++ for what I do (if you're careful about the subset you're using, you can even use it for most kernel programming, there are only very few specific exceptions, like the tendency of GCC of putting things it could put in the text segment in the data segment instead), I have to agree 100% with Linus there. C is harder, but forces people to think things thorough, and while that raises the barrier to entry for contributors, that's good.

It's kind of frustrating, because I'd like to make it easier for myself, but when it's easier, the idiots come out of the woodworks with braindead patches up the wazoo... It's one thing I've observed over and over, that it's simple to see what's easy to do, you'll find a bunch of them, all poorly implemented. Visual Basic made GUI applications easy, and PHP/ASP did the same for web applications, see what happened there...

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds