Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Are sub/method synonyms acceptable coding practice?

by dragonchild (Archbishop)
on Nov 19, 2005 at 16:16 UTC ( [id://510112]=note: print w/replies, xml ) Need Help??


in reply to Are sub/method synonyms acceptable coding practice?

I often offer aliases, especially where it may make code easier to read. For example, in Tree, there's an add_child(). I haven't done it yet, but add_children() could very easily be a synonym for add_child() because add_child() takes any number of children as arguments. Same with remove_child (remove_children), has_child (has_children), and find_index_for (find_indices_for).

One of the weaker criticisms of Ruby is that it offers too many aliases, making it harder to read someone else's code. I actually find that there aren't enough aliases, but that's just me.


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
  • Comment on Re: Are sub/method synonyms acceptable coding practice?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://510112]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-26 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found