News for hackers. Stuff that matters.
Re:Why learn C? by zxcdw on Thursday June 28, 2012 @07:39AM (#4171164)
I think C++ has greatly made C obsolete in many fields, I'd rather see people embracing C++ than C when it comes to learning and using either. For example almost everything C teaches about "low-level" and "how things work" is learned by C++ too, while giving possibility to remain at higher level of abstraction most of the time - if so desired.
Re:Why learn C? by sparkie on Thursday June 28, 2012 @08:43AM (#4171390)
The majority of good, and reusable code is in libraries - as it should be. If you write a library in C++, you're limiting potential users of said library to only using C++, because there's no ABI compatibility with other languages.

C on the other hand, has almost global compatibility with other general purpose languages. It should therefore be everyone's effort to write good C libraries and promote code reuse.

Of course, there's no harm in writing your library in C++ and exposing a C interface to it - but that's not necessarily as simple as it might sound. The better approach is to design your API in C and then figure out how to implement it in C++.

As for writing the actual applications (non-reusable part), there are obvious advantages to using C++ over C.

Re:Why learn C? by shin_lao on Thursday June 28, 2012 @07:47AM (#4171189)
C++ is awesome, no doubt about it. However it's a superset of C and the entry cost is much, much higher. Learning C is good for your culture, learning C++ is useful only if you plan on using it.
Re:Why learn C? by jaredsohn on Thursday June 28, 2012 @10:51AM (#4171945)
>However it's a superset of C

This isn't 100% true: http://en.wikipedia.org/wiki/C%2B%2B#With_C

Re:Why learn C? by 16s on Thursday June 28, 2012 @07:49AM (#4171194)
gcc itself is switching to C++ by default in 4.8.

Source: http://gcc.gnu.org/ml/gcc/2012-04/msg00054.html

Re:Why learn C? by splicer on Thursday June 28, 2012 @07:53AM (#4171211)
What the hell is g++ for? This is a stupid idea IMO.
Re:Why learn C? by cygx on Thursday June 28, 2012 @08:31AM (#4171340)
The post is about building GCC itself with a C++ compiler, which is already possible on most(?) platforms: Basically, the default of the --enable-build-with-cxx configuration option will change, which does not affect the default input language of the gcc executable (which is chosen by file extension anyway).
Re:Why learn C? by splicer on Thursday June 28, 2012 @09:25PM (#4174799)
Ah, okay. That I'm fine with. :)
Re:Why learn C? by papsosouid on Thursday June 28, 2012 @10:28AM (#4171831)
For compiling C++ code. Which gcc will start using. This is just a way to make compiling gcc take 20 times longer.
Re:Why learn C? by raverbashing on Thursday June 28, 2012 @07:55AM (#4171215)
Agree but kinda Disagree

C++ is built on C. You need to know C (but maybe not the C library) to know C++. Like pointers

Re:Why learn C? by 16s on Thursday June 28, 2012 @08:09AM (#4171256)
"Built on C" seems like the wrong phrase to me. "Extension of C" is a better fit.
Re:Why learn C? by pjmlp on Thursday June 28, 2012 @10:46AM (#4171917)
> You need to know C

Learning C before C++ is a very bad idea, as it will make you try to use language patterns that are considered bad ideas in C++, as there are safer alternatives.

Re:Why learn C? by ginko on Thursday June 28, 2012 @08:05AM (#4171247)
I think that in order to be proficient in C++, you also need to understand what separates C++ from C and how C++'s features (classes, overloaded functions, templates) map to C.