4 ms·
Java can also become very complex because of it's simplicity. Sometimes it can be hard to read java code just because there is much more of it.
by nuriaion 14y ago
Java can also become very complex because of it's simplicity. Sometimes it can be hard to read java code just because there is much more of it.
- lutusp 14y ago> Java can also become very complex because of it's simplicity. Another way to say this is that Java is a lower-level language than many newer languages, consequently it's much more wordy. And it is certainly wordy, to the degree that it's difficult to follow one's own code. And I see you make a similar point.
- xjru 14y agoI don't deny that. What adds to complexity more than verbosity, though, is that Java's lack of abstraction facilities leads to the overuse of frameworks, including byte code manipulation and excessive reflection. At that point it can get really obscure. But you can write straighforward Java, and on average reading someone elses Java code is easier than reading typical C++ code for instance. I don't have experience with reading other people's Scala code but it seems similar to C++.
- yareally 14y agoOne of the worse examples I have come across is using BigInteger. You end up with code like this: BigInteger four = new BigInteger("4"); BigInteger sum = four.add(new BigInteger("2")); // assuming you won't need 2 again so why store a in var I never wished for the ability to do operator overloading anymore than I do when I have to use BigInteger in java. It just makes math look so unnatural and hard to read. You end up with variables all over the place to do Math on numbers or have to create a bunch of them in the method arguments. Just an utter mess when compared to the similar class in C# that does it with operator overloading.