AFAIK, Windows is in C because that was what was available back then, but C++ is much more powerful than C. True that you can get things done in C, but you can get things done better in C++.
For example, I wish you good luck trying to manage collections in C. You'll have to use C arrays, meaning you will have to keep dynamically allocating memory, copying data around removing pointers, etc. It is just not worth it. In C++, you could create a simple array class that would do it for you:
static const int C_StdCapacityIncrease = 32;
Array(int initialSize = 0; int capacityIncrease = C_StdCapacityIncrease)
: _arrPtr(initialSize ? new T[initialSize] : 0)
, m_size(initialSize), _capacity(initialSize), _capacityIncrease(capacityIncrease)
_capacity += capacityIncrease;
T *tempPtr = new T[_capacity];
memcpy(tempPtr, _arrPtr, m_size);
_arrPtr = tempPtr;
int Add(const T &item)
if (_capacity <= m_size)
_arrPtr[m_size] = item;
_arrPtr = 0;
That would be just an array class with very basic functionality, of course, and look at all those lines, because all that is needed to properly maintain a C array. In C, you would have to code standalone procedures to take care of all that, like this:
//The C way
void* CreateArray(int initialSize, size_t sizeOfItem)
return malloc(initialSize * sizeOfItem);
void FreeArray(void* arrPtr)
The C way then imposes a lot more work to each array you create: You must ensure you delete memory yourself, you must keep track of sizes and capacities yourself, etc.
And don't even get me started in the elimination of an item in the array in the middle of it. :-S
C++ produces far better code, IMHO.
P. S. : I know that if you are using C++ the best would be to use std::vector. I just made an array class as an example of the complexities that can be abstracted into a class.