Re: Does Bill Gates know about the DDK regarding C++?
- From: Mark Roddy <markr@xxxxxxxxxxxxxx>
- Date: Tue, 07 Jun 2005 20:22:24 -0400
Don Burn wrote:
First is you have not read http://www.microsoft.com/whdc/driver/kernel/KMcode.mspx read it. Second, as I said in an earlier post, there are people who carefully craft drivers in C++ for the kernel. One of the careful things is never use STL, even the most rabid C++ types I know would never use this in a kernel driver.
I don't use C++ for a lot of reasons:
1. Kernel driver programming is hard. Bottom line you have a lot things to get right, so why add another problem to a already complex task.
2. C is the standard. I try to think of my customer whether I consult or an an employee. One of the things you have to consider is the next person who gets your driver. Are they going to know C++ as well as you do (and if you don't know it well you shouldn't use it), are they going to be able to easily understand you classes. One thing going for driver development is that drivers enforce a lot of structure on your code, hiding things in C++ can obscure that structure.
3. C++ can do a lot of things behind your back. See the paper for some examples, but bottom line is C++ can grab stack, create initializers in unexpected places and in general surprise you. Note: that some Microsoft teams that use C++ in the kernel, do assembler code reviews to be sure things are right.
I like C++ for a lot of things. I have used the language for over 20 years. I have supported compilers for the language and written code generators for the language. Finally, I was on the C++ standards committee for a while.
But while I like C++, I take the minimal C++ approach that many Bell Lab's people did in the early days of the language. I.E. use it for clean simple encapsulations and small classes. Even with this approach, I would never use the language in the kernel.
Oh good grief here we go again.
Folks this has all been discussed and hashed out endlessly. There are limits on what you can do with C++ in the kernel. On the other hand there are good reasons for using object oriented languages.
Don forgot to mention that WDF is written entirely in C++, except of course for the exposed C api for us mere mortals. I rest my case.
--
===================== Mark Roddy DDK MVP Windows 2003/XP/2000 Consulting Hollis Technology Solutions 603-321-1032 www.hollistech.com .
- Follow-Ups:
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Robert Marquardt
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Mike Yoke
- Re: Does Bill Gates know about the DDK regarding C++?
- References:
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Robert Schlabbach
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Mike Yoke
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Don Burn
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Mike Yoke
- Re: Does Bill Gates know about the DDK regarding C++?
- From: Don Burn
- Re: Does Bill Gates know about the DDK regarding C++?
- Prev by Date: Re: Why is the driver file size so big?
- Next by Date: RE: PREfast warning seems bogus?
- Previous by thread: Re: Does Bill Gates know about the DDK regarding C++?
- Next by thread: Re: Does Bill Gates know about the DDK regarding C++?
- Index(es):
Relevant Pages
|
Loading