1 of 10

Software Engineering (203105303)

Prof. Pirmohamed, Assistant Professor Computer Science & Engineering

2 of 10

Programming Principles & Guidelines Design

Unit-5

3 of 10

Programming Principles & Guidelines

Building robust and maintainable software requires a foundation of programming principles and guidelines. These principles act as a compass, guiding developers towards best practices for writing code that is efficient, readable, and adaptable.

4 of 10

SOLID Principles : The Foundation of Maintainability

Single Responsibility

Each class should have only one responsibility.

Liskov Substitution

Subtypes must be substitutable for their base types.

Open/Closed

Software entities should be open for extension, but closed for modification.

Interface Segregation

Clients should not be forced to depend on methods they don't use.

5 of 10

DRY (Don't Repeat Yourself): Efficiency in Action

  1. Avoid duplicating code by extracting common logic into functions or reusable components.
  2. Reduces the risk of errors and inconsistencies.
  3. Simplifies code maintenance, as changes only need to be made in one place.

6 of 10

Prioritizing Clarity and Understandability

Easier to Understand

Simple code is easier to read, understand, and debug.

Reduced Complexity

Simplicity minimizes the risk of introducing bugs and errors.

Faster Development

Focus on clarity leads to faster development cycles.

7 of 10

Avoiding Premature Optimization

  1. Focus on meeting current requirements.

  • Avoid unnecessary complexities that might not be needed.

  • Prioritize functionality and simplicity.

8 of 10

Coding Standards & Style Guides

Ensuring Consistency Across Teams

  1. Establish a set of coding conventions to maintain code consistency.
  2. Includes formatting, naming conventions, error handling, and commenting.
  3. Improves code readability and maintainability,facilitating collaboration.

9 of 10

Design Patterns

Proven Solutions to Recurring Problems

  1. Design patterns are reusable solutions for common software design problems.
  2. Offers proven methods for structuring code and relationships between objects.
  3. Examples include Singleton, Factory, and Observer patterns.

10 of 10

Testing & Code Reviews

Safeguarding Code Quality and Reliability

  1. Testing helps identify bugs and ensure functionality before deployment.

  • Code reviews provide valuable feedback and promote best practices.

  • Together, they contribute to higher-quality and more reliable software.