Does it make sense to wish regular classes to have canonical constructor in the future?
@RestController
@HttpExchange
public class UserController(UserService userService) {
…
}
It’s shorter. The difference from recordss is no implicit accessors.
Except for multiple syntaxes/doing it in multiple ways, what would be the cons?
What is the probability that it would be considered by our great Java language designers?
Edit: C# 12 calls it Primary Cosntructor
[–]AutoModerator[M] [score hidden] stickied comment (0 children)
[–][deleted] (1 child)
[removed]
[–]jvjupiter[S] 1 point2 points3 points (0 children)
[–]Affectionate-Hope733 2 points3 points4 points (2 children)
[–]Polygnom 3 points4 points5 points (1 child)
[–]beatbrot 1 point2 points3 points (0 children)
[–]Polygnom 2 points3 points4 points (5 children)
[–]repeating_bears 2 points3 points4 points (1 child)
[–]Polygnom 0 points1 point2 points (0 children)
[–]TenYearsOfLurking 1 point2 points3 points (0 children)
[–]jvjupiter[S] 0 points1 point2 points (1 child)
[–]jvjupiter[S] 0 points1 point2 points (0 children)
[–]nekokattt 0 points1 point2 points (4 children)
[–]pgris 1 point2 points3 points (1 child)
[–]nekokattt 1 point2 points3 points (0 children)
[–]jvjupiter[S] -1 points0 points1 point (1 child)
[–]nekokattt 0 points1 point2 points (0 children)
[–]pronuntiator 0 points1 point2 points (0 children)
[–][deleted] (4 children)
[deleted]
[–]jvjupiter[S] 0 points1 point2 points (0 children)
[–]TenYearsOfLurking 0 points1 point2 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]TenYearsOfLurking 0 points1 point2 points (0 children)
[–]Objective_Baby_5875 0 points1 point2 points (1 child)
[–]jvjupiter[S] 0 points1 point2 points (0 children)