Make delicious recipes!

Java criticism

Some shortcomings have been found in Java over the years. Briefly, they can be summed up as follows:

1) No support for compound value types like struct in C.
Java simulates the compound value types by making use of reference. However this is inefficient.
Consider the case of a hash-map which stores entries in an array.
Each entry holds a key and a value.
Since, compound value type is absent, Java holds a reference to a class in each cell of the array.
And the class also holds two references - one for key and other for value.
If compound value types are supported in Java, then performance will improve because then double de-referencing as explained above would be avoided.


2) Arrays allow only integer indices
Due to this, the size of an array is limited to the size of an integer which is approximately 2 billion in a 32-bit computer.

3) No support for unsigned int
Due to the absence of unsigned int, bit manipulations become somewhat difficult and the programmer has to pay more attention when doing such operations in Java. Java 8 plans to address this shortcoming.

4) Type-erasure in generics
Since generics were introduced after Collections had been already introduced, Java had to implement generics using type-erasure so that previous programs would still work.
Due to this, the type information of a generic is available only at compile-time and not at run-time.
This type-erasue in generics at run-time can lead to some issues sometimes like not being able to instantiate a generic.

5) Performance
Though not so much of an issue now a days, in earlier days (before the year 2000), Java was criticsed for being very slow. However with the introduction of HotSpot VM in 2000, the JIT compilers now produce code which is within a factor of 3 relative to C/C++ performance-wise.




Like us on Facebook to remain in touch
with the latest in technology and tutorials!


Got a thought to share or found a
bug in the code?
We'd love to hear from you:

Name:
Email: (Your email is not shared with anybody)
Comment:

Facebook comments:

Site Owner: Sachin Goyal