|
|
|
|
|
by ExpiredLink
4210 days ago
|
|
> Java. A bit better. Compare the readability of OpenJDK's ArrayList.java to the STL vector.h, which does essentially the same thing: http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/00cd9dc3c2b5/s.... But of course the Java standard library is immense and has a lot of cruft in it. Really? Java's success is - rightly - attributed to its simple and usable libraries. > To write clean Java you really need to avoid much of the standard library (read Effective Java by Josh Bloch) Lol, the standard ArrayList.java is written by ... Josh Bloch! |
|
There are many parts of the Java library to avoid. Some are obsolete and terrible, like CORBA or java serialization. Others are gotchas w weird semantics, like Object.clone(). Others are just bad API design--eg the built in IO libs don't require a Charset argument. The default is the "system default charset", which is apparently still the obsolete MacRoman if you're on OSX.
The most annoying are those shortcomings of the std library that cause extra complexity. For example, the built-in JUL logging framework sucks enough that almost everyone uses log4j or logback instead. But now you have user libraries using incompatible logging frameworks. Enter slf4j, a shim that ties them all together.
In my experiemce, Go is a breath of fresh air.