Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
IntrusionCM470548dFunny enough, it's one of the the things I really hate.
It's an ambiguation for the sake of simplification.
I'm not really fond of it in Python, too btw.
What happens can be seen in Python.
You have functions with too many parameters and as such are variadic...
And since they're variadic, you'll have a shitton of fun figuring out required vs non required arguments, typing errors (null? 0? empty string?) to set required arguments to a value and so on.
The trend to syntactic sugar is a thing that will lead to bad code TM...
And most of it is to save a few keystrokes.
The constructor syntax eg is imho a nightmare. It looks shit.
bagfox68348dThings have been said already and I love that JS doesn’t have it. Just use objects instead if it’s really needed.
myss450148dYep, same for me, I also hate it in python, good luck figuring out which args are required..
I don't have an issue with named arguments in itself, but the inevitable consequence is people feel entirely justified in writing functions with 10+ arguments because "hey, they're all named so it's clear, right?!"
The last thing the average PHP dev needs is an excuse to write crappier code.
homo-lorens611248dIf you need independently optional arguments, just use an options object. Named arguments don't work well in python and the only scenario where I can imagine they're good is if you want independently optional arguments in a strictly typed language without defining a struct.
hjk101290647dI love the idea. As 'function($required, null, true);' is not really descriptive but I'm afraid that it is going to be abused.
Any code that has a boolean flag is probably a named parameter in my PHP 8 code.
Named arguments is for amateurs and any need for it shows that the code is badly written.
wocodes-147dNamed arguments? Doesn’t seem to make any sense
PrivateGER1836946dFuck named arguments. This will be a damn mess.
rooter133546dI love it. We even had it as a standard 🤔 If a 3rd party lib changed some bad params our code would be happy. And yes, we did have to tests.