Does anyone else hate the way method names with leading underscores look?Personally I don't, but then again it's just a matter of personal preference. Just the other day I wrote some code that used a dispatch table and since the involved subs were not really trivial nor "minimal" I wrote them separately as named subs and put in the table references to them. Even if they were not methods of a class, since they were coneceptually somewhat "private" to the table, I used names with leading underscores for them. I find it quite natural...
UPDATE: In an even different situation in which I want a "private portion of a namespace" since I'm only using it as an "anonymous tool" I still use those leading underscores, e.g.:
sub is { return bless \shift, '_hidden'; } sub _hidden::in { my $s=${shift,}; $s eq $_ and return 1 for @_; 0; }
In reply to Re: I hate the leading underscores.
by blazar
in thread I hate the leading underscores.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |