in reply to Re: 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

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Re^2: What esteemed monks think about changes necessary/desirable in Perl 7 outside of OO staff

Replies are listed 'Best First'.
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

    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

      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.