SIMPLE TIPS TO WRITE CLEAN CODE ⠀

SIMPLE TIPS TO WRITE CLEAN CODE </>⠀



๐Ÿ‘‰Write it for people⠀
It is true that code is interpreted by machines, however, we shouldn’t neglect its readability. The easiest way is to use whitespaces.⠀


๐Ÿ‘‰Add comments correctly
If you write clean code, people will understand “how”, but they won’t understand “why”. Add comments to tell readers why you choose those ways and algorithms.⠀


๐Ÿ‘‰Use meaningful names⠀
You should use meaningful names for variables, functions, and methods. Meaningful names are descriptive enough that people will be able to understand their purpose.⠀


๐Ÿ‘‰Let it perform only one task⠀
Every function or method should perform one task only. This way they will be more predictable and easy to understand. This is called the Single Responsibility Principle.⠀


๐Ÿ‘‰Be Consistent
Find common conventions and standards in the community of your programming language and try to stick to those everywhere.⠀


๐Ÿ‘‰Review your code regularly⠀
Simply writing clean code is not everything. The next step is to keep your code clean. Clean code requires maintenance. You should review your code on a regular basis.⠀

๐Ÿ“•Data Structures and Algorithms Made Easy: Data Structures and Algorithmic Puzzles Paperback – 2016 by Narasimha Karumanchi (Author)

What are your strategies to write clean code? Share your ๐Ÿ’ญthoughts in comments⠀


                           ______________________________

Comments

Popular posts from this blog

Git AND GitHub FUNDAMENTALS

My LHD share experience

LIBRARY vs. FRAMEWORK⠀