3 ms·
The Java standard library is anemic? As in Java SE? That's rich. Java SE is an everything but the kitchen sink standard library, with functionality like collect
by morsch 11y ago
The Java standard library is anemic? As in Java SE? That's rich. Java SE is an everything but the kitchen sink standard library, with functionality like collection classes, local and networking IO, windowing toolkits (more than one), database connectivity, the list goes on.
There is no language with a less anemic standard library, and Java SE is often criticized for being too large.
- opmac 11y agoThis is true. One wonders if OP has actually seen the vastness of Java SE or is just "hating" to "hate".
- creshal 11y agoI've seen it, and more often than not frustratedly turned to Apache Commons because the Java standard library is as vast as it is useless.
- usrusr 11y agoThe JRE lib seems to be a compromise between "common types for everybody, but leave the convenience to external libraries" and "batteries included". This leaves both camps deeply dissatisfied, but allows for a great deal of integration between libraries. Maybe I have looked at Microsoft flavored C++ one time too often, but the fact that a single string type could reign unchallenged for twenty years makes it easy for me to accept that I need to use weird imports to tackle exotic convenience desires via statics (that, and the sad underutilization of CharSequence).
- mdemare 11y agoJava SE includes a lot, but it does emphatically not include a reasonable amount of useful string methods. These are the javadocs for string: https://docs.oracle.com/javase/7/docs/api/java/lang/String.html https://docs.oracle.com/javase/7/docs/api/java/lang/String.h... and these are the rubydocs: http://ruby-doc.org/core-2.3.0/String.html http://ruby-doc.org/core-2.3.0/String.html The difference is absolutely massive. When working on Java projects, I've always included commons/StringUtils reflexively, and even then Ruby is quite a bit ahead. The same applies to collections / enumerables. There's a lot in Ruby that I don't like, but powerful "batteries included" standard libraries for the basics like strings and collections are the bedrock of any programming language. It only takes hard work to write them and test them, not any specific skill, so there is no excuse for all the language out there that are skill lacking, in 2016, a sensible collection of utility methods.
- nradov 11y agoMuch of that functionality is in other Java SE standard library classes. You can do left padding with Formatter. http://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html http://docs.oracle.com/javase/8/docs/api/java/util/Formatter...
- krinchan 11y ago>There is no language with a less anemic standard library PHP would like to see you out back in the alleyway, as some other posters in this thread have pointed out. > Java SE is an everything but the kitchen sink standard library, with functionality like collection classes, local and networking IO, windowing toolkits (more than one), database connectivity, the list goes on. Yes. However, there are a lot of design decisions held onto because of backwards compatibility that continue to cause massive pain points. Object.toString() comes to mind. The fact that String.format() has to be either statically imported or typed out every time. I'm so sick of lengthy string concatenation in Java. "When I use format " + createSentenceStringFromList(work.getCoworkers(), "and") + " act like I've committed " + A_HORRENDOUS + " crime."