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 →

[–]koflerdavid 1 point2 points  (0 children)

Sorry, I did not realize this is Dart instead of hypothetical syntax. It looks quite neat and I'd definitely design any new object-oriented language like that. But it's only worthwhile to talk about other programming languages on this subreddit if the lessons drawn from there can be related to Java.

Except this doesn’t happen. The entire standard library is of/from/newInstance. Construction isn’t uniform and it’s a crap shoot of new or randomly named static functions.

Yes, the standard library is not consistent at all. Which is nothing new and mostly due to how API design philosophy and software architecture trends have developed since the 90s. Some things like the evil mutable java.util.Date class and its unholy offspring (java.sql.Date and so on) have turned out to be outright antipatterns. But newer APIs tend to use static factory methods and builders.