IMPORT IO, FROM IO IMPORT ? 
Author Message
 IMPORT IO, FROM IO IMPORT ?

Quote:
>    Of course I mean on a large scale program....which is faster
> in compiling......is there a major difference between these 2
> methods???

Depends on the compiler so who knows. Forget it.

What you should be asking is when and why should you use each form of import.

Some is style, some is clarity, some is practicality, some is necessary.

Personally I tend to favour using imports qualified.

  TC.



Thu, 12 Dec 1996 03:02:20 GMT  
 IMPORT IO, FROM IO IMPORT ?


Quote:
>   1. IMPORT IO;
>   2. FROM IO IMPORT StringOut;

There is no difference in the compiled program and no significant difference
in the compilation speed.  It is purely a matter of programming style, plus it
gets around the problem with two modules exporting the same name.  In Topspeed
M-2, the file-IO and String library modules both export a "Delete", so you
have to import at least one of those modules using (1) above if you want to
use both functions.  Otherwise, (1) is a bit more informative and generally
recommended by the textbook writers, but it often involves a lot more typing
and can result in long statements which are hard to read if there are a lot of
library calls in them.  I generally prefer (2) myself, even though you have to
keep running back up to your IMPORT statements to add new entries as you find
that you need them.

Mike

____________________________________________________________________________
Michael H. Hughes                       Keyosk Corporation




Mon, 16 Dec 1996 06:17:27 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. IMPORT IO, FROM IO IMPORT ?

2. IMPORT IO, FROM IO IMPORT ?

3. import Image vs from PIL import Image vs import PIL.Image

4. mixing IO#read and IO#syswrite

5. Perl IO to Ruby IO help needed

6. BUG?: HP-UX 10.20 and IO#gets followed by IO#puts

7. BUG? IO.seek conflicts with IO.sysread

8. VAX Ada sequential IO and Direct IO - (nf)

9. VAX Ada sequential IO and Direct IO

10. VAX Ada sequential IO and Direct IO

11. Not DOS interrupts, I want direct IO (memory mapped IO)

12. Import Data With File Import

 

 
Powered by phpBB® Forum Software