CLOSE
Updated on 21 Jun, 20267 mins read 19 views

Imagine you are asked to build a login system.

Requirement:

Validates username and password.

A junior developer creates:

class UserAuthenticationStrategyFactoryProvider
{
public:

    static std::unique_ptr<
        AuthenticationStrategyFactory
    > createFactory(...)
    {
        ...
    }
};

After several layers:

Factory
  -> Factory Factory
      -> Strategy
          -> Provider
              -> Manager

Finally:

bool authenticate(
    const std::string& user,
    const std::string& password
);

is called.

Another developer writes:

class Authenticator
{
public:

    bool authenticate(
        const std::string& username,
        const std::string& password
    );
};

Both solves the problem.

One creates unnecessary complexity.

The other creates clarity.

This distinction is the foundation of: KISS

Historcial Background

KISS originated in engineering and military design.

The concept is often attributed to: Keylly Johnson

who led development of advanced aircraft at Lockheed Corporation.

The philosophy:

Systems work best when they are kept simple rather than made unnecessarily complicated.

Software engineering later adopted this idea because engineering repeatedly discovered:

Most failures come from complexity.

Not from simplicity.

Official Definition

KISS stands for:

Keep It Simple, Stupid

A more professional interpretation:

Keep It Simple

Meaning:

Prefer the simplest design that correctly solves the problem.

Notice:

It does NOT say:

Use the shortest code.

It does NOT say:

Ignore architecture

It does NOT say:

Avoid abstractions

It says:

Avoid unnecessary complexity

The Core Problem: Complexity

Software complexity grows naturally.

Every new:

Class
Interface
Module
Service
Pattern
Dependency

adds complexity.

Complexity has costs.

Harder to Understand
Harder to Debug
Harder to Extend
Harder to Test
Harder to Refactor

A major responsibility of software designers is:

Managing Complexity

 

Buy Me A Coffee

Leave a comment

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

Your experience on this site will be improved by allowing cookies Cookie Policy