Some Nameless One wrote:actual filehandles should be kept transparent to the programmer — sometimes a fixed number of filehandles needs to be extended to an arbitrary number
One can also say:
actual subroutines should be kept transparent to the programmer — sometimes a fixed number of subroutines needs to be extended to an arbitrary number
As you see, precisely the same statement can be said in equal measure of subroutine names. So how come we don’t see the PC-police railing against bareword subroutine names the same way they do against bareword filehandle names? Both are global, unsigilled names in a particular package. (You can add to bareword format names to that same list, too.)
Please explain this discrepancy: why complain of one and not the other?
⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮
If Perl meant for you to never use bareword filehandles, it would deprecate them. Since it has not done so apart from those in all lowercase, they are not deprecated, and any attempt to impose any sort of One True Way™ viewpoint against something which is not deprecated by Perl is by its very nature fundamentally anti-Perlish. And that’s not good.
You may extirpate bareword handles, and for that matter dative syntax also, just as soon as you ban all such statements as: print FH; # send $_ to FH
print STDERR "See ya!\n";
Until such time as that should occur, kneejerk responses not to use legal and working Perl, delivered as they virtually always are without amplification and elaboration nor even explanation, seem very much out of step with the fundamentallly liberal, or at least multi-cultural, tone of basic Perl culture. As someone who has watched that multicultural environment — that is, the founding and abiding principle of There Being More Than One Way To Do It — grow and flourish since Day 1 of Perl 1.0’s initial public release more than 23 years ago, I believe I have enough historical perspective to make the observation that Perl is not about telling people what to do or how they should do it. For that, there’s always Python. 😱 | [reply] [d/l] [select] |
| [reply] |
| [reply] |
- arbitrary subroutine sets come into play at so high a level of abstraction that only very specific situations can imagineably need them. Multiple filehandles are an everyday occurrence. Unless you're the kind of programmer that still uses global variables for everything, it is necessary to lexically rather than bareword declare filehandles to manage their scope.
- the bareword is just a syntax. There might be rare occasions where specifying a filehandle as a bareword is needed. What is possible with a language does not mean that anything allowed is good practice. For example, proper indentation is good practice. Python enforces it Perl doesn't - this is a feature of Perl, not a licence to write unreadable code.
- Only the writer knows if his jerking of a the knee is a kneejerk reaction or a carefully considered jerking of the knee. You don't have a clue.
- Just because there is more than one way to do something doesn't mean all ways have equal merit all the time.
- You have a lot to learn!
| [reply] |
| [reply] |