Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Java has no built in macro system. It is not possible to implement something as simple as an assertion statement that displays the false expression on an error.
- 2. Exceptions are the normal style in Java, resulting in complex and inefficient code that frequently unwinds and reconstructs the stack.
- 3. Java does not have first class functions. However, they may be emulated with anonymous classes, at the cost of being more verbose and harder to read. The need to define an object that implements a method with a particular name makes it more difficult to write a library for higher order functions.
- 4. It is not possible to define a function within a function. However, it is possible to define a class within a function, and the class may have methods. There is no advantage to disallowing one while allowing the other, save for making it more verbose.
- 5. The Object interface provided by all objects provides methods for equality and hash code, but does not provide methods for comparison. Alternative interfaces for comparable objects are ugly or incompatible, making ordered data structures harder to use.
- 6. All methods for a class must be defined within the class body, which can produce very large files if the class has many methods.
- 7. Lexically scoped classes may develop large definitions, producing enormous source files. They are also hard to divorce from their outer class definition, making it difficult to share code between other such child classes. The real solution is to do away with the lexically scoped definition, but programmers will take the immediately easier solution of copying and pasting code, resulting in large bodies of duplicate code in multiple files.
- 8. The Java runtime is known for being insecure. Java is now owned by patent troll, Oracle, which creates anxiety about any investment whatsoever in the language. It also doesn't help that they don't plan on fixing the security issues.
- 9. Package names following the pattern of com.example.www are unnecessarily verbose. Name collisions between packages are rare, and can be resolved easily enough via other means.
- 10. Tail recursion is not supported, and made impossible by the design of the virtual machine. This is particularly annoying, since tail recursion blends so well with the object oriented notion of the call to the super class.
- 11. The compiler signals too many false positive errors. Floats need to be explicitly casted to int. Errors about unreachable code will prevent you from compiling and testing code that is still a work in progress.
- 12. Forcing the programmer to type "public static final" may be negative reinforcement to defining global variables, but it does not remove global variables or provide the programmer with another way to solve their problem.
- 13. In general, Java strives to find the most verbose representation for everything.
- 14. Java claims to be more memory secure than alternatives like C++, but this is made invalid by its insecure supporting libraries. It also doesn't matter how memory secure your application is if it still dies from a NullPointerException.
- 15. The object model is weak and inexpressive. The lack of multiple inheritance makes combining functionality from multiple classes more difficult.
- 16. APIs may require objects to implement an excessive amount of interfaces and method names in interfaces may collide.
- 17. APIs are encouraged to make excessive use of design patterns that offer little to no benefit, other than making the library more inefficient and harder to learn.
- 18. Local variables referenced in lexically scoped anonymous classes must be declared final, which means they can't be changed in loops. This would be fine, but there is no tail recursion, so these variables can't be efficiently used for iteration.
- 19. Parameterized types in generics cannot always be statically verified, and depend on run time checks that may through exceptions and crash your program.
- 20. All methods are virtual by default, which produces more inefficient code if not optimized. Every method being virtual makes escape analysis almost impossible to perform locally, since every method call could invoke unknown code.
- 21. Java code tends to be imperative, which can become difficult to follow as the relationships between objects becomes complex. Java's verbose style makes poorly written code more difficult to read.
- 22. It is not possible to express packed data structures in Java. Objects must use references to link to other objects, resulting in wasted space and cache incoherent memory look ups, and also more work for the garbage collector.
- 23. Java is essentially child-proofed C++ with garbage collection. It sacrifices performance while not providing more expressive power. It's a version of C++ for lesser skilled programmers.
Advertisement
Add Comment
Please, Sign In to add comment