The liberty to not name things that are obvious.
and that’s yet another way to end up with hard to read code.
Variables hold values that have meaning. Learn how to name things and you’ll write good code.
This makes me want to write a function for you to add to numbers where the variables are leftumber and rightnumber, instead of x and y.
if “left” and “right” were relevant for addition, they would indeed be better names
Is it just me or does it feel kinda unclean for it to just support 1 through 9?
tbf positional arguments are already bad enough. Now if you’re using over 9 positional args… just take a break, go for a short walk, and maybe you’ll come back with a better plan
I mean 4 is probably too many, 8 definitely is, but also what about splat-args like zip or min. Why not stop at 4? Why not stop at 8 since its a power of two? Any hand-picked limit just feels pretty bleh to me. Either support everything or dont support it at all IMO
OMG looks like Raku
I do think the unnumbered variant of such anonymous parameters is useful, if you’ve got a team of devs that knows not to misuse them.
In particular, folks who are unexperienced will gladly make massive multi-line transformations, all in one step, and then continue blathering on about it
or similar, as if everyone knew what they were talking about and there was no potential for ambiguity.
This is also particularly annoying, because you rarely read code top-to-bottom. Ideally, you should be able to jump into the middle of any code and start reading, without having to figure out what the regional abbreviations or it
mean.
Is ruby the new Perl?
That deserves an “always has been” meme… But IMO, Ruby outperled Perl since the beginning.
Perl doesn’t let you redefine the syntax so that you can write the same program multiple ways. All it does is to encourage multiple programs to have the same meaning.
I never looked at Ruby, but that doesn’t seem like it would be great for readability (although maybe productivity).