*** Welcome to piglix ***

Criticism of Java


A number of criticisms have been leveled at the Java programming language and the Java software platform for various design choices in the language and platform. Such criticisms include the implementation of generics, forced object-oriented programming only, the handling of unsigned numbers, the implementation of floating-point arithmetic, and a history of security vulnerabilities in the primary Java VM implementation HotSpot. Additionally, Java, especially its early versions, has been criticized for its performance compared to other programming languages, some of which the Java community (before it was a community) had claimed it would better. Developers have also remarked that differences in various Java implementations must be taken into account when writing complex Java programs that must be used across these implementations.

When generics were added to Java 5.0, there was already a large framework of classes (many of which were already deprecated), so generics were chosen to be implemented using type erasure to allow for migration compatibility and re-use of these existing classes. This limited the features that could be provided by this addition as compared to other languages.

Because generics were implemented using type erasure the actual type of a common template parameter E is unavailable at runtime. Thus, the following operations are not possible in Java:

However, the following is, and will throw a ClassCastException on run-time, which means the type system was unable to detect any problems.

By design, Java encourages programmers to think of a programming solution in terms of nouns (classes) interacting with each other, and to think of verbs (methods) as operations that can be performed on or by that noun. Many argue that this causes an unnecessary restriction on language expressiveness because a class can have multiple functions that operate on it, but a function is bound to a class and can never operate on multiple types.

In many other multi-paradigm languages, there is support for functions as a top-level construct. When combined with other language features such as Function Overloading (one verb, multiple nouns) and/or Generic Functions (one verb, a family of nouns with certain properties), the programmer is given the ability to decide whether it makes more sense to solve a specific problem in terms of nouns or verbs. Java version 8 introduced some functional programming features.


...
Wikipedia

...