News for hackers. Stuff that matters.
Re:Are software engineering “best practices” just developer ... by Too on Sunday October 03, 2021 @03:41AM (#28735306)
Java was for very long missing anonymous functions, so for anything involving callbacks you had to make gazillion of Listener- or Factory-classes instead, which further forced you to create an interface for each of them. Leading to all these infamously verbose design-patterns.

It was also for a very long time missing some fundamental Stream, List and String processing features. Just getting the contents of a file or converting a string to bytes, or even just initializing an Array often required 2-3 lines of verbose OutputStream(StreamBuilder().fromArray(Arrays.asList(1,2))).readBytes().add(3), wrapped in a try-catch for all the checked exceptions. For things that in C# would just be a oneliner of new List<int>({1,2,3}) or in Python [1,2,3].

This is mostly solved in current versions of the language, but the reputation and the "best practice" design-patterns remains.

There are no comments on this comment yet.