in reply to Built-in Function Homonyms for Method Names Bad, Too?

I don't think it's a bad practice. You should name your methods such that they make sense in light of the problem your trying to solve and how you will use your object regardless of whether or not those names happen to conincide with perl built-ins.

  • Comment on Re: Built-in Function Homonyms for Method Names Bad, Too?

Replies are listed 'Best First'.
Re^2: Built-in Function Homonyms for Method Names Bad, Too?
by jffry (Hermit) on Jan 25, 2006 at 23:11 UTC
    Well, there are plenty of decent synonyms I could use for method names instead. So that point is covered in my case.

    I guess the tough question is: if I keep using these homonym method names is there some Perl syntax parsing nightmare I'm going to hit at some point.

    OR

    If you (plural) can't cite specific examples of Perl parsing dangers, is the threat of such dangers enough for me to not use homonyms.

      I guess the tough question is: if I keep using these homonym method names is there some Perl syntax parsing nightmare I'm going to hit at some point.

      Short answer is, if you're always calling methods with ->, then there won't be a problem. Parsing problems only come about when your in a place where a built in can live, and after -> isn't one of those places.

      Personally I'm for using homonym method names when they make sense, since if they're used appropriately you already "know" what they do.