How Living Code Replaced Documentation in My Workflow

What happens when you stop writing documentation and let code tell its own story? My experiment with executable examples

Note: This vibe coding approach requires terminal/CLI access. These examples are from Claude Code (Anthropic's official CLI tool for Cursor IDE) which has filesystem and bash command execution capabilities.

Problem

Documentation becomes outdated and loses synchronization with code over time. Developers spend more time maintaining documentation than writing actual code.

Solution

Documentation-Focused Approach (Old)

Traditional projects rely heavily on static documentation:

project/
├── README.md
├── CONTRIBUTING.md
├── docs/
│   ├── API.md
│   ├── SETUP.md
│   └── ARCHITECTURE.md

Issues:

  • Quickly becomes outdated

  • Never matches actual code

  • Maintenance burden

Code-Focused Approach (New)

Let the code be the documentation:

# Discover patterns from actual code in terminal
culture src/interface/bin

# View evolution through git history
git log --oneline --grep="learned:"

# Code tells the story in Cursor IDE
cat tool.ts

Benefits:

  • Always up-to-date

  • Single source of truth

  • Zero maintenance overhead


Examples

Writing Comments (Old Way)

/**
 * Processes user data from the database
 * @param {string} userId - The unique identifier for the user
 * @returns {Object} User object containing all user information
 * @throws {Error} When user is not found
 */
function getUser(userId: string) {
  // Check if userId exists
  if (!userId) {
    // Throw error if not
    throw new Error("User ID is required")
  }
  // Return user from database
  return database.users.get(userId)
}

Self-Documenting Code (New Way)

function getUser(userId: string) {
  if (!userId) throw new Error("userId required")
  return users.get(userId)
}

The code itself shows:

  • Parameter is required (throws if missing)

  • Returns user object

  • Simple and clear logic


Pattern Discovery

Traditional Documentation

## How to Use This Tool

This tool accepts the following parameters:
- `--input`: The input file path
- `--output`: The output file path

Example usage:
tool --input data.txt --output result.txt

Living Code Pattern

# See how it's actually used
culture tools/

# Output shows real usage patterns:
# - Last 3 modified tools
# - Actual implementation
# - Real examples from git history

Core Philosophy

The zero documentation philosophy embraces these principles:

1. Git History as Collective Memory

Every commit tells a story. The evolution of code is the best documentation.

2. Culture Command for Pattern Discovery

Instead of reading docs, discover patterns from actual code using terminal:

culture src/  # See what changed in git and why

🔧 Install the culture tool:

npm install -g @yemreak/culture

View on NPM | Source on GitHub

3. Master-Apprentice Learning

Learn by reading code, not documentation. The code is the master, you are the apprentice.

4. Every Character Matters

Minimize text, maximize meaning. If it doesn't add value, remove it.

5. Experience Over Explanation

Show, don't tell. Let developers experience the code rather than read about it.


Implementation Guide

  1. Remove unnecessary documentation files

    • Delete outdated READMEs

    • Remove CONTRIBUTING guides

    • Eliminate architecture docs

  2. Write self-explanatory code

    • Use descriptive names

    • Fail fast with clear errors

    • Keep functions small and focused

  3. Leverage git history

    • Write meaningful commit messages

    • Use git log as documentation

    • Track evolution, not snapshots

  4. Create discovery tools

    • Use the @yemreak/culture npm package

    • Show real usage patterns

    • Extract patterns from history


Benefits

  • Always Current: Code can't lie, documentation can

  • Single Source of Truth: One place to look, not multiple docs

  • Reduced Maintenance: No documentation to update

  • Better Developer Experience: Learn by doing, not reading

  • Faster Onboarding: See real examples, not theoretical guides


Conclusion

Stop writing documentation. Start writing better code in Cursor IDE. Let the code tell its own story through clear naming, simple logic, and git history with Claude AI. The best documentation is no documentation—just living, breathing, self-explanatory code in terminal.

Last updated

Was this helpful?