"Duck Typing" or "No need for abstract classes"

M

Mathieu Bouchard

Ruby allows you to play in the swamp, but it doesn't mean it's better to
play in the swamp: rather see it as an opportunity to build your own raft,
hopefully better than the one-size-fits-all raft provided with your
standard static-language.
[...]
My recent thought was that this should emerge as the result of good
programming practice. If you have complexity that requires a protocol,
then there is probably a module that already emerged and fills the
need- e.g. Enumerable, Comparable, IO, etc.

There are indeed protocols that emerge rather often when you program, but
there are also many protocols that you have to cook up yourself... and
possibly make modules for.
I'm now thinking that explicitly thinking about protocols and
implementing them in a top-down manner is often not so necessary for
this reason. [...]
Finally, this implies a bottom-up style of programming, and that is
something of a personal style. So explicity protocols may help people
decompose and think about there program while writing it.

I don't get the top-down style and bottom-up style anymore. I don't know
why there should be an opposition between two so-called approaches, when
clearly to me, they are complementary processes. Both should be used all
of the time; that's how you build a healthy network of relationships in
your programs.

Maybe we really don't think of the same top-down (breaking down problems)
and same bottom-up (merging up solutions). To me, any of the two can lead
to any structure of code. Bottom-up can grow methods, protocols, classes,
whatever, as they are just tools to fulfill the goal of bottom-up, which
is to merge.
Of course, this implies well written programs, which is not the norm
in the world. Which again makes me think of the possible distinction
between pack-programming languages and hacker languages.

You've been reading Reciprocality Theory or what ??
And like extreme programming, most early large Ruby programs will be
probably be done by smaller groups of the leading lights of the Ruby
community. That might not generalize well to the world-at-large.

I'm not discussing those things for the world-at-large. Who knows how the
world-at-large works anyway?

_____________________________________________________________________
Mathieu Bouchard -=- Montréal QC Canada -=- http://artengine.ca/matju
 
D

Dave Burt

Class.type is deprecated in favour of Class.class
Right. Typo on my part. But why is it deprecated?

Object#type (which I'm sure is what you meant) is deprecated in favour of
synonym #class because it doesn't return the object's type, it only returns
its class.

Cheers,
Dave
 

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,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top