Sitemap
Level Up Coding

Coding tutorials and news. The developer homepage gitconnected.com && skilled.dev && levelup.dev

Clean Code, its Principles and Rules.

How to Write Clean Code? Follow These Best Practices

6 min readFeb 12, 2023

--

Press enter or click to view image in full size
Photo by Safar Safarov on Unsplash

Hello folks, this article is not about some java related feature or concept but more than that. Basically, I’m going to explain all mistakes a java developer does while writing the code and hence how you can minimize it and you don’t have to refactor your code. So this article is about the BEST PRACTICES a developer should always follow.

1. What’s there in the name:

A developer should always try to give a meaningful name to the variables, methods, and classes. It becomes too easy to understand what the method or class or variable is about when someone reads your code while reviewing it or debugging it. Giving names like a,b, and c to the variable does not intend any meaning and becomes less relevant while debugging the code.

1. Always start the name of a class with upper case. Eg.

public class Employee{
}

here Employee is the class name and other developers can easily understand that this class deals with employee-related stuff.

2. Always start a variable name with…

--

--

BaseCS101
BaseCS101

Written by BaseCS101

-: Empowering Developers to Ace Their Technical Interviews :-