C
chsalvia
I would say that, in general, you don't need to learn C before
learning C++. In fact, I would go as far as saying that there's
really no reason to learn C at all. Most programming tasks are better
handled in C++, in my opinion. But there is one significant exception
I think.
I'm sure there are many people here who will disagree with me, but it
seems to me that the C programming style is somewhat more well suited
to database and/or file-system programming than C++. Of course, you
*could* program a database or a file system in C++, but in practice,
it's mostly done in pure C.
The reason has nothing to do with language capability. As a superset
of C, C++ is more than capable of doing anything C can do, obviously.
But C++ encourages a certain, "style" or "mindset" or programming,
which is totally different than C style programming.
C++ programmers tend to think in terms of objects - non-permanent,
dynamic data structures which are stored in memory. C programmers,
however, tend to think in terms of raw data: pointers to contiguous
memory blocks, structs, etc. And objects don't always translate well
to concepts involving permanent storage, like disk blocks, etc.
That's why major file systems like XFS, reiser, etc., as well as
database systems are usually programmed in C, even though they *could*
just as well be programmed in C++.
Just to avoid confusion: I'm *NOT* saying that C is better than C++
for anything. I'm saying that, in practice, C-style programming
usually lends itself better to programs which manipulate raw data on
disk, such as file-systems or databases, rather than C++ style
programming, which usually revolves around objects in memory.
learning C++. In fact, I would go as far as saying that there's
really no reason to learn C at all. Most programming tasks are better
handled in C++, in my opinion. But there is one significant exception
I think.
I'm sure there are many people here who will disagree with me, but it
seems to me that the C programming style is somewhat more well suited
to database and/or file-system programming than C++. Of course, you
*could* program a database or a file system in C++, but in practice,
it's mostly done in pure C.
The reason has nothing to do with language capability. As a superset
of C, C++ is more than capable of doing anything C can do, obviously.
But C++ encourages a certain, "style" or "mindset" or programming,
which is totally different than C style programming.
C++ programmers tend to think in terms of objects - non-permanent,
dynamic data structures which are stored in memory. C programmers,
however, tend to think in terms of raw data: pointers to contiguous
memory blocks, structs, etc. And objects don't always translate well
to concepts involving permanent storage, like disk blocks, etc.
That's why major file systems like XFS, reiser, etc., as well as
database systems are usually programmed in C, even though they *could*
just as well be programmed in C++.
Just to avoid confusion: I'm *NOT* saying that C is better than C++
for anything. I'm saying that, in practice, C-style programming
usually lends itself better to programs which manipulate raw data on
disk, such as file-systems or databases, rather than C++ style
programming, which usually revolves around objects in memory.