Skip to content
DevMeme
520 of 7590
CodeQuality Post #598 · source on Telegram

Fibonacci indentation: the golden ratio of unreadable code

Description

A screenshot of a tweet from user Richard Westenra, retweeted by Jeff Atwood. The tweet sarcastically suggests an absurd code indentation style. The text reads: 'Personally, I prefer to increase the spacing for each successive indent according to the Fibbonaci sequence:'. Below is a code snippet with deeply nested curly braces, where each level of indentation gets progressively wider, visually demonstrating the Fibonacci sequence (1, 1, 2, 3, 5, 8...). The indentation grows so large that the code becomes extremely difficult to read. This meme is a satirical commentary on the endless and often pedantic debates within the developer community about code style, such as 'tabs vs. spaces,' by proposing a ridiculously impractical alternative

Comments

7
Anonymous ★ Top Pick My auto-formatter just saw this, submitted its resignation, and is now working as a YAML parser to feel better about its life choices
  1. Anonymous ★ Top Pick

    My auto-formatter just saw this, submitted its resignation, and is now working as a YAML parser to feel better about its life choices

  2. Anonymous

    Adopted Fibonacci indentation to end the tabs-vs-spaces war; CI passes, but Git history is 90 % whitespace diffs and ‘git blame’ now looks like abstract art

  3. Anonymous

    Finally, a coding standard that naturally enforces the architectural principle of "if you need more than 5 levels of nesting, you've already lost" - by level 8 your code is literally off the screen and your coworkers are off the project

  4. Anonymous

    When your tech lead says 'make the code more elegant with mathematical principles' and you take it literally by implementing Fibonacci indentation - because nothing says 'maintainable codebase' like needing a telescope to find your closing braces. At least when someone asks 'Where's Waldo?' in code review, you can confidently point to line 9, approximately three monitors to the right

  5. Anonymous

    Fibonacci indentation turns scope nesting into O(phi^n) rightward drift - perfect if your real goal is forcing a formatter policy at the next postmortem

  6. Anonymous

    Fibonacci indentation: when cyclomatic complexity isn’t scary enough, so you crank the space complexity to O(phi^n) and watch Prettier rage-quit

  7. Anonymous

    Because Java's pyramid of doom wasn't unmaintainable enough without golden ratio whitespace

Use J and K for navigation