Re: Procedure's and include items

new topic     » goto parent     » topic index » view thread      » older message » newer message

At 12:02 PM 5/4/98 -0600, you wrote:
>---------------------- Information from the mail header -----------------------
>Sender:       Euphoria Programming for MS-DOS <EUPHORIA at
>MIAMIU.ACS.MUOHIO.EDU>
>Poster:       David Mosley <mosley01 at GEOCITIES.COM>
>Subject:      Procedure's and include items
>-------------------------------------------------------------------------------
>
>Hi
>Just had to ask a ? about procedure's and include files.How do you decide
>what would be a good procedure ? in basic I would do that if I was going to
>use that gosub alot is that the way in euphoria too.

These work for me:

Anytime you do some task more than once, it becomes a
candidate for a procedure (or function, if it must return a
value).

Anytime your code becomes too long to comprehend in one
look, it's time to take logical chunks of the code and make
them procs/funcs, with names that describe their action.

Anytime your main program becomes too long to understand
in one look (for me, that's about 1 printed page), it's time
to move some or all procs/functs to one or more include
files.

>What do you use a include file for?
>My guess would be to use an include file for a procedure that you plan to
>use alot.

Yes, if you think you might be using the same stuff in another
program sometime, it's nice to have it available by include-ing,
instead of having to copy it into your new program.
Also it is good practice to have only one copy of a routine,
so any changes or bug-fixes only have to be made in one
place! For long programs, it helps to separate your graphics related
routines in one include, your file handling in another, etc.
so you know where to look for a problem.

Irv

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu