How to keep code neat and clean? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

How to keep code neat and clean?

Want some coding techniques to improve readability and understandability of code.

3rd Apr 2017, 8:23 PM
Harshal
Harshal - avatar
13 Answers
+ 6
I recommend to read the book "Clean Code" by Robert C Martin. It's really useful and also funny to read. http://ricardogeek.com/docs/clean_code.pdf
3rd Apr 2017, 8:27 PM
Daniel Thomalla
Daniel Thomalla - avatar
+ 15
Enforce proper indentations and use descriptive variable names. Replace frequently repeated blocks of codes with functions. Utilise comments if necessary.
4th Apr 2017, 12:37 AM
Hatsy Rei
Hatsy Rei - avatar
+ 8
just don't write any code, it will be perfectly clean "deleted code is debugged code" 😂
3rd Apr 2017, 8:29 PM
Kamil
Kamil - avatar
+ 4
Thanks @Daniel for your link.
4th Apr 2017, 1:02 AM
Agus Mei
Agus Mei - avatar
+ 3
I searched on internet and got following: 1. Use comments 2. Use code Indentation 3. Use variables and functions with appropriate names 4. Try to use functions whenever required.
3rd Apr 2017, 8:29 PM
Harshal
Harshal - avatar
+ 3
Always use the same ide for all your works that way your work will be the same and others will be familiar with your code and you can use ide to format your code. I recommend visual studio..
3rd Apr 2017, 10:16 PM
mikiyas tibebu
mikiyas tibebu - avatar
+ 2
using tab button XD
3rd Apr 2017, 9:13 PM
Amjad
Amjad - avatar
+ 2
comments is the most important
4th Apr 2017, 1:50 AM
yash
yash - avatar
+ 2
on top of everything thats already been mentioned, i would also say to keep your code simple. i know many things can be done in one single complex line of code, but it is better to break it down into three or four simple lines of code.
4th Apr 2017, 3:48 AM
Edward
+ 1
Use proper comment lines to seperate sections , indent your code, use white spaces appropriately if allowd, name of variables should be relevant to logic
4th Apr 2017, 2:13 AM
Akshay Dhotre
Akshay Dhotre - avatar
+ 1
using comments is key
4th Apr 2017, 6:13 AM
Xfonts Admin
Xfonts Admin - avatar
0
Began between end
10th Apr 2017, 6:41 PM
Theresa
0
A bit long but well worth watching: https://m.youtube.com/watch?v=ytJnSttKL6A
3rd Sep 2017, 2:23 PM
Haris
Haris - avatar