   Reason for using old language
  I was just wondering...Since C++ can do everything C can then why are people still sticking to C??   
  Since an electric screwdriver can do everything a regular screwdriver can do...;  I don't know where you've gotten statistics saying that people are sticking to C [oh]. However C still has it's uses in certain embedded systems.As for those sticking to C programming for PC I can think of a few good reasons:Good old conservatism: After several years of C you might not feel very comfortable switching to a new language (Yes, there are great differences between C and C++)Keeping your codebaseSome people just love to code stuff, and the more low-level you get, the more you have to code. So they just stick to C because they like coding in C, not because it's a better language.EDIT: Layout [ignore]   ;  Ignorance is one more possible reason. I can do everything I want to do in C, why bother learning anything else...   ;  Big part of C usage today is probably maintenance of legacy code. That said, there are other reasons to use C every now and then.* The interface of C libraries is cleaner than C++ interfaces, and doesn't use name mangling.*In systems programming, that is low level by default, using a higher level langauge would probably just get in the way.*While C++ is supposed to be portable, not all compilers implement all features of the standard, and this will make trying to support multiple compilers a pain. C compilers are generally more mature.*And finally, C is the closest thing to a lingua franca among programmers. If programmers want to share code snippets in a manner that pretty much every other programmer can understand, C is the way to do it.   ;Quote:Original post by TEUTONSince C++ can do everything C can then why are people still sticking to C??Newton's second law.You will find a huge subculture of foaming-at-the-mouth C bigots who believe C was revealed as the One True Language and would fight the jihad against the C++ infidel.  Many of the cluster around Unixy stuff (Linux, GNU).  They have gone as far as developing object-oriented programming styles and libraries without explicitl langiage support (eg. GTK+).  Their ISO standards committee keeps coming up with novel ways to maintain incompatibility with C++, evidently out of spite.The one advantage of C over C++ is that C has very primitive support for separate compilation, on a par with assembler, so it's easier to mix and match objects compiled with different compilers.  This is important for things like system libraries.;  Thank You everyone!!!   ;Quote:Since C++ can do everything C can...It's rather pedantic, but when you consider the latest version of C (C99), this statement is false (C99 supports some things, such as the restrict keyword and some interesting array declaration syntaxes, that no current version of C++ supports).Though this does not likely constitute a major portion of the reasons people stick with C (legacy code and the overhead required to port, et cetera).   ;Quote:Original post by BregmaThey have gone as far as developing object-oriented programming styles and libraries without explicitl langiage support (eg. GTK+).To be fair, though, the fact that GTK is written in C makes it possible to use it from pretty much any language. Contrast that to the competing C++ library QT, which can pretty much only be used from C++, and breaks binary compatibility between versions because of C++ linkage... So it wasn't a completely bad idea to write GTK+ in C - actually, it was a pretty good idea.;  About 5 years ago, in the embedded market you pretty much had no choice but to use C due to the horrible state of C++ feature support (if present at all).Today the embedded market often has partial C++ compilers (think Visual C++ 6.0 or earlier), or sometimes uses a GCC cross-compiler to get C++ support, so you really don't "have" to use pure C anymore.But that said, there is one thing that C has that causes nearly everyone writing anything important to use it for exporting their public interface, a stable ABI for each platform.  Let me explain what that means.  All well respected Win32 C / C++ compilers output their C / extern "C" functions in the exact same manner as all others (C defined the responsibilities of the functions for using the stack, etc) so you can compile a dll in Borland C++ 5.02, another in Visual C++ 6, another in Visual Studio .NET 2005 and all of your "C" functions will be universally callable.  This is also the only efficient way in which access to libraries are provided to langauges like perl, Python and ruby - through a C API.  This API can then be object wrapped in any given langauge (SWIG comes to mind).  The same said above from Win32 should also be true for Linux, FreeBSD, Solaris, Mac OSX, etc.  The binaries of each platform are usually compatible with each other through a C defined interface.There is no such system for directly accessing C++ classes from other langauges, or imaging trying to use C++ template libraries from some other language (since they exist in their native form only at compile time - and therefore would require the other platform to have a compileted compliant C++ parser / compiler).And while objects from languages like ruby and Python can be directly used from C++, it also is through a pure C API.Other systems have been created to replace this.  Java was meant to be an all in one.  COM / ActiveX was meant to provide langauge agnostic interop.  And now .NET advances this goal.  But all of these place requirements on the implementer that go above and beyond their original development needs, forcing them to meet the platform requirements and use platform aware compilers.  Only C is universal - because only C sits so close to the machine's inheirent architecture.In Summary:C is the language of interop   