in reply to I hate the leading underscores.
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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: I hate the leading underscores.
by Jenda (Abbot) on Feb 16, 2005 at 13:30 UTC | |
by blazar (Canon) on Feb 16, 2005 at 14:20 UTC |