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”.

  1. 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.
  2. 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.

Thank you

Akshitha H




Software developer, feminist,exploring new technologies

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

DraftJS — Insert/Paste images into your content.

Frontend Weekly Digest #175 (7–13 September 2020)

Notes on Node JS

JavaScript Some basic Fundamental Core Concepts

How to Override Laravel Installer to Allow Custom .env Defaults and Run Extra Shell Commands

Solving Codewars : 7kyu alienLanguage kata

How to apply an HTML Template in Node.JS

What is immutability in Java?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Akshitha Shetty

Akshitha Shetty

Software developer, feminist,exploring new technologies

More from Medium

One Way to implement ABAC Model with Spring Security

Concurrency vs Parallelism in simple terms (Important question in system design interviews)

Spring Boot Application With Multiple Data sources

Undo Changes With Memento Pattern