Re: Batch file for Visual Studio build

At 12:21 PM 10/18/2002, you wrote:

This is the first mistake C++ programmers make; C++ is NOT a better C. I
surly understand C++. I towed the C++ band wagon for many years. This is
exactly the problem; using C++ features in a C way to make a better C. How
many programmers have I met that called C++ a better C. Might as well go
back to Pascal.
It doesn’t require C++, for me to to make an assertion like that would be
silly. I am curios why you think C++ is more comparable to pascal, and
why you think it isn’t better than C.

If your driver requires C++, I recommend reviewing your design. The last
thing I want in a driver is multiple layers of abstraction and as for
constructor and destructor; give me a break; literally.
You are totally making my argument for me. Who says you have to use
constructors & deconstructors?

Has anyone ever wondered why all MS drivers are in C; at least the ones in
the DDK?
There is nothing to wonder about… that is a silly argument. The Kernel
more or less pre-dates C++.

Jamey

So many people seem to think that by definition C++ has some kind of
inherent large overhead. This mostly untrue. It is in my opinion that the
key/root feature of C++ is encapsulation (member functions for a structure
). Looking at the examples below, the compiler generates nearly identical
object code. The stack frame is the same, one pointer parameter for
each. This in no way impairs a drivers ability to function. It is
certainly not required to use classes, it can be cleaner though. C++ is
mostly a way of thinking and organizing code.

-Justin

Here is an example in C:

typedef struct _MARBLES {
int marbles;
char* name;
} MARBLES, *PMARBLES;

void printdata(PMARBLES data)
{
printf(“%s has %i marbles.\n”,data->name,data->marbles);
}

int main()
{
struct MARBLES m={10,“Jimmy”};

printdata(&m);
}


Here is the C++ version:

class MARBLES
{
public:
void printdata();
int marbles;
char* name;
};

void MARBLES::printdata()
{
printf(“%s has %i marbles.\n”,name,marbles);
}

int main()
{
MARBLES m={10,“Jimmy”};

m.printdata();
}

>There is nothing to wonder about… that is a silly argument. The
Kernel more or less pre-

dates C++.

C++ was already there in 1985, while MS started the kernel in around
1989.
Borland made several commercial C++ implementations at the time MS was
writing the NT kernel. C++ was not a new thing when the kernel was
written.

So many people seem to think that by definition C++ has some kind of
inherent large
overhead.

Overhead in code understandability, the runtime overhead is really
neglectable.

This mostly untrue. It is in my opinion that the key/root feature of
C++ is encapsulation
member functions for a structure ).

Easily achievable in C without special syntax for it.

Max