5 ms·
IIRC, early Perl was missing little things like named function arguments. So a lot of perl code was really inscrutable. I think “scrutability” is a huge driver
by doctor_eval 3y ago
IIRC, early Perl was missing little things like named function arguments. So a lot of perl code was really inscrutable. I think “scrutability” is a huge driver of adoption… it’s why HTML and JavaScript became popular - and I reckon it’s why Perl burned out. It’s certainly the reason I never adopted it.
Well, that and CPAN…
- housecarpenter 3y ago> early Perl was missing little things like named function arguments It's still missing those :) (To be clear for people unfamiliar with Perl, it probably will never have them, because it doesn't need them. In Perl, all functions effectively have a single parameter of array type. The standard convention is to assign each array entry to a variable at the start of your function definition, and the names of those variables then effectively act as parameter names. But that's just a convention and you can do something else if you want.)
- cygx 3y agoNowadays, sub signatures can be enabled via use feature 'signatures' which is implied by use v5.36
- elcaro 3y agoI know cygx already replied, but to be clear, function signatures have been available in Perl since 2015. They were added (as experimental) in 5.20, and are now enabled by default with `use v5.36` or later. All new features must now go through an experimental phase after the smartmatch debacle. Signatures stayed in experimental status a little longer than most new features due to an unfortunate change with respect the order of function signatures and function prototypes. Provided you weren't using prototypes (which you almost never need) then they've been largely stable since 2015. Most distro's under current support ship with at least Perl 5.24, so you can use them almost anywhere.
- cutler 3y ago"Unrolling @_" is still a Perl ritual.
- wlonkly 3y ago<ok, let's see..> @_ @_____ @________ <wow, this thing is long> _____________ <success!>
- knightcrusader 3y agoI wouldn't say its "missing" named function arguments. Treating arguments and return values as lists is very powerful. Perl is very Lisp-like in that aspect. Also, CPAN is considered one of Perl's strengths. How did CPAN cause Perl to burn out?
- doctor_eval 3y agoIn terms of arguments, there's no reason that Perl couldn't have had named arguments and still passed lists around behind the scenes. But the lack of arguments really makes it hard to understand what those arguments are supposed to be. The question is why Perl didn't continue to dominate the scripting landscape and I simply offer this as one possibility. My recollection of CPAN - and we are talking a really long time ago now - but it was just very much the same kind of dependency hell that we now have with NPM. In fact now that I mention it, I think there are strong comparisons to be made between Node and Perl. CPAN was great until it wasn't, and after a while - in my experience - it was mostly not great.