Named Parameters in Java

Robert likes named parameters. With named parameters, you could code like this

map.put(key:foo.getId(), value:foo);

or this

map.put(value:foo, key:foo.getId());

It's something that's been available in Python. I have to admit that named parameters have charm. But while I like Python, I don't use named parameters. I'm with Cedric on this one. Named parameters become part of a methods signature. This is bad because a name change of a single parameter breaks compatibility. Besides, there are alternatives that don't require changing the language.

Read the discussion over at Cedric's to get the full dose.

Thu, 10 Jun 2004, 23:08 | Java | PermaLink
« Hannah sleeping | Home | Howto Deploy Firewall Settings in Windows XP SP2 »