[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

When should objects be used?



Nearly all of my IDL programs started as interactive bits of code, saved
in
a journal file and then expanded into programs. The main power of IDL
for me is to be able to tinker with the code quite easily, try different
things out, and then finalize the code in the fashion that works best.
Most of these programs are the old-fashioned kind where you specify the
conditions at the start (the data to be
analyzed, the conditions of the analysis, the form of the result) and
then crank
through the processing in a fairly linear fashion, without a lot of
interaction along the way. In fact, when I produce PostScript files for
publications, I generally do
it by having a specific parameter file to go with each figure, such that
I can
reliably reproduce the figure exactly by running the code again. I had
found that
previously, I had often produced figures from highly interactive
programs but
had a hard time figuring out just exactly what was done to produce them.
	All of this is by way of saying that this sort of programming seems to
be the opposite of object oriented code or widget programming, which
often seems to involve
lots of interactive choices along the way. Thus, I have never taken the
plunge to
learn object oriented programming, but I have a feeling that I am
missing the parade
and I'd like to know what I am missing.
	Could some of you who might have started out doing things the way I do,
and
who have converted to object-oriented programming, tell me if there is
something to be gained by my revising my programming style to use
objects? I have developed a nice
library of IDL procedures and functions to do my kind of processing, but
I have not
done the same with widgets, and I have never tried doing it with
objects. 
	To provide a specific example, I have written some IDL code to
determine
the exact locations of small Saturnian satellites in Hubble Space
Telescope images,
to fit orbits to these positions, and to produce TeX tables of the final
fitted
results. Do you see obvious advantages to trying to do some of this
using objects?
	Thanks for any insight you can provide. My problem is that so much of
the discussion of objects seems abstract that I have a hard time
figuring out how to
translate it to the problems I am trying to solve.

Dick French, 
Astronomy Dept.
Wellesley College