AI can’t mess up your code if there’s no code in the first place - Shape Devlog - Jan 21

The speaker describes radically simplifying their app Shape’s codebase by merging all models and logic into as few files as possible, rejecting traditional modular complexity in favor of clarity and ease of understanding. They argue that this extreme simplicity benefits both humans and AI, making code easier to maintain and reducing the need for AI assistance.

The speaker discusses a radical overhaul of their codebase for Shape, a collaborative workspace tool. Frustrated with the complexity and fragmentation of their previous architecture, they have decided to consolidate everything into a single file, or at least as few files as possible. This includes merging all models—such as files, folders, tasks, projects, comments, and more—into one unified model and endpoint. The motivation is to rebel against unnecessary complexity and make the codebase so simple that neither the developer nor AI assistants can misunderstand it.

They reflect on their initial attempts to follow best practices by keeping everything modular and separated, with distinct files and endpoints for each model and service. However, this approach led to excessive repetition, boilerplate, and a maintenance nightmare, especially when dealing with polymorphic relationships and access control logic. The speaker is now systematically deleting old services and merging their logic into composable functions within a single service, aiming for clarity and ease of understanding.

A key point is the speaker’s skepticism about the value AI brings to this process. They argue that the most challenging and interesting part of their application—the engine layer that coordinates between client and server—is not something easily delegated to AI. Writing and refactoring this code requires thinking in code, not English, and the iterative process of writing bad code, reflecting, and rewriting is essential for improvement. The speaker finds this process enjoyable and questions what problem AI is really solving, especially when the code is already manageable and fun to write.

The speaker also critiques the current trend of reviewing AI-generated code rather than writing code oneself. They suggest that those who continue to enjoy and understand coding will have an advantage over those who rely too heavily on AI and lose touch with their own codebases. The speaker highlights that Shape’s design aims for radical simplicity, in contrast to the overwhelming complexity of tools like Notion and ClickUp, and that this simplicity should be reflected in the code as well.

Ultimately, the speaker advocates for an extreme form of simplicity in software architecture: as few models, tables, and files as possible, even suggesting a single table or file for the entire app. They argue that this approach benefits both human developers and AI, as it minimizes the context and summarization problems that plague large, fragmented codebases. The lesson, they conclude, is to make code as simple as possible to ensure happiness and productivity for both humans and machines.