News for hackers. Stuff that matters.
Re:Java is not a safe language by dtech on Monday June 13, 2022 @08:07AM (#31724292)
Named arguments are in a lot of modern languages: Python, Kotlin, Swift, Javascript*, probably others.

* APIs often do something similar by passing in an object with optional fields*

Re:Java is not a safe language by BeefWellington on Monday June 13, 2022 @10:36AM (#31726218)
> Javascript, > APIs often do something similar by passing in an object with optional fields*

That's really not the same as the others though, as it's a convention. That's arguing that passing a Python dict or Namespace to a function is the same as named arguments in the function's definition itself. You can do the same in Java with Dictionary<string,object> if you want.

Re:Java is not a safe language by dtech on Monday June 13, 2022 @04:07PM (#31731077)
I wouldn't call that the same. In Typescript the arguments object is fully typed, while in Java you lose all typing.
Re:Java is not a safe language by oaiey on Tuesday June 14, 2022 @01:33AM (#31735105)
They are but ultimately the author wish that their usage is enforced. And that is IMHO in no major language including the above.
Re:Java is not a safe language by kaba0 on Monday June 13, 2022 @05:20PM (#31731912)
(Nitpick, but is python a modern language? It is almost a decade older than Java)
Re:Java is not a safe language by dtech on Tuesday June 14, 2022 @02:22AM (#31735369)
Definition question. It fits if you use "languages that appeared after or incorporated features from younger languages in newer versions".

Also 4 years older, not a decade.