ruby picture

RCR 240: avoid asymmetry of extend_object/append_features

Submitted by neoneye (Sat Apr 10 12:04:35 UTC 2004)

Abstract

There is a saying: avoid asymmetry

we have

extended       <->   included
extend_object  <->   "append_features"

symmetry would be nice in ruby2

Problem

I bet the asymmetry confuses more than it helps. Besides that super must be invoked.

See [>ruby-talk:95507].

Proposal

Either name them something symmetrically or remove them completely.

Analysis

don't know what to write here.

Implementation

don't know what to write here.
ruby picture
Comments Current voting

See the rest of the thread on ruby-talk; it's already gone past this point. Matz indicated he would rather remove extend_object and append_features. I made the point that "extended" and "included" is itself a false symmetry, because the object gets extended while the module gets included. So to have them both be used as verbs from the module perspective is wrong. The symmetrical version would be something like "included" and "extending".

(Matz hasn't responded to my point yet :-)

Keep in mind that symmetry can be conceptual; it doesn't have to mean that the words look the same. Also, it's not a law; it's just one of many design principles.

-- David Black


David, that a good observation. I would vote yes to "extending". Unfortunatly you posts doesn't show up in my newsreader, so I havn't seen this post until now. If Im not able to see your posts, then perhaps matz isn't able to see them either? That could be the reason that there is no replies?

Its a shame good messages gets lost this way.

-- Simon Strandgaard


Strongly opposed 0
Opposed 1
Neutral 0
In favor 1
Strongly advocate 0
ruby picture
If you have registered at RCRchive, you may now sign in below. If you have not registered, you may sign up for a username and password. Registering enables you to submit new RCRs, and vote and leave comments on existing RCRs.
Your username:
Your password:

ruby picture

Powered by .