Re: Style guide for IDL? [message #31770 is a reply to message #31769] |
Tue, 20 August 2002 12:53   |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
JD Smith wrote:
>
> As one who is equally offended by the LOUD, PACKED WITH EXTRA
> UPPERCASE CHARACTERS, AND TANTAMOUNT TO SHOUTING AT THE READER style
> certain purveyors of the so-called truth are peddling, allow me to
> present as postscript two exhibits for your consideration. For the
> record, my ANSI-like preferences are automatically enabled using the
> following settings with IDLWAVE:
>
> idlwave-block-indent 3 ; Proper Indentation settings
> ;; Any self-respecting programmer indents his main block
> idlwave-main-block-indent 2
> idlwave-end-offset -3
> idlwave-continuation-indent 3
> idlwave-reserved-word-upcase nil ; Don't UPPERCASE reserved words
> font-lock-maximum-decoration 3
>
> Keywords, strings and other syntax elements should be set apart from
> the main body of text with color, not with LOUD UPPERCASE EMPHASIS
> WHICH REMINDS ME OF THE KIND OF EMAILS MY GRANDDAD USED TO SEND BEFORE
> HE REALIZED HOW RUDE IT IS. For full effect, load these texts into a
> colorizing editor like Emacs/IDLWAVE or the IDLDE.
>
> JD
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++
> FUNCTION FSC_PLOTWINDOW::InTarget, x, y, DIRECTION=direction
>
> ; Given a location of the cursor in the window returns the
> ; target location and the direction the window should be
> ; resized in. Have to be within 10% of window edge to be
> ; in moveable target.
> IF xtest EQ 1 AND ytest EQ 1 THEN BEGIN
> retVal = 'MOVE'
> direction = 'MOVE'
> ENDIF
................
[snip]
> vs.
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++
> function FSC_PlotWindow::InTarget, x, y, DIRECTION=direction
> ;; Given a location of the cursor in the window returns the
> ;; target location and the direction the window should be
> ;; resized in. Have to be within 10% of window edge to be
> ;; in moveable target.
> if xtest EQ 1 AND ytest EQ 1 then begin
> retVal='MOVE'
> direction='MOVE'
> endif
...............
[snip]
I prefer the first version above, except it should use
alphaImage = OBJ_NEW('IDLgrImage', alpha_image, $
DIMENSIONS=[400,400], $
INTERLEAVE=0, $
BLEND_FUNC=[3,4])
:o)
paulv
--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC Beer is good.
Ph: (301)763-8000 x7274 My wife.
Fax:(301)763-8545
|
|
|