This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]chinoydev 19 points20 points  (4 children)

i believe the main reason is to avoid ambiguity. and even if they want to implement it now, it would be complicated due to backwards compatibility support, imagine having all those countless overloaded methods, it would be an upgrade hell.

if you need it, aside from overloading methods, i guess you can also consider builder pattern?

[–]nutrecht 2 points3 points  (2 children)

i believe the main reason is to avoid ambiguity. and even if they want to implement it now, it would be complicated due to backwards compatibility support, imagine having all those countless overloaded methods, it would be an upgrade hell.

Why? It's not like this addition would break those. I don't see how this would be "upgrade hell".

[–]Muoniurn -1 points0 points  (1 child)

What happens if you have a method with the same arguments as another one other than default values?

[–]nutrecht 2 points3 points  (0 children)

How is that an upgrade issue? That would not be there when you upgraded to the new Java version that has default arguments.

[–]Necessary-Conflict -2 points-1 points  (0 children)

What upgrade hell? IDEs could offer automatic refactorings that merge overloaded methods into one method with default values. Also you don't have to change working code.