comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Object style guide
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Object style guide [message #17731] Fri, 12 November 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Martin Schultz (m218003@modell3.dkrz.de) writes:

> I'd be extremely happy if (especially) the gurus among you would find it
> equally useful to adopt a new format for the file header in object
> definition routines. The attached file should serve as a basis for
> discussion, I am open for any suggestions.

I appreciate you getting the discussion started about
this, Martin. Documenting object programs *is* difficult,
especially so because each method is its own separate
procedure or function with its own parameters, keywords,
etc. And then I know from long experience that just
because you document something doesn't mean anyone is
going to use it. You have to spell it out for them.
Give them easy-to-follow examples of what you mean by
the documentation.

That little DRAWCOLORS object I offered the other day
took me an hour to write and 3 days to document, what
with code comments and official documentation! Even
with a hugely sympathetic boss (I.e., me), that is
hard to justify. :-(

When you are writing widget objects you have a further
complication in that some methods are really event
handlers--not really public methods. Obviously
these don't need to be documented the way
direct interaction methods need to be. But should
they be in a separate file? And what about other
programs that are called from within objects
(e.g., XCOLORS)? Sigh...

I'm going to have another look at the new projects
capability in IDL 5.3. Maybe that is one way to
keep all of this stuff straight.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Object style guide [message #17736 is a reply to message #17731] Fri, 12 November 1999 00:00 Go to previous message
Karri Kaksonen is currently offline  Karri Kaksonen
Messages: 27
Registered: October 1999
Junior Member
Nice idea. While you are making the template you could also
catch the errors in the init-block:

function init...
CATCH, Error_Status
;Error_Status = 0
if (Error_Status ne 0) then begin
;if (obj_valid(self.complexPlotFont)) then $
; obj_destroy, self.complexPlotFont
return, 0
endif

;if (self->IDLgrModel::init(_REF_EXTRA=extra) ne 1) then return, 0
...
end

If you are creating objects for a display then you usually
encapsulate everything in a model:

pro %NAME%__define
%NAME% = {%NAME%, $
;INHERITS IDLgrModel, $
...
end

--
Karri Kaksonen
Picker Nordstar
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Conversions among datums and geographic coordinates
Next Topic: Re: TRIANGULATE says "Points are co-linear, no solution"

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:56:35 PDT 2025

Total time taken to generate the page: 0.00526 seconds