3 ms·
The fact that C is the most popular programming language is not a good argument for procedural programming, because it is quite common to use OO techniques with
by humbledrone 17y ago
The fact that C is the most popular programming language is not a good argument for procedural programming, because it is quite common to use OO techniques with C. In fact, most of the C projects that I have worked with use OO techniques in some form. For instance, look at the Linux kernel. There are plenty of structures that include function pointers, which in practice is very similar to inheritance. Also, consider the UNIX concept of a "file"; that's OO design, pure and simple.
I wouldn't say that C++ is "better" than C, but for certain tasks I think it is easier to use. Consider the C++ inheritance model; sure, you can do the same thing in C, but unless you choose a common convention, each new developer will have to learn your way of doing it. With C++, inheritance works in a uniform way, so a new developer doesn't have to guess at how you did it.
With that said, I think that there is something to be said for the simplicity of C, versus more complicated languages like C++. It is a bitch to learn C++, and some of the most unreadable messes I've seen were written in C++. So I think there's certainly an argument for C, but it doesn't have anything to do with whether it is OO or not.