Hacker News new | ask | show | jobs
by scopendo 1730 days ago
All I want is named parameters so that I don't need to have N variations of the same method with different signatures, also particularly helpful for understanding boolean parameters.
2 comments

If Java had anonymous (structural) records, then named arguments could just be a function with a parameter that has a record structural type. It could even be given syntactic sugar, something like:

foo{ bar=true, baz=true }

Named parameters are great but RequestTypes are better. It lets you roll validation into the request type itself which helps clean up methods a ton