Re: Batch file for Visual Studio build, was Why not use BUILD [was Re: Errors while building samples

> Even dirty C code (like Linux’s SCSI stack) is more or less

comprehendible. Not so with dirty C++ code. C++ is just
contra-ergonomical language.

Did you ever enter the old obfuscated “C” contest? You can write something
in any language that no one else, including you after a long enough period
of time, can understand without rewriting.

I always declare everything in the beginning of the function, not
block, and I also always end KdPrints with \r\n - this is to work
around the SoftICE issue, even though I do not use it (other
developers at SCI use it).

I like it that way and some people want all local variables in alphabetical
order too. Sometimes a purely local variable to a block can be useful,
though. I can live either way, but I do prefer a consistent rule in a
group.

Most C++ features are, in fact, a way of simplifying typing, at the
cost of code readability. If any non-trivial class has “operator +”,
and I see “a + b” in the code, then I must browse the source of this
class and all its bases for “operator +” declaration!
If this would be explicit call MyAdd(a, b) - just search for “MyAdd(”.
Multiple functions with the same name is another PITA. Too easy for a
bug to sneak in due to a bit other type. Much harder to read the code
written by others.
Even distinguishing between a method call or global function call
needs some more time.

Global function calls for driver writers usually follow a simple pattern
that if you don’t use the same pattern in your classes won’t cause
confusion. In GUI code, you can use the “::” prefix to indicate a pure OS
call. Using a browser function will help determine the location of the
function.

Given the time any programmer can obfuscate code and make it hard to read
and understand. I remember doing a PC ROM BIOS extension on a card that was
supposed to be hard to understand. It was written in assembler and used all
the debugging interrupts to set up traps to catch someone trying to trace
its execution. Not perfect, but someone tried and had to call use for help
as they gave up.

----- Original Message -----
From: “Maxim S. Shatskih”
To: “NT Developers Interest List”
Sent: Friday, October 18, 2002 7:17 PM
Subject: [ntdev] Re: Batch file for Visual Studio build, was Why not u se
BUILD [was Re: Errors while building samples of DriverStudio in Windo ws XP]