Quantcast
Channel: Good notes posted to Ruby
Viewing all articles
Browse latest Browse all 26

Very bad documentation (Module#alias_method)

$
0
0

This is terrible documentation. It makes it very hard to understand what the arguments mean.

The signature is

alias_method(p1,p2)

So what do p1 and p2 mean? The description doesn’t refer to them at all, but to new_name and old_name. How are we supposed to know which is which?

And then it gets even worse in the code sample:

alias_method:orig_exit,:exit

From the naming it sounds like the first argument is the original method name.

Documentation is supposed to resolve this kind of confusion, not create it.


Viewing all articles
Browse latest Browse all 26

Latest Images

Trending Articles





Latest Images