4 ms·
Java could really used keyword arguments as a replacement of the Builder pattern: cat = new Cat(eyes=1, heads=2, legs=4);
by skocznymroczny 7y ago
Java could really used keyword arguments as a replacement of the Builder pattern:
cat = new Cat(eyes=1, heads=2, legs=4);
- rooam-dev 7y agoToo much for small classes/records imho e.g. `new Name("First", "Last")` vs. `new Name(first="First", last="Last")` Also, IDEs can help with parameter hints when is needed.
- deleted 7y ago[deleted]
- deepsun 7y agoThey can be optional, like in Kotlin -- you can give name to only some (after unnamed ones).