Two bad practices you must avoid in java
Recently i was scanning code using coverity, was amazed to see few bad practices will impact performance of your application.If you never heard or used coverity, will write my article on “How to install and use coverity”.
- Stop using + operator and start using concat() method while concatenating string. you must be thinking why should i do that,I’m very much comfortable using + operator. concat() method is better than + operator because it creates a new object only when the string length is greater than zero, so it uses less amount of memory.
- Stop returning data in method and start using void in method if returned data is not required. It happens that many time we write a method with return value and returned value not required this will impact performance of application.