Which C++ version?
26-Aug-93 14:51:12
Sb: #36551-Which C++ version?
Fm: Steve Bennett/SYSOP 76702,1071
To: John Bono 71736,1322
Actually, you make my point better than I do myself… You're quite right, all
the programmer needs to know is what goes into add and what comes out of it.
But he *HAS* to know that. Which is my whole point. Looking at just the few
lines of code you wrote in your message, I have absolutely no idea what add
does, nor for that matter what stuff or morestuff are. Even assuming I *did*
know what stuff and morestuff are, I could very easily make an incorrect
assumption about what add does based on it's name and what I know about the
data associated with those objects. Even if there's some document somewhere
which goes into excruciating detail on the stuff & morestuff objects, and what
add does with them, a programmer who has had slight experience with those
objects is likely to see "add" and assume one thing, while the object may do
another thing.
One key to how clear and maintainable any piece of code is, is whether any
generic programmer who knows your programming language can look at any given
function or fragment and quickly figure out from the code & it's comments a
rough idea as to what the code is intended to do. Black Boxes are nice at
times for code development (and they can be done in any language…) but aren't
always so nice when it comes time to pass the code onto someone else to take
care of, since the other person needs to learn all the boxes before he can make
sense of the rest of the code.
And more often than not, I find that most Black Box type code doesn't move well
into other projects. I'm *always* finding it necessary to make changes when I
do things like that. (Of course, I'm always designing custom replacements for
things like controls and the like, *especially* in environments like Windows
where the controls are supposedly "object oriented", not to be confused with
anyone else's definition of the term… <g> With the exception of the standard
pushbutton, I've found it necessary under Windows to rewrite nearly every
standard control my own way just to make it behave *slightly* differently…
<sigh>)
–>Steve Bennett
–>Steve Bennett