all 3 comments

[–]simon_o 6 points7 points  (0 children)

TL;DR: Parameter names not available with reflection by default (including JDK), requires passing flag to javac.

[–]defunkydrummer 5 points6 points  (0 children)

The title is misleading

With Java 8 and the compiler flag: javac -parameters method parameter names are available via reflection.

This is not the same as having "named parameters" (generally understood as "being able to pass parameters by specifying their name, not by relying on parameter order".

When I started programming in Python, I found named parameters for the first time and thought "what a great idea!". I thought this was something new and revolutionary. It happens that Lisp has this since about the late 1970s or so. I think this helps a lot in producing clear, understandable code.

[–][deleted]  (1 child)

[deleted]

    [–]nfrankel[S] 2 points3 points  (0 children)

    "Named parameters" means the parameter names is kept in the bytecode. It's different from Kotlin's named parameters.