Re: Does Bill Gates know about the DDK regarding C++?



> about the expressive power of the language. I use STL too, with allocators
> that are suitable for kernel mode.

STL is a nightmare in terms of memory fragmentation.

Also C++ code is known to crash on memory allocation failures. Look at MySQL
(coded in
C++), for instance - if the ORDER BY clause touches too large a table and there
is no suitable index, it crashes with SIGSEGV (corrupting the database
sometimes).

C++ suggests to use exceptions to recover from such situations. And exceptions
are evil a) they require complext runtime support b) they overbloat the stack
usage of _each_ function even if it has no try/catch blocks c) the state of the
system is not known at all at the point where exception was caught, so,
continuing to run from this state will often cause a crash a bit later.

Lots of C++ features are of the "type and forget" style and provide nothing
good then reducing the amount of typing (by increasing the effort needed to
comprehend the code). This is OK for things like GUI apps, not OK for
system-level development.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@xxxxxxxxxxxxxxxx
http://www.storagecraft.com


.



Relevant Pages

  • Re: GC in Jons raytracing benchmark
    ... Using new and delete with reference counting, ... > The simplest way to address this issue is to switch to C++ and use STL ... > containers instead of malloc and free. ... > and play around with multiple allocators or adaptive allocation and so on. ...
    (comp.lang.lisp)
  • Re: Throwing Exceptions
    ... Okay, ... I'm thinking analogously to STL. ... STL encourages some good coding practices, and that STL users can tell ... Are exceptions good for me, even if I don't want to admit it? ...
    (comp.programming)
  • Re: unexpected exception handler
    ... STL streams don't normally report I/O errors as exceptions, ... You can enable exceptions by changing the exception mask - ...
    (microsoft.public.vc.language)
  • Re: unexpected exception handler
    ... Exceptions outside software control are all OS exceptions, ... Under what circumstances would Windows report I/O error as a structured ... because STL already provides for I/O errors (which are not "outside software ... But see the comments to this blog entry for circumstances where I/O errors ...
    (microsoft.public.vc.language)
  • Re: Throwing Exceptions
    ... Exceptions are sporadically used by 3rd party libraries and frameworks. ... With the exception of the STL and probably Boost, I haven't seen any library or third party framework that is designed to take advantage of exceptions consistently. ... C++ permits code to throw exceptions without declaring them; exception safety isn't enforced by the compiler as strongly as in, say, Java. ...
    (comp.programming)

Quantcast