Simple approach to call private methods in modules

Share your advanced PureBasic knowledge/code with the community.
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Re: Simple approach to call private methods in modules

Post by NoahPhense »

davido wrote:Hi NoahPhense,

Please take a look at this post by TI-994A:

http://www.purebasic.fr/english/viewtop ... 43#p418143

I didn't know anything about Modules. I found this very helpful. :D
I hope you do, too.
Thanks David, helps a lot.

- np
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Re: Simple approach to call private methods in modules

Post by USCode »

fsw wrote:Just be open minded.
But not too open minded, otherwise your brain could fall out. :wink:
That's what I'm afraid of! ;-)
I'll take a look at it when the final version is released.
Initially it sounded like namespaces to me but I think other folks have pointed out that is not correct.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Simple approach to call private methods in modules

Post by c4s »

fsw wrote:
c4s wrote:
BorisTheOld wrote:[...] Over time, classes become dependent on the inner workings of other classes. [...]
If a programmer knows how to code properly, sticks to general coding standards and complies with the documented behavior (most important!), this would never happen.
Never say never.
Otherwise people reading this will think you are too far removed from reality.
It's funny because I knew that the "never" would cause some discussion. :wink:

Still, let's say you're working in a team. Now the only thing you know about a class is its signature and the documentation, because you didn't implement it yourself (and you don't have access to the source). If you want to interact with that class you can only rely on the documented behavior. So I really don't see how one could get dependent on the inner workings...
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Re: Simple approach to call private methods in modules

Post by fsw »

Just saying: experience taught me otherwise.
If your experience differs - be happy!

:mrgreen:

I am to provide the public with beneficial shocks.
Alfred Hitshock
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Simple approach to call private methods in modules

Post by Fred »

USCode wrote:
fsw wrote:Just be open minded.
But not too open minded, otherwise your brain could fall out. :wink:
That's what I'm afraid of! ;-)
I'll take a look at it when the final version is released.
Initially it sounded like namespaces to me but I think other folks have pointed out that is not correct.
It's like namespace.
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Re: Simple approach to call private methods in modules

Post by USCode »

Fred wrote:
USCode wrote:
fsw wrote:Just be open minded.
But not too open minded, otherwise your brain could fall out. :wink:
That's what I'm afraid of! ;-)
I'll take a look at it when the final version is released.
Initially it sounded like namespaces to me but I think other folks have pointed out that is not correct.
It's like namespace.
Excellent, good work Fred! :mrgreen:
BorisTheOld
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Apr 24, 2012 5:08 pm
Location: Ontario, Canada

Re: Simple approach to call private methods in modules

Post by BorisTheOld »

c4s wrote:Still, let's say you're working in a team. Now the only thing you know about a class is its signature and the documentation, because you didn't implement it yourself (and you don't have access to the source). If you want to interact with that class you can only rely on the documented behavior. So I really don't see how one could get dependent on the inner workings...
The problem is not with the use of a class, but with the maintenance of class code in complex systems with hundreds, or thousands, of interrelated classes and multiple levels of inheritance.

Over the years, classes evolve to meet the demands of new applications. As a result, inherited methods often need to handle conflicting situations. This is where the problems begin. Eventually, as more and more classes evolve in this way, the whole system begins to collapse -- maintenance and bug fixing becomes a major problem.

In theory this should never happen, but the universe tends to be a fickle place in which to strive for perfection.
For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
Post Reply