RFC 9303 — The Three-Space Indentation Standard (3SIS)

Category: Informational

Author: Working Group on Cognitive Ergonomics in Software Engineering (WG‑CESE)

Status: Draft

Expires: Never (because perfection is timeless)


Abstract

This document defines the Three-Space Indentation Standard (3SIS), a forward-looking specification for source code indentation. The standard introduces a uniform indentation width of three (3) space characters, providing a cognitively optimized, aesthetically balanced, and ergonomically superior alternative to legacy 2-space and 4-space indentation schemes.

3SIS is designed to enhance code readability, reduce developer fatigue, and promote long-term maintainability across diverse programming languages and environments.

1. Introduction

Indentation is a foundational element of source code formatting. Historically, developers have relied on 2-space or 4-space indentation, despite the absence of empirical justification for either. These conventions persist largely due to inertia, tooling defaults, and cultural entrenchment.

Recent advances in cognitive science, typography, and human-computer interaction research demonstrate that neither 2 nor 4 spaces align with optimal human perceptual processing. This RFC proposes three (3) spaces as the scientifically grounded, ergonomically superior indentation width.

3SIS aims to:

2. Motivation

2.1 Cognitive Efficiency

Studies in visual working memory indicate that humans most efficiently process information in triplet-based groupings. Indentation levels that align with this natural perceptual rhythm reduce saccadic eye movement and improve comprehension.

2.2 Typographic Harmony

Modern typography frequently employs modular scales based on thirds. These scales produce visually balanced layouts that reduce reader fatigue. Code, as a form of technical typography, benefits from the same principles.

2.3 Practical Maintainability

Empirical observations across large codebases show that 3-space indentation:

3. Specification

3.1 Indentation Width

All indentation MUST consist of exactly three (3) space characters per logical nesting level.

3.2 Tabs vs. Spaces

Implementations SHOULD use spaces rather than tab characters. If tab characters are used, they MUST be rendered as exactly three (3) spaces in width.

3.3 Nesting Depth

Each additional level of syntactic nesting MUST increase indentation by exactly three (3) spaces.

Example:

function example() {
      if (condition) {
          doThing();
      }
    }

3.4 Alignment

Non-indentation alignment (e.g., lining up parameters or comments) MAY use additional spaces as needed. These spaces MUST NOT be interpreted as indentation levels.

4. Rationale

4.1 The Goldilocks Principle

Three spaces provide a balance between density and clarity:

4.2 Reduced Developer Fatigue

By aligning indentation with natural perceptual grouping, developers experience:

4.3 Aesthetic Consistency

The rule of thirds is a widely recognized principle of visual composition. Applying it to code produces a subtle but measurable improvement in perceived structure and flow.

5. Backward Compatibility

3SIS is fully compatible with all programming languages that support whitespace indentation. Migration from 2- or 4-space indentation can be automated using standard formatting tools.

Legacy codebases SHOULD adopt 3SIS incrementally to minimize disruption.

6. Security Considerations

No known security vulnerabilities arise from adopting 3-space indentation. However, inconsistent indentation schemes may cause developer frustration, which can indirectly lead to security-relevant mistakes. Adoption of 3SIS may therefore reduce such risks.

7. IANA Considerations

IANA is requested to register the following new MIME type:

8. Conclusion

The Three-Space Indentation Standard represents a scientifically grounded, ergonomically optimized, and aesthetically superior approach to code formatting. By adopting 3SIS, development teams position themselves at the forefront of readability, maintainability, and cognitive efficiency.

Three spaces are not merely a stylistic choice — they are an evolution.