Readability, efficiency, maintainability, and usability
Readability, efficiency, maintainability, and usability are all critical factors to consider when writing code.
Readability
Readability refers to the ease with which a human reader can understand a piece of code. Well-written code is easy to read, with clear and concise statements that are organized in a logical and consistent manner. This becomes very important if we consider that developers spend ten times more time reading code than writing it.
Let’s take a look at the following piece of code:
class Employee { public: std::string get_name(); std::string surname(); uint64_t getId() const; };
This example is an exaggerated example of code not following any code convention. A developer using the Employee
class can understand that all three methods are getters. However, the differences in the names make the user spend more time understanding the code or trying to understand...