Re: Do you currently use namespaces?

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

ken mortenson wrote:
> 
> Am I up to the challenge?  

If you write code like this you have problems:

FileA.e
global function do_a() ....
global function hello_a() ...


FileB.e
global function do_b() ...
global function hello_b() ...


FileC.e
do_a()
hello_b()


MyProg.ex
include FileA.e
include FileB.e
include FileC.e --- this has to be included last because it
------------------- it depends on FileA and FileB
-------------------
------------------- This is *horrible* coding.


In the above program, FileC.e should be rewritten as:

FileC.e
include FileA.e
include FileB.e

do_a()
hello_b()


MyProg.ex
include FileC.e
include FileA.e
include FileB.e

---- Notice... Order has zero affect on anything.
----
---- This is proper coding.


--
Jeremy Cowgar
http://jeremy.cowgar.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu