Re: what to make of read_interfile.pro ? [message #63128] |
Wed, 29 October 2008 07:40  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Mike wrote:
> In the code, there is a structure that handles image headers. Each
> header has widget_base associated with it and the uvalue for that that
> base is used to store the header data value. There is another
> widget_base uvalue that is used to handle valid choices. This is in
> an entirely non-gui procedure by the way. At the end of the
> procedure, there is a loop that "widget_control, /destroy"s the
> widget_bases.
>
> Anyone have an idea of why the author might have made that choice?
> Were there no pointers in 1993? Maybe the original author
> (Goldstein) just wanted to toy with us here in the future?
Pointers were introduced in v5 - and back in '93 I think something like v3.6 might have
been current. But, didn't v3 and such have those things called "handles" that were sorta
like pointers? Anyway....
> Anyway, out of respect/fear/queasiness, I think I may let this
> procedure rest in peace and write a header cleaner/fixer to stick in
> between reading the header and interpreting it.
I think respect is warranted - the author came up with a clever solution when no other
methodology was available. But, regardless, read thee some books/articles on unit testing
and refactoring techniques and you should be able to fix the code without any vestiges of
fear and/or queasiness -- assuming, of course, your boss doesn't mind (or know :o)
cheers,
paulv
|
|
|