Prettier and Opinionated Code Formatting with James Long - Software Engineering Daily Recap
Podcast: Software Engineering Daily
Published: 2026-03-19
Duration: 3035
Guests: James Long
What Happened
Prettier was created by James Long to tackle the issue of developers spending excessive time debating code style. This opinionated code formatter standardizes how code is formatted, thereby reducing such debates and enhancing workflow efficiency. Prettier was launched in January 2018 and has since become an integral part of the JavaScript ecosystem.
James Long, who has worked at Mozilla and Stripe, co-created Prettier along with Christopher Chadeau. The tool was born out of frustration with the limitations of ESLint's rule-based system, which could not handle all formatting rules. Prettier's deterministic approach simplifies code formatting by relying on a print width parameter, offering a consistent appearance across codebases.
Initially, Prettier faced resistance due to developers' attachment to their unique formatting styles. Over time, however, Prettier gained significant adoption, aided by effective marketing and the increasing complexity of JavaScript projects. The tool allows developers to write code in a less structured manner and then format it cleanly with a keystroke.
Prettier has raised about $243,000 over nine years through donations on Open Collective, as it does not have a business model like other tools. James Long considers Prettier a 'completed' project for his JavaScript needs, although discussions around formatting decisions and community contributions continue. Some companies have experienced performance issues with Prettier on large codebases, prompting interest in Rust rewrites.
James Long supports the idea of rewriting tools in Rust, as it can optimize performance by reworking algorithms and reducing parsing steps. The process involves converting code into an abstract syntax tree and then creating an intermediate representation to format it. Handling comments within the formatting process is particularly complex, as they are not part of the AST.
Josh Goldberg, the host of the episode, is an independent open source developer and author of 'Learning TypeScript'. He is recognized as a Microsoft MVP for developer technologies. His expertise in TypeScript adds valuable insight into the discussions on JavaScript tooling and Prettier's relevance in modern development workflows.
Key Insights
- Prettier was launched in January 2018 to address the excessive time developers spend on code style debates. It provides a consistent code format through a deterministic approach, which normalizes automation in development.
- James Long, along with Christopher Chadeau, co-created Prettier to overcome the limitations of ESLint's rule-based system. The tool allows developers to write code in a less structured way and then format it cleanly with a single keystroke.
- Despite initial resistance from developers attached to their formatting styles, Prettier gained significant adoption due to the increasing complexity of JavaScript projects and effective marketing.
- Prettier has raised about $243,000 over nine years on Open Collective, as it does not have a business model. Discussions around formatting decisions and community contributions continue, with some companies exploring Rust rewrites for better performance.