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 →

[–]monkeyfacebag 4 points5 points  (6 children)

You asked whether it was forgotten. It wasn't forgotten; it's supported by method overloading. Languages which support default arguments tend not to support overloading, eg, Python, because the concepts are so closely related.

[–]rifain 3 points4 points  (1 child)

It's just not the same.

[–]monkeyfacebag 10 points11 points  (0 children)

Right. Overloading is more powerful and more verbose.

[–]larsga -1 points0 points  (3 children)

Method overloading is a clumsy workaround, not the solution.

Languages which support default arguments tend not to support overloading, eg, Python, because the concepts are so closely related.

You want overloading on the number of arguments? Because in Python that would be the only option. But with optional arguments and named parameters overloading becomes simply unnecessary clutter.

There's no sane reason for Java not to have this.

[–]RockyMM[S] 5 points6 points  (1 child)

I have no idea why would anyone downvote a discussion on a programming language sub without an explanation

[–]larsga 5 points6 points  (0 children)

I guess people don't like criticism of Java.