... or one could write the code in a language that actually supports private methods and memebers.
| [reply] |
I can't see how adding map to the mess would make it more readable.
It removes the need for (useless) temporary variables and automatically handles the case of empty lists without any special checking.
| [reply] |
And as far as '_' meaning private ... I guess that would be private by convention since Perl doesn't really have any private methods or members, but conventions are only good if to tell people about them and this particular convention isn't documented anywhere.
On the contrary, this widely used naming convention is documented in the core Perl docs, the Camel book, and in many other places:
- From Perl style: "You can use a leading underscore to indicate that a variable or function should not be used outside the package that defined it."
- From Perl Best Practices, Chapter 3 Naming Conventions: 3.10 "Prefix "for internal use only" subroutines with an underscore."
| [reply] |