develooper Front page | perl.perl5.porters | Postings from September 2021

proposal: deprecate exists on array elements

Thread Next
Ricardo Signes
September 3, 2021 16:51
proposal: deprecate exists on array elements
Message ID:

Every once in a while, somebody suggests that "exists $arr[3]" can be useful.  This is almost never true, and most often based on a misapprehension of what it means.  (No, it's not a sparse array.  No, it's not a useful test of array length.)

I think it's time to deprecate this behavior so it can be fatalized, as "defined @array" finally was.  The reasoning here is "this feature is not useful, and is providing a leak into our abstraction.  It confuses experts and new users alike, and is unlikely to be performing important work in real code."

This is a "What objections, if any, still stand in the way of doing this?" email.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About