Which software design principle suggests that a function should perform one and only one job?

  • Single Responsibility Principle (SRP)
  • Open/Closed Principle (OCP)
  • Liskov Substitution Principle (LSP)
  • Interface Segregation Principle (ISP)
The Single Responsibility Principle (SRP) states that a function or module should have one and only one reason to change, which means it should perform one specific job or responsibility. This helps in making the code more maintainable and understandable.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *