LWN.net Logo

Why learn C? (O'Reilly Radar)

Why learn C? (O'Reilly Radar)

Posted Jul 4, 2012 12:13 UTC (Wed) by jwakely (subscriber, #60262)
In reply to: Why learn C? (O'Reilly Radar) by landley
Parent article: Why learn C? (O'Reilly Radar)

> In C++ you learn piles of caveats to the base language, "don't throw an exception from a constructor",

Nonsense.

> there's no way to prove a C++ compilation using templates will ever finish

Erm, except to maybe try compiling it. Templates are Turing complete, but in practice compilers have limits on how many levels of instantiations they'll handle and rapidly run out of memory (and crash) if you do something stupid/crazy.

And so what? Is the fact that there's no way to prove a C program will ever finish a practical problem? If not, why is the Turing completeness of templates a practical problem?


(Log in to post comments)

Why learn C? (O'Reilly Radar)

Posted Jul 4, 2012 12:39 UTC (Wed) by dgm (subscriber, #49227) [Link]

>> In C++ you learn piles of caveats to the base language, "don't throw an exception from a constructor",

>Nonsense.

Maybe just misinformed. In fact, exceptions are the only way to propagate errors in constructors, you cannot return an error code. But I guess what he really meant was "destructor".

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