Inheritance structure less important in dynamic languages?

M

Marvin

Hi,

It's been claimed that inheritance structures are less important in dynamic
languages like Python. Why is that and where can i read more about that?

/Marv
 
D

Dennis Lee Bieber

Hi,

It's been claimed that inheritance structures are less important in dynamic
languages like Python. Why is that and where can i read more about that?
And where did you see that claim? I'd suggest interrogating that
source for whatever studies it cites. Maybe Google can find some
reports?

http://portal.acm.org/citation.cfm?id=643354&dl=ACM&coll=GUIDE
http://www.jayeckles.com/research/java.pc
http://blogs.tedneward.com/2005/10/...ge+Wave+But+Leave+The+Poor+Vendors+Alone.aspx
http://en.wikipedia.org/wiki/Object-oriented_programming
--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 
B

Ben Finney

Marvin said:
It's been claimed that inheritance structures are less important in
dynamic languages like Python.

Who claimed that? I ask not because I doubt your assertion ("it was
claimed"), but rather that if someone claimed something, it seems
better to ask that person your next question:
Why is that and where can i read more about that?

The person who claimed it is more likely to be able and willing to
defend it.
 
B

bruno at modulix

Marvin said:
Hi,

It's been claimed

s/claimed/observed/

In Python and Ruby, class hierarchies tends to be *really* flat when
compared to Java or C++.
that inheritance structures are less important in dynamic
languages like Python. Why is that

Don't you guess ?-)

A very obvious point is that in a dynamically typed language,
inheritence is only about implementation - it's not used for class-based
polymorphism (subtyping).

Also, dynamic languages are usually very strong on introspection and
offer good support for automatic delegation ("DoesNotUnderstand" in
Smalltalk, __getattr__ in Python, etc), which tend to lower the use of
inheritence for "private inheritence" (ie: implementation reuse without
any subtyping semantic).

This leaves with only three real use-case for inheritence :
* factoring common features of a set of related classes in an abstract
base class
* specialisation of an existing class (proper subclassing),
* mixins.
and where can i read more about that?

"duck typing", "implied interface" and "composition/delegation" could be
good starting points for a google search.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top