Functions Should Be Small And Do One Thing - They Should Have A Single Responsibility

TopicSource
๐Ÿงน Clean CodeClean Code - Udemy

Doing everything in one huge function makes the function unnecessarily complex and difficult to understand. Split the functionality up into different operations. This gives you the opportunity, to name the new functions according to what they are doing, making it much easier to understand what is going on.


  1. Clean code - write your code like an author writes a story
  2. SOLID Clean code in React
  3. Classes should be small and only have a single responsibility