[Java] BigDecimal Limitation
I would like to point out a real limitation in Java related to floating point calculation which for such a rich language is really unfortunate.
We cannot use doubles or floats if we want exact calculations, say in a financial app, because of underlying binary floating point representation, so we should use BigDecimals right? But as you know its immutable so for every bit of calculation we are creating new objects just for fun. For strings one can understand the reason behind immutability that is we do not want to create redundancy in memory for same string literals and avoid unnecessary garbage but for BigDecimal and even for Wrappers making them immutable is actually encouraging garbage as every add, subtract operation will result in a new object. That's a luxury some people cannot afford if they would like to write a performant application. There should be a class just like StringBuffer for repeated manipulations of same numeric object. Your thoughts please.