> These are just the ones I remember/found. I'm sure there are many
> more examples in this class and others. Doesn't having multiple names
> for the same thing make it confusing when collaborating ? Is there
> any reason for this ? What is your take on the matter ?
Of course there is a reason for it. It is called aliases.
You can use aliases in bash. I currently have almost 16.000 aliases.
Ruby is not a dictator enforcing a specific style per se. And I make
heavy use of aliases in Ruby code I write. Being able to use aliases
allows you to use several ways to call the same method too.
It helps when creating different DSLs too.
The language C uses aliases too. They are called "pointers" and
you can point to a pointer, to a function, or have functions call
or return pointers.
Aliases are everywhere.
Even if natural languages, you use aliases. It can be confusing
too. In german, if you say "Bank", you either mean a bank where
you can put money into on an account, or you mean a bank which is
similar to a bench, where you can sit down. The context determines
which one is valid.
Would the world be better without aliases? Perhaps. But the
complexity still exists, as you need to use a new word. Natural
languages become more and more complicated, simply because there
are new words and new concepts needing new words.
As for collaborating with other people's code, that is true, but
you can not blame aliases for that alone. They are very low on
my list.
What is higher on the list is the programming style of someone
else. Especially when a lot of eval* are used and a lot of
Proc.new - this all confuses me to no ends.
I sometimes wonder how a minimalistic ruby would look like (minimalistic
in syntax. If I'd ever make a programming language, I would make the
stdlib HUGE. When like 5 people need to use something, and code
something
on their own which has 95% overlapping functionality, I'd automatically
throw it into stdlib. Come to think about it, a programming language
designed and shared completely on git + github would be awesome. Sadly,
my C will forever more suck, so there is no point for me to try and
create my own language, even though I have some ideas that are not
existing in all the languages I know of.)
--
Posted via http://www.ruby-forum.com/.