Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff

by GrandFather (Saint)
on Sep 10, 2020 at 22:26 UTC ( [id://11121587]=note: print w/replies, xml ) Need Help??


in reply to Re^2: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
in thread What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff

Strokes for folks. I use regexen vastly more often than substr and I almost never use index. Maybe you grew up with some other language (Visual Basic maybe?) and haven't actually learned to use Perl in an idiomatic way? Perl encourages a plethora of paradigms for solving problems. The flip side is Perl doesn't do much to discourage hauling less appropriate "comfort coding practices" from other languages. That is no reason to assume that all Perl users abuse Perl in the same way you do, or have as much trouble typing statement terminators

Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
  • Comment on Re^3: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff

Replies are listed 'Best First'.
Re^4: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff
by Fletch (Bishop) on Sep 11, 2020 at 15:36 UTC

    Out of curiosity and in the interest of moving this slightly away from "anecdote" towards "data", I did a quick grobbling over a 22-ish year old codebase and out of the 1.8M lines I found only about 1.55k instances of /\bsubstr\b/ using ripgrep -c (caveat though that line count is a raw wc -l not SLOC).

    Of those matches about 900 were in two files of generated code (made by Parse::RecDescent), and a good chunk (~150 matches) of the others were false hits (e.g. the "substr" it found were actually in embedded SQL code in heredocs and not live perl code). Similar small amounts for "index" but that's even worse for this simple checking because "index" seems to be popularly used as part of a method name (i.e. I looked for /\bindex\(/ there to try and get a closer count but my gut feel (at the risk of re-approaching anecdote :) is the few hundred matches I found still are overcounting).

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

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

    No recent polls found