Clean code in computer programming refers to software that is concisely written, easy to understand, not unnecessarily complex and that executes correctly. Programming in this way can be more time consuming, and thus costly, but pays dividends in the long term when it needs to be maintained or modified. This approach is a philosophy rather than a technique that has rules for each programming language the principles of which include:
• Keep it simple – systems should only be as complex as they need to be so that they are efficient.
• Don’t repeat stuff – this refers to the fact that every module of code should have a single, unambiguous purpose and is not duplicated elsewhere.
• Unnecessary functionality – developers should only add the required functionality to a software application and no more.
• Make it readable – programmers should remember that humans, as well as machines, will need to read their code and make it as readable as possible (sometimes even at the expense of concision).