Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Gaming > Development Programming Misc > Re: Advantages ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 11 of 14 Topic 954 of 1002
Post > Topic >>

Re: Advantages of OOP

by Anton <anton.txt@[EMAIL PROTECTED] > Oct 29, 2007 at 10:29 PM

Miss Elaine Eos:

> Is that the sort of thing you mean?

Not quite that, though thanks for this brief intro into OOP.

> * Inheritance allows one to design hierarchies of "things" (objects) 
> that share common functionality and to share the code that is common 
> among them.  The shared code allows bug fixes, enhancements, 
> modifications, debugging, etc., across an entire range of related
> things. 

Well, this is a very general principle of... how to call it?.. unicity: 
same actions should be expressed by the same code. A simpler example is 
declaring a constant instead of hard-coding some number in several places 
in the code. It's kinda forcing integrity, a guarantee you won't screw 
things up by changing this value...

I think, PP-programms should also be designed with this principle in mind.

Howeever, instead of object hierarchy, PP offers Unit/Procedure hierarchy 
-- a different means for the same thing. And now I am interested in which 
cases the OOP's approach to unicity exceeds that of PP. There should be 
cases when with OOP it's much easier to maintain unicity.

> Note that you can do OOP in PP, without any language helpfulness.

That's interesting! Is there a way to "emulate" simple incapsulation? If I

define a function and a data structure, and even put a pointer to the 
former into the latter, I will still have to pass the record to my 
function. Otherwise it'll not be able to access its objects's
properties... 
The call would look rather redundant: Obj.Function(Obj,<other
parameters>);

Plus OOP-like data hiding -- no idea how to implement it.

> You can also do PP in an OO language, ignoring the OO stuff.

Not in all languages, right?

> * Data hiding helps one avoid the pitfalls associated with changing a 
> value directly when said value change is linked to other values. 
> Again, this can be done in PP, but is prone to error, if someone
> forgets to change all the appropriate related info, setting a variable
> without using its "setter."

Well, PP has it's own Data Hiding. Units' INTERFACE and IMLEMENTATION 
sections, nested procedures and functions, restricted types, detailed 
control over ex****t (MODULA-like),... It's just different from OOP.

Thanks for giving me a couple of interesting thoughts!
 




 14 Posts in Topic:
Advantages of OOP
anton.txt@[EMAIL PROTECTE  2007-10-28 05:15:13 
Re: Advantages of OOP
Miss Elaine Eos <Misc@  2007-10-28 14:07:23 
Re: Advantages of OOP
Antonius <anton.txt@[E  2007-10-28 07:55:04 
Re: Advantages of OOP
Miss Elaine Eos <Misc@  2007-10-29 03:59:55 
Re: Advantages of OOP
"Serve Lau" <  2007-10-29 15:16:04 
Re: Advantages of OOP
Anton <anton.txt@[EMAI  2007-10-29 22:29:57 
Re: Advantages of OOP
"Serve Lau" <  2007-11-02 19:37:47 
Re: Advantages of OOP
"Serve Lau" <  2007-11-02 19:42:35 
Re: Advantages of OOP
Anton <anton.txt@[EMAI  2007-11-03 00:26:27 
Re: Advantages of OOP
"Serve Lau" <  2007-11-03 12:27:13 
Re: Advantages of OOP
Anton <anton.txt@[EMAI  2007-10-29 22:29:49 
Re: Advantages of OOP
Miss Elaine Eos <Misc@  2007-10-30 02:59:02 
Re: Advantages of OOP
<ear@[EMAIL PROTECTED]  2007-11-14 11:32:38 
Re: Advantages of OOP
Antonius <anton.txt@[E  2007-11-15 05:23:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 4:43:17 CDT 2008.