Re: SOLVED. Re: Function referencing/automatic defintion question. [message #35318] |
Fri, 30 May 2003 12:38 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul van Delst (paul.vandelst@noaa.gov) writes:
> Huh? Either they're related or they're not. Why should whether you write the code
> procedurally (is that a word?) or OO-ly make any difference? Apart from increasing the
> calling overhead in the case of the OO way (in the manner that I like to use "objects").
I'm going to let the manner in which you like to use objects
pass. Let's just say I've been making notes for my book,
but I promise not to include real names. :-)
But let me just quote the Coyote Rule for Grouping
Program Modules:
"Think of file groupings as *commands*. All the
program modules that make up a single IDL command
go in a single file, with the last module in the
file having the "name" of the command. If you
plan to call any other module in the file anywhere
outside the confines of the program modules already
in the file, then that program module should be yanked
out of that file by the short hairs and placed in its
own file and named accordingly. To do otherwise is to
risk complications when you can least afford them.
Namely all manner of hell is likely to break loose."
Cheers,
David
P.S. I hope we don't even get into the Object Confessional
mode around here. I would be embarrassed to admit to some
of the strange things I thought about objects when I first
started using them. Talk about some truly ugly programs...
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: SOLVED. Re: Function referencing/automatic defintion question. [message #35370 is a reply to message #35318] |
Fri, 30 May 2003 12:11  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
David Fanning wrote:
>
> Paul van Delst (paul.vandelst@noaa.gov) writes:
>
>> If a data structure allocation routine shouldn't be associated with its definition in the
>> same file then the apocalypse is truly upon us. :o)
>>
>> Given that using () to index arrays is not going away, then I think that COMPILE_OPT
>> STRICTARR is the more elegant solution compared to separate source files. You're more
>> tuned into the human psyche than me, but aren't people the sort of wee beastie that like
>> to collect things into neat little piles.... :o)
>
> I'm not arguing they aren't related. I'm arguing they
> aren't related *enough*. Make those babies object methods
> and THEN you will clearly be doing the right thing.
Huh? Either they're related or they're not. Why should whether you write the code
procedurally (is that a word?) or OO-ly make any difference? Apart from increasing the
calling overhead in the case of the OO way (in the manner that I like to use "objects").
>> Hang on a minute....it's only lunch-time in the mountains. Sheesh!
>
> But school is out today, and it feels like a holiday! :-)
Can't argue with that. Today is the first day of sunshine here in DC for, oh, about a
month. Woohoo!
--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Ph: (301)763-8000 x7748
Fax:(301)763-8545
|
|
|
Re: SOLVED. Re: Function referencing/automatic defintion question. [message #35371 is a reply to message #35370] |
Fri, 30 May 2003 11:49  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul van Delst (paul.vandelst@noaa.gov) writes:
> If a data structure allocation routine shouldn't be associated with its definition in the
> same file then the apocalypse is truly upon us. :o)
>
> Given that using () to index arrays is not going away, then I think that COMPILE_OPT
> STRICTARR is the more elegant solution compared to separate source files. You're more
> tuned into the human psyche than me, but aren't people the sort of wee beastie that like
> to collect things into neat little piles.... :o)
I'm not arguing they aren't related. I'm arguing they
aren't related *enough*. Make those babies object methods
and THEN you will clearly be doing the right thing. It's
the difference between kissing cousins and ... well, maybe
I've already had too much to drink.
> Hang on a minute....it's only lunch-time in the mountains. Sheesh!
But school is out today, and it feels like a holiday! :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: SOLVED. Re: Function referencing/automatic defintion question. [message #35372 is a reply to message #35371] |
Fri, 30 May 2003 11:38  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
David Fanning wrote:
>
> Paul van Delst (paul.vandelst@noaa.gov) writes:
>
>> All this may be clear as crystal to you IDL gurus out there, but it sure wasn't to me.
>> Robert's email was the first eureka event identifying the difference between compile and
>> run time in IDL. And a patient phone call from another smart feller was the clincher.
>
> Ah, now I see why my first suggestion to take the damn
> function out of the file it has no business being in
> would also work. :-)
If a data structure allocation routine shouldn't be associated with its definition in the
same file then the apocalypse is truly upon us. :o)
Given that using () to index arrays is not going away, then I think that COMPILE_OPT
STRICTARR is the more elegant solution compared to separate source files. You're more
tuned into the human psyche than me, but aren't people the sort of wee beastie that like
to collect things into neat little piles.... :o)
>
>> Everybody have a couple beers after work today. Tell 'em Paul says it's o.k. :o)
>
> I'll do that. In fact, I'm gonna start now. It's a short
> week anyway. :-)
Hang on a minute....it's only lunch-time in the mountains. Sheesh!
paulv
--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Ph: (301)763-8000 x7748
Fax:(301)763-8545
|
|
|
Re: SOLVED. Re: Function referencing/automatic defintion question. [message #35373 is a reply to message #35372] |
Fri, 30 May 2003 11:20  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul van Delst (paul.vandelst@noaa.gov) writes:
> All this may be clear as crystal to you IDL gurus out there, but it sure wasn't to me.
> Robert's email was the first eureka event identifying the difference between compile and
> run time in IDL. And a patient phone call from another smart feller was the clincher.
Ah, now I see why my first suggestion to take the damn
function out of the file it has no business being in
would also work. :-)
> Everybody have a couple beers after work today. Tell 'em Paul says it's o.k. :o)
I'll do that. In fact, I'm gonna start now. It's a short
week anyway. :-)
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|