| ▲ | Kwpolska 2 days ago | |
Here is an example of the Builder pattern that illustrates my point: https://www.baeldung.com/java-builder-pattern#bd-classic-bui... Let’s remove the category argument and you get this:
This builder is a more readable alternative to this:
But if Java supported named arguments and default values (the default would be null), this could just be: | ||
| ▲ | vips7L 2 days ago | parent [-] | |
Funny part is that Java does have named parameters, but only for annotations! | ||