Re: Do you currently use namespaces?

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

Jeremy Cowgar wrote:
>how does include make it not modular?
>I do not see how what you said is making Euphoria not modular?
>Can you expand a bit?

Absolutely,

Keep in mind that a programmer can write code in a modular language that
isn't modular and another could write good modules in a language that isn't
supportive of that.

Good modules should have certain features.  

Decoupling is an important principle as well as the principle of
information hiding.  They don't expose their internal structure but 
do expose an interface.

What happens when you include a file?  Everything becomes exposed!
This, needless to say, does not promote information hiding!

Let me give you a real example.  I make it a matter of pride that if you
get a function from me it is complete, works and you will have no problem
adding it to your code.  I was writing a utility and needed a function
that a guy I worked with had written.  He insisted I use his function.
Being my nominal boss at the time it was difficult to refuse.  Anyway, I
added his code to my tiny little utility and there was a problem.  It had
ties that were dependant on other parts of his project.  So I had to include
those (couldn't amputate because that was the nature of his code.)  This
continued until finally my tiny little utility was the size of his major
project.  At that point I got my boss involved and let him share some of
my frustration (I'm generous that way.)  In the end, I wrote what I needed
without the help of his function.  The guy was a really smart guy, but didn't
really understand the concept or why it was important.  I find that very
few programmers I've worked with really do.  This was not an isolated
incident.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu