Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^5: On Backwards Compatibility and Bareword Filehandles

by haukex (Archbishop)
on Jul 18, 2020 at 18:11 UTC ( [id://11119502]=note: print w/replies, xml ) Need Help??


in reply to Re^4: On Backwards Compatibility and Bareword Filehandles
in thread On Backwards Compatibility and Bareword Filehandles

this monk has continually provided quality advice, and in a manner that exudes earnestness

I don't disagree entirely, but to me that only makes it more disappointing that recent threads went as they did; I saw several factual errors, strawmen, ignoring facts and arguments (all of which I called out at the time), and in the case of this thread, which is a continuation of the same topic (bareword filehandles), missing even the most basic testing, followed by what felt to me like a tactic to get me to waste my time. That interpretation is likely to be affected by my experience in the previous threads, but sometimes even normally reasonable and otherwise knowledgeable people can slip into "troll tactics", which is why I worded myself the way I did.

In terms of the original post of this thread, I have some sympathy. While I see potential pitfalls in the use of bareword filehandles, I don't regard that it is necessary to enforce defaults that forbid such usage.

Note the root node says (emphasis mine): "Rolling pragmas like use strict; into defaults is reasonable, as long no strict continues to exist. ... The proposal to remove [Indirect Object syntax and Bareword Filehandles]". To my knowledge at this point, there is no proposal to remove bareword filehandles, as you noted yourself. I'm currently only aware of one mention of making no bareword::filehandles a default, which I can't find in the current plans anymore either.

But anyway, Sawyer went through a fair bit of explanation in his talk of the reasoning behind changing the defaults. In addition to my getting the feeling several people participating in the Perl 7 discussions haven't watched the talk, I think people who are complaining about the (supposed) removal of features are missing some important points: 1. Perl 5 will continue to exist and get maintained for a fair amount of time (apparently at least 5 years). I completely understand people saying they wish to maintain their artistic freedom to code how they like - and if their medium of choice is Perl 5, it will always be there for them. 2. Changing defaults is much, much less radical than actually removing features - so in Perl 8, you may have to write use bareword::filehandles to enable a feature with many disadvantages. I don't believe that's bad enough to warrant a comparison to book burning. And even if Perl 9 or 10 were to actually remove them, point 1 still applies, plus someone (perhaps OP?) can probably write a CPAN module to put the feature back in. (In fact, Sawyer is working on a standard syntax for Perl that would actually allow for static parsing, allowing for actually safe source filtering; see also his talk.)

You said here:

Maybe I should just wait and see what happens ?

That's definitely my attitude at the moment. Perl giveth (powerful Unicode features, s///r, postderef, and lots more) and Perl taketh ($[, smartmatch probably), and we can pray that better things are to come (signatures, refaliasing), but in the end, it's the smart people who spend their time giving us stuff for free that make the decisions. There's already enough heated discussion going on, we don't need to burn them out further.

Replies are listed 'Best First'.
Re^6: On Backwards Compatibility and Bareword Filehandles
by jcb (Parson) on Jul 19, 2020 at 03:19 UTC
    sometimes even normally reasonable and otherwise knowledgeable people can slip into "troll tactics"

    "Slip" is very much a good way to describe it. I had thought of "why not give bareword filehandles lexical scope, too?" as a solution to the problems of file-scope lexicals being effectively global variables. I had a "lightbulb moment" and rushed to write it down in a somewhat coherent form. The root node of this discussion was the result.

    To my knowledge at this point, there is no proposal to remove bareword filehandles

    I will answer this by quoting more from Announcing Perl 7, the original announcement:

    What’s disappearing?

    [...] There are some things you should learn to live without, even in Perl 5 land. These are the likely candidates for the first round of changes:

    • indirect object notation
    • bareword filehandles (except maybe the standard filehandles)

    That announcement specifically mentioned removing indirect object notation and bareword filehandles. That detail seems to have been reconsidered after it proved extremely controversial.

    in Perl 8, you may have to write use bareword::filehandle­s to enable a feature with many disadvantages

    I propose that we take advantage of a major version bump to replace that feature with a mostly-compatible (what I expect is the most common case would continue to work) near-equivalent that brings the advantages of the new model to the old style.

    As far as the features you mention, $[ was recognized as a mistake and has been variously either a lexically-scoped compiler directive or read-only for almost the entirety, if not the entirety of Perl 5, and smartmatch, like pseudohashes, was never promoted from experimental status. Experimental features should not be carried across major versions — either they are good enough to become part of the core language at such a time or they should be dropped.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11119502]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-18 18:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found