View Single Post
  #115   Report Post  
Robert Bonomi
 
Posts: n/a
Default

In article ,
Doug Miller wrote:
In article ,
(Robert Bonomi) wrote:
[long snip of interesting idea]
But trying to explain _how_ that trivial little "50*period" incantation
accomplishes that magic is *very* involved.


In similar situations, I have been known once or twice to write comments along
the lines of "Trust me: this works. If you can't figure out why, you probably
shouldn't modify it."

Those comments occasionally produced some chuckles... but never any
complaints.


I did that once. The boss spent the *entire* week-end trying to figure out
_how_ it did what it did. Including setting up a test-bed program to verify
that it really did do what I claimed.

Monday morning, I get called into his office. Whereupon he makes the request
to 'explain this thing to me', and then would I _please_ not do things like
that 'late in the week' -- that it was hard on management when they discovered
it after I was gone for the week-end.

After that, he made me write up complete comments on *how* it worked.
That was the full-page of comments for the one-line (one machine-instruction)
code.

The particular functionality was heavily used in that set of applications,
and my approach was 'merely' 3-1/2 orders of magnitude (decimal) faster than
what they had been using. That -single- change made a difference of 15-20%
in the run-times of some of the applications that were converted to use it.