In short
Software Engineering Daily Podcast - Episode Summary
Episode Title
Prettier and Opinionated Code Formatting with James Long
Episode Description In this episode, James Long, creator of Prettier, discusses the significance of developer tooling in software development, particularly focusing on code formatting. The conversation highlights the emotional aspect of code style debates and the technicalities involved in creating and maintaining tools like Prettier in the evolving JavaScript ecosystem.
---
Key Themes and Discussions
- The Importance of Developer Tooling
- Developer tooling significantly influences the way software is written.
- Successful tools tend to fade into the background after achieving widespread adoption.
- The Emergence of Prettier
- Prettier was created to address the time wasted in code style debates among engineers.
- It provides a deterministic and opinionated code formatter, aimed at normalizing automation in development.
- Emotional Stakes in Code Formatting
- Formatting debates often stem from personal preferences and emotional attachments to style.
- Long emphasizes the need to move past these debates to improve productivity.
- Technical Challenges in Formatter Development
- Building formatters like Prettier involves overcoming various technical challenges, including handling comments and maintaining performance.
- The need for performance optimization is crucial, especially as the complexity of JavaScript increases.
- Open Source and Maintenance
- Discusses the realities of maintaining popular open-source tools and the financial challenges associated with them.
- Long reflects on the community's role in supporting and sustaining projects like Prettier.
- The Evolution of JavaScript Tooling
- The conversation explores how the JavaScript ecosystem has changed over the years, making development more efficient.
- Current tools (like Vite and Bun) are highlighted for their user-friendly experiences.
- Future Directions and Pain Points
- The episode touches on potential future pain points for web tooling, including server-side rendering and hydration issues.
- Long expresses a desire for better backend environments and improved communication between client and server.
---
Key Takeaways
- Prettier's Role: It automates formatting to eliminate nitpicking and enhance focus on building software.
- Community Impact: The success of Prettier is largely due to community adoption and the willingness to embrace change.
- Performance Matters: Efficient tooling must balance feature richness with performance to enhance user experience.
- Evolving Ecosystem: Developers should remain adaptable to new tools and methodologies as the ecosystem matures.
---
Conclusion This episode provides valuable insights into the world of developer tooling, particularly through the lens of Prettier’s journey and its impact on coding practices. James Long's experiences highlight both the emotional and technical complexities that come with creating and maintaining widely used open-source tools.
For further engagement, listeners can find James Long online at [jlongster.com](http://jlongster.com) and on Twitter/X at @jlongster.
---
Links
- [Episode Page](https://softwareengineeringdaily.com/2026/03/19/prettier-and-opinionated-code-formatting-with-james-long/)
- [Software Engineering Daily](https://softwareengineeringdaily.com)
Written by AI. May contain mistakes. Listen to the episode to check what was said.
Chapters
Tap a time to open that second in VOJames Long's Coding Journey
1:10 to 2:10
James shares his background in coding and early experiences.
“an independent full-time open-source developer.”
Transition to Web Development
2:10 to 4:50
James discusses his shift from game development to web development.
“But before we dive into Prettier and formatting and all these fun JavaScript and TypeScript dev tools, can you tell us who are you and how did you get into coding?”
The Birth of Prettier
4:50 to 6:13
James explains the origins and purpose behind Prettier.
“There's something fun about web development, how you can kind of just get a page locally, throw some JavaScript, some CSS on there and instantly see the changes as you edit them, right?”
The Role of Prettier in Development
6:13 to 7:38
Discussion of how Prettier helps eliminate formatting debates in teams.
“And the reason why you need this is just, well, the original reason was mainly to just get rid of these kind of like fights and little nits between teams, right?”
Prettier vs Linting Tools
7:38 to 11:28
Comparison between Prettier and ESLint, addressing common objections.
“Yes, I think at the end of 2017 was when it started.”
The Timing of Prettier's Success
11:28 to 14:02
James reflects on the timing and factors behind Prettier's adoption in the community.
“they would try it out and kind of see that.”
Challenges in JavaScript Formatting
14:02 to 15:27
Explore the limitations of existing JavaScript formatters and the need for improvement.
“And it just didn't work because it just failed way too quickly on all kinds of real world patterns that looked too ugly.”
Early Reactions to Prettier
16:53 to 19:32
Discuss the mixed reactions and initial adoption experience of Prettier.
“Christopher Chadeau, who is helping out, you're rolling things out to the community.”
Financial Concerns in Open Source
19:32 to 21:44
Examine the financial challenges faced by the Prettier project and its maintainers.
“It is something for sure that I have seen discussed.”
The Dynamics of Open Source Maintenance
21:44 to 24:47
Analyze the differences between the initial creation and ongoing maintenance of open source projects.
“For a tool that's existed for about a decade, looking on opencollective.com slash Prettier, the total raised money across those nine plus years is just about$243 ,000.”
Show all 24 chapters
Future Aspirations for Prettier
24:47 to 27:56
Speculate on potential future developments and enhancements for Prettier.
“So there's probably a very small amount of people who actually find the actual real boring parts, like, you know, going and just like really digging into those obscure bugs.”
Using Prettier with Markdown
28:00 to 28:40
Learn about unique ways to utilize Prettier for code blocks within Markdown.
“You don't get that in corporate life as much, but two, you don't use prettier on markdown.”
User Pain Points in Code Formatting
28:40 to 29:50
Explore user pain points when updating tools like Prettier in large codebases.
“Obsidian as I'm writing code in the code block, and it could be like a hundred lines.”
Rewriting Tools in Rust
29:50 to 30:40
Discuss the feasibility and implications of rewriting tools like Prettier in Rust.
“And if they, let's say, update a dependency like Prettier, then they need to run on all thousands upon thousands of files, and then they get into performance issues.”
JavaScript Tooling Criticism
30:40 to 34:00
Unpack criticisms of JavaScript tooling and how recent advancements have improved the ecosystem.
“I think it does solve a pain point for sure.”
Current State of Web Tooling
34:00 to 35:10
Evaluate the current state of web tooling and potential future directions.
“A lot of my thought goes more on the web itself and like the runtime of the web.”
Exploring Next-Generation Frameworks
35:10 to 36:30
Examine newer frameworks like SolidJS and Remix in the context of web development.
“to kind of be able to control those environments more.”
Performance of ESLint and Prettier Integration
36:30 to 38:10
Understand the performance drawbacks of integrating ESLint with Prettier.
“And then they generate JavaScript out of that.”
Tools That Leverage ASTs
38:10 to 39:30
Learn how tools that utilize ASTs can improve performance and user experience.
“Because you can take these different tools and like put them together in different ways.”
Understanding File Parsing and ASTs
39:30 to 42:00
Get a clear introduction to file parsing and the role of ASTs in code tools.
“from some front-end job or like a javascript thing to rust and they use like web assembly and they say it's like 10 times faster.”
Understanding Prettier and ASTs
42:00 to 43:38
Learn how Prettier processes code using abstract syntax trees and its unique compilation method.
“But it brings up another question of, okay, so Prettier as an example of a tool that works with abstract syntax trees and parsing, takes in your text, your string, turns it into an AST, then what?”
Challenges in Compiler Design
43:38 to 46:11
Explore the complexities of compiler design, including performance and error handling.
“So you can be really naive and write actually pretty simple compilers.”
The Role of Comments in Code Formatting
46:11 to 47:01
Discover the difficulties in maintaining comments during code formatting with Prettier.
“Like comments are not an AST node either.”
Exploring Music Theory and Harmony
47:01 to 49:54
Delve into the basics of music theory, including harmonics and dissonance.
“So this is something that I've been recently getting into is music theory.”
Transcript
Automatic transcript. May contain errors.0:00Developer tooling shapes how software gets written day to day, but the best tools often disappear into the background once they succeed. Formatting, linting, and build systems can either create friction and endless debate, or quietly remove entire classes of problems from a team's workflow. Over the past decade, the JavaScript ecosystem has wrestled with both extremes, as it scaled rapidly and accumulated complexity. Prettier emerged as a response to the surprisingly human problem of engineers spending too much time debating code style instead of building software. It offers a deterministic, opinionated formatter that helped normalize automation as part of everyday development.
0:42James Long is a design and product engineer who has worked at Mozilla and Stripe, and he's the creator of Prettier. He joins the show with Josh Goldberg to talk about the origins of Prettier, why formatting debates are so emotionally charged, the technical challenges of building formatters, the realities of maintaining popular open-source tools, and how the JavaScript tooling ecosystem continues to evolve. This episode is hosted by Josh Goldberg, an independent full-time open-source developer. Josh works on projects in the TypeScript ecosystem, most notably TypeScript ESLint, a powerful static analysis tool set for JavaScript and TypeScript.
1:23He is also the author of the O 'Reilly Learning TypeScript book, a Microsoft MVP for developer technologies, and a co-founder of SquiggleConf, a conference for excellent web developer tooling. Find Josh on Blue Sky, Fostadon, and.com as Joshua K. Goldberg.
1:52with me today is james long a design and product engineer who has worked at companies such as mozilla and stripe created prettier and created an open source the actual finance app james welcome to software engineering daily thank you josh very happy to be here so excited to talk to you as a user of Prettier and advocate for this is a dream come true. But before we dive into Prettier and formatting and all these fun JavaScript and TypeScript dev tools, can you tell us who are you and how did you get into coding? Sure. So I'm James. I've been coding really since I've been in the industry for over two decades.
2:23But you know, I was kind of the typical cliche, like 90s kid that was hacking on computers, just kind of always we happen to have, I think it was an Apple II in our house when I was like in middle school. And I just kind of instantly gravitated towards that just kind of like a lot of nerdy kids did in that age right and i remember programming in was it q basic there was the one that was just like you had like the 10 20 30 40 with the line numbers for some reason it wasn't one two three four i'm pretty sure and i think the thing that really drew me to it also is that i could draw things to the screen so i remember like drawing lines and it was just like that green kind of terminal look was the only color that it had but you could like draw lines and draw shapes and it was really cool is you could actually play notes too like it had it had a command like play a flat so you could draw little lines and have these things animated and like it would play music and so it just like instantly drew me to it and then later in high school 3d games was like something that just like really attracted me to it just blew my mind that you could do that with a computer and you know it took me a couple years to figure out how that even worked but i bought some books around like the direct 3d programming and things like that so i studied it in college and then i got a job and just has always just it's just always kind of been that thing that has satisfied a creative itch for me.
3:33We're going to talk more about that creative itch as we continue. How did you get from sort of 3D programming and notes and such into working on web development or even web development tooling? So it was easier to get a job for sure. I went to a small school in Chattanooga, Tennessee. And so there was like a local web development shop and there weren't any game development shops around that. It was also I felt like even though I had tinkered around with game dev programming. It's just like a harder industry to get into. That was most people were using like C or C++ back then. And I wasn't as strong in that.
4:05So the web was a little bit more, it was just more accessible. And the web was interesting too, because it was also a visual thing. So it was a good blend of practicality. But like the front end part of it was still satisfied that creative itch a little bit where I could still do visual things, still work with designers and still come up with like visual things. But the games industry is like such a different industry. And the first couple of years I was doing the web stuff with my eye on game development. But the more I was able to like get in touch with people and learn about that industry, it just became clear that it was just such a grueling industry, super low level, super low pay, like just seemed very grueling and just not really fun.
4:42So I kind of knew that it would become kind of just like a, the game stuff would be just kind of a side project to me and the pay would be coming from like web development stuff. There's something fun about web development, how you can kind of just get a page locally, throw some JavaScript, some CSS on there and instantly see the changes as you edit them, right? Yeah. And also just the ability to just share it with a friend instantly because the game development stuff, a lot of the studios and the engines have, were getting really good to where you could have hot reloading and do a lot of like visual stuff.
5:10You could be in something where you could select elements and like move them around and then like patch like script elements to them, but you can't share it. Like Of course, eventually once WebGL and all that got good enough, then you kind of can do that too. But yes, the web had a very instant gratification for creativity. Let's talk about the web. You have been working in web dev tooling for a while. The most notable project folks associate you with is Prettier. First of all, what on earth is Prettier? Why do we need something like this? Prettier is a JavaScript formatter. It takes your code and then you give it basically one parameter.
5:44It's got a couple other options, but mostly the philosophy of it was like to be very opinionated, to not take options. You just give it one parameter, which is the print width. So you say, I want there to be 80 characters or 100 characters. I want all of my code to fit within this size. And then it formats it based off of that size. And it's a deterministic formatter. So whatever the input is, no matter how many spaces, new lines, however, whoever was super opinionated about how they wrote the code, you'll get the exact same format out. And the reason why you need this is just, well, the original reason was mainly to just get rid of these kind of like fights and little nits between teams, right?
6:21Or like even specific team members that were really opinionated about it. And it just would, I hated the PR review. So I was working back at Mozilla before I created Prettier and I just felt like such a waste of time to be having these PR reviews go back and forth about formatting nits. And it was like a weirdly emotional thing that just to me just did not matter at all. Like it means zero difference on the users that you were using. So it was like this thing that tended to fall into some of our like OCD or perfectionism traits that like maybe a lot of people just couldn't help but care about the formatting.
6:54And this is a tool that is automating away this so that you can kind of like relieve that care about it and have a perfectly consistent code base across all of your teams. And it's just something that you can accept. Now, that's the thing that was surprising to me is that we very quickly saw how it relieved some of the pain and annoyance of actually writing code. So now when you have this format or embedded into your editor as your writing code, you can write code like in a very stupid way. You can write it all on one line and then just press one keystroke and it just formats it in the production ready format that you could commit.
7:28And that was a surprisingly effective thing that actually I actually was not building it for and actually was like something that was unexpected. Well, Prettier came around in around 2017, right? Yes, I think at the end of 2017 was when it started. It actually launched January 2018, if I am remembering that right. Well, at that time, we already had tools like ESLint and TSLint, now just ESLint and TypeScript ESLint that can format code. And there are stylistic and formatting rules in linters like ESLint. Why would I want something like Prettier, a second additional tool when I can just use ESLint?
8:02I think there's two reasons. One is that, so we did that at Mozilla. We use eslint. And I think it would try to automatically fix your code based off of those things. However, if you looked at our eslint config, I swear it was like it was like 100 rules. And these weren't even including the actual semantic rules. These were just the formatting rules. And so like it didn't solve the team dynamics of the you wanted to have control over the formatting. I forget exactly why we would still have the problem of PR nits. And actually, I think that leads me to my second point. I do remember why it was because there was those even though you could even though ESLint had multiple, multiple, I think over a hundred, I don't know exactly how many rules based off of the formatting.
8:45It still didn't cover everything, right? So there's, there's our things about how you, in JavaScript that are very dynamic or that are very hard to express as a Lint rule, such as if you call a function, give it three or four arguments. And then the last argument is a function. You know how JavaScript, we tend to do the first three arguments that are numbers all on the same line as the call to the function. But then the anonymous inline function that we're passing to it, we will break that on the opening bracket and then write that inline indented, right? And you just can't express that with ESLint's rule-based system.
9:19You need a much more expressive dynamic, like a holistic formatter that can reason about where that function is, is what's the parent of that function. And so I think those are the two things. Like one is that it allowed different people in different teams to have too much control over the formatting, because they could like customize all of these hundreds of rules and it just didn't cover enough. I remember trying to roll out prettier on a team back when I was at Microsoft and an actual common piece of pushback we got was, I like the idea of faster code authoring. However, I put so much intent and meaning behind the formatting choices, such as when you have a class or enum with many properties, putting the equals all aligned.
9:59I don't like how prettier removes my build to do that. What would you say to someone giving you that pushback when you're trying to advocate for Prettier? At this point right now, I don't really hear that much anymore. I think that argument has kind of been proven false to where most people use it now and the benefits of it are worth it. And I think that was like an attachment to the code that you wrote that that argument just wasn't correct, right? Like there was not meaning there. Like once you kind of start using it, you see that you're still able to understand the code just as much. It was harder to make the argument in 2018, 2019 when people were pushing back this a little bit more at the beginning.
10:34And I think what we would try to tell people is kind of what I just said, but in a more gentle way, like, it's like, hey, you should just try this. You should give it five minutes. You should give it a little bit of time. See if there actually is meaning in that. You will find that in a lot of places that you thought there was meaning that you can actually just understand the code relatively the same. If there is something that's like an embedded, like matrix that you really do want aligned really well, then we have the ability to ignore, like you can say prettier ignore in a comment above that expression and prettier will not format it so there are rare cases where you can care about it but like to say that you need to care about 100 or even like even you need to care about you know 20 to 30 of your code that the formatting matters that much i think is just like not an argument that we were ever convinced by and we would just try to tell people that and if they didn't agree then they didn't have to use prettier but i think eventually they saw like the social proof as more and more people started using it and they would try it out and kind of see that.
11:31I think you might need to care about like 1%, 0.1 % of your code. Like there's few places that you really are having something really specifically formatted, but that's what we would try to say. It's interesting also that this came out relatively recently in the JavaScript lifetime. You know, this was not a thing in the 90s, not a thing in the early 2000s, and it took until closer to 2020 than 2010. What do you think took so long for the community to create and then adopt something like Pridio? So this is a good time to also talk about Christopher Chateau, who I actually consider a co-creator of Prettier.
12:02I think like he and I both individually say that we created Prettier and I have no problem with that. I technically created like the first implementation. He came in very quickly and I think we can talk more about the history of this later. But I say this because he has a great post on his blog that I think is called the Birth of Prettier. And I forget his exact blog. I think hopefully we can link to it. Or if you just search Chris Fruchido, birth of prettier than that post will come up. He has a good explanation about like, there were several formatters that were attempted. And also ESLint, I think was like probably a lot of people use ESLint with the formatting rules.
12:39And a lot of people just thought that was good enough. So that was one thing that people just didn't really see why you needed a holistic formatter, like a whole different tool. A lot of people didn't see that. There were some other efforts that tried it. And I think the thing that they got wrong is that they would try to follow the philosophy of some other formatters like GoFormat. And the difference between GoFormat and Prettier is that GoFormat is, it's very, I'm trying to think about the right word. It's even more opinionated than Prettier basically. Like it doesn't support some of the sophisticated breaking patterns that Prettier does.
13:13So it's like, it will always format like a struct or things, and it will always break it across the line. It doesn't have a concept of like a print width, right? And the thing about the print width that was interesting about Prettier is that it sounds like, like, why wouldn't you just hard code like a print width or something like that? But it's interesting about this because with Prettier, you need the ability to, in JavaScript specifically, compared to Go, because you do a lot of nesting of inline JavaScript functions, and there's all these just really weird patterns, you cannot have a deterministic, or not a deterministic, you can't have like a simplistic approach to formatting kind of like the go format does which is like hey if you have a struct we're going to spread it across all of the lines because what if you pass like in javascript if you have like the inline function case well sometimes we format it differently if it's at the top level or if you pass it as an argument to a function in go format it just didn't support that kind of thing at all like it would whether it was a function argument or top level it was broken up the exact same and i think some of the other javascript formatters had taken that kind of approach.
14:16And it just didn't work because it just failed way too quickly on all kinds of real world patterns that looked too ugly. And so for this project to succeed, it needed to pass, even though I say I don't care about the formatting, we all do care a little bit, right? Like it can't look horrendous. And so it needed to meet a bar that I don't think other formatters had quite hit yet. And so I think it just happened to be kind of the right timing where people were kind of geared up for this, but they hadn't quite experienced the tool that did it well enough yet. And I did for whatever reason. I don't know if I like got lucky or I think I'm decent at marketing too.
14:52I might've just gotten lucky with my marketing. And it just part of these kinds of things are always luck, right? That like, I just might've happened to be at the right time at the right place. And I remember specifically my tweet that went viral that kind of kicked everything off. And sometimes you just kind of get lucky like that. When you think about it too, at the time, that was right about when promises were getting ratified, async await was getting ratified, rolling out to browsers, the JavaScript of 2015, 16, 17 had a lot more callback hells and pyramids of doom than the code we write today, and especially compared to other languages.
15:22That's a great point, actually. That is very much true. Today's episode of Software Engineering Daily is brought to you by Unblocked. Your coding agents have access to your code base. Maybe you've even connected other tools via MCPs. But access doesn't mean context. Agents can't reason across MCPs. They don't know your architectural decisions, your team's patterns, or why the API was shaped the way it is. So agents look in the wrong place and deliver bad outputs. Then you spend time correcting, turn after turn. Unblocked is the context layer your agents are missing. It synthesizes your PRs, docs, slack, and tickets into organizational context that agents actually understand.
16:03So they make better plans, write higher quality code, use fewer tokens, and require fewer correction loops. If you are running Claude Code, Cursor, or any agentic workflow, Unblocked is worth a look. Get a free 3-week trial at getunblocked.com.se daily. In mobile application security, good enough is a risk. GuardSquare uses advanced, multi-layered code hardening techniques and automated runtime application self-protection and mobile application security testing, combined with real-time threat monitoring to deliver the highest level of mobile app security. Discover how GuardSquare brings all these together to provide mobile app security for your Android and iOS apps without compromise at www.guardsquare.com.
16:52All right, so you've got Prettier. Christopher Chadeau, who is helping out, you're rolling things out to the community. What was the initial reaction to Prettier like? It was a mixed reaction for sure. I mean, there was a certain amount of virality to it to where I was surprised for sure at how quickly a percentage of the JavaScript user base adopted it like relatively quickly. Like it seemed like there was a decent amount of people that just kind of use it for a couple minutes and then totally got it and got prettier pilled, I guess, for the lack of a better word. But there was a decent amount of like pushback for sure.
17:25But like, this is the kind of thing that's like, we're not trying to sell something here. There's no money made. And I think that is kind of another interesting conversation, especially in the context of recent tailwind drama. Well, no, it's not really drama, but you know, the news about open source funding and things like that. But at the time, it's like, it was in our interest to sell people just because we thought it was better. But it's like, if you don't like this, then you don't have to use it. So we were happy with whoever wanted to come on board. And a lot of people did. And it was enough to kind of start the momentum of it growing pretty quickly.
17:54And so I think also, I think probably the hardest thing is that there was a lot of opinions that needed to be worked through of what the formatting should be. So I think that's kind of the most interesting thing to talk about in terms of the reaction, which is just like the pages and pages of GitHub issues about people being like, I don't like how it formats this or like, we haven't quite solved how it formats like comments when you have like an inline comment and like a turn areas. And then there's like a long or like turn areas specifically with something that took years. Like there was different formats that were tried that were switched back and forth.
18:27And so there's a lot of opinion. There's again, people do care about formatting. And so there's a lot of responses and opinions to that kind of a thing. That is something that was difficult, especially for me around that time for that first year, because you can do this for months and months at a time. And it seems like those kind of discussions don't really ever stop. So it's like, it feels like you're just like pushing a boulder up the hill forever. But I'm very grateful to the maintainers who kept working through all of those issues and kind of helped just the whole Prettier community that kind of helped work through a lot of those issues.
19:00And eventually, you just have to make a decision, right? Eventually, it's like, this is the issue. We're going to decide this formatting for this issue. We're going to close the issue. And we just got to move on because you can't just keep talking. So one must imagine the prettier maintainers happy. It is interesting, though, that open source, especially in the tooling space, is so notorious for burning people out and then money being difficult. I think the drama you're alluding to is that the Tailwind company over the last few years has had to lay off quite a few employees with the rise of AI and difficulty in showing off or selling their paid products now.
19:31Does the Prettier project have financial concerns? Is that something that's come up? It is something for sure that I have seen discussed. I'm to be totally honest, I'm not the best person to talk about this. I have not been really involved in this project at all, even for even for a couple years. I wasn't very involved for like the first nine months in 2017. Around that time, I was also trying to build my I left Mozilla and was trying to do self employed stuff. I did contracting, I was trying to build a product to see if I could scale up that product to see if that could cover enough of my expenses just to be kind of like a lifestyle business.
20:05So I had a lot of other things going on that was really hard to do kind of this like free open source work. And so I kind of scaled back a little bit and was, you know, involved in decisions for, for a while. But especially in the last couple of years, like I haven't really been super involved. So it's definitely like, yeah, I've seen, this is what Christopher should do. I think he deserves a ton of credit and totally deserve, I think for the entire sum of the life of Prettier, Christopher has put in way more work than I have. So I think like he, he deserves not only like, he definitely was like a co-creator, plus he kind of stuck around to help structure some of these how this money comes in and how it like it's dispersed to the maintainers so i know they have a structure there i know there's a decent monthly payment that goes towards the contributors but as far as i know like nobody's full-time working on prettier which is what is different from tailwind which they officially kind of formed a business around tailwind so prettier like there's no business as far as i know there's no business of prettier there's no one or two people who's who's trying to make this work and actually make this like a full-time thing.
21:05It's just kind of more of the typical open source thing where there's a couple of people doing it part-time and they should absolutely be compensated for that. And there is some compensation there. It's not enough. I think for like for open source stuff, they thrive on sponsors and like donations. And so that's never enough. I think that the amount of work that the maintainers do, they probably deserve more money. But it's not the kind of thing that there's not a business about to falter because there's not money coming I mean, it's just, hey, if Prettier doesn't get enough donations, then there might be a year or two where there's just not a ton of work done on it.
21:36And that kind of is what it is. But I can't tell you like currently exactly kind of like how bad things are. You know, I think it's I think as far as I know, it's OK. I think there should be more money coming in, basically, is always the case. For a tool that's existed for about a decade, looking on opencollective.com slash Prettier, the total raised money across those nine plus years is just about$243 ,000. dollars. Yeah, that is crazy. Consider the average dev salary in America today. Yeah, it's not enough. It's not enough. My wife, actually, it's funny, because when I started prettier, and I, you know, was investing a lot of time into it for those in 2018.
22:14My wife is like, okay, so like, I mean, you're gonna make money somehow, right? Like, how is this gonna make money? Like, why aren't you making money right now? Because you're putting all this time to it. And I was like, you don't understand. It's open source. It's awesome. Like, we're just working on stuff together. But the reality is yes like we spend time on things and we care about things but at a certain point it needs to translate into a reality where it becomes something that people are putting their weekly hours into something that's just maintaining and it's not like a joyful fun thing that they're just doing to be creative anymore it's an actual job and so yes it's a hard thing to figure out you touched on a really interesting point that i want to drill into before moving on to kind of higher level tooling discussions there is a big difference as you just alluded to between the initial explorations, the, so to speak, fun, exploratory parts of open source and product creation, and then the perhaps less fun for some and more for others maintenance phase of it.
23:02And you see often in these open source projects where you have a certain set of people join at the beginning or create the thing. And then over time, they transition to a different group of people, partially folks who are more excited about maintenance. What do you think is so different about the two forms, the difference between creating or exploratory phases versus maintaining or contributing phases? They're very different and they are still kind of, I think can be mixed together because I think like, I guess, for example, one thing that comes to mind is now, and this is something we could talk about more too.
23:33There is like the Rust rewrites of Prettier, which is like aux format. And that's a creative place to be, right? So there can be like a mixture. Like if you look at a whole timeline of a project, it's not just at the very beginning is this creative fun part. And then it's just like, it tails off into just this totally boring maintenance thing for 10 years, usually it's like, there's a, there's like a really bump of like the fun part of like, this is like a cool idea. And then it kind of goes down into maintenance, but then it's like, Hey, we should do like a plugin system. And then like, that becomes kind of a fun, creative thing where it's like, you are kind of doing something new again.
24:04And so that that's, that's kind of another bump. So it's kind of like, like a mixture of things, but I do think there's people who seek out and love to work on ambiguous ideas or kind of just see kind of things in the ether and really enjoy bringing those into reality. And there are certain people that find that really hard and just like, it's just not something that gives them the right kind of energy. And they really do enjoy taking something that's existing and just making it one step better and doing that week by week. And by the end of the year, you've made something way better than it was at the beginning of the year.
24:37I think there's, I don't know if it's different personalities or it's just, I think there's different sources of like energy there. Now, I do say that I think everybody would enjoy to do what they consider the fun work more, right? So there's probably a very small amount of people who actually find the actual real boring parts, like, you know, going and just like really digging into those obscure bugs. But there's even people that do find that fun. So I think it's best for a project to kind of have complimentary people who, you know, some people find the things fun. How do you design this API?
Read the full transcript
25:05And how do you like create this new thing? And how do you bring that into the world? And how do you execute it? plus the people who really care about the currency, the things, improving it day to day, talking to users and like fixing bugs. So it's, it's just a, I found that there's always people, once you create something that's exciting, there's always kind of these couple of people that come in. This happened with actual, my personal finance app, I open source it. And now there's this one guy who spends a ton of time maintaining it and he's not getting much money from it. I think there is like a similar level of contributions, but he just seems to really love maintaining this project and like loves watching users come in and download the product and help them getting it running and it solves part of their daily life.
25:43So I think people get different sources of joy, I guess, you know, and so it's, it's really interesting to kind of see this in action. Let's say that you had infinite time and infinite money. And the only stipulation was that you had to spend that time working on something for prettier. What would you work on? That is a great question. Because I think what's interesting about Prettier is that unlike projects, I guess Tailwind comes to mind just because of recent events, Tailwind must evolve with the browser and the browser and CSS is always evolving, right? There's always new features added to it.
26:18Prettier feels like a project more to me that has a better chance of being kind of completed in a way. I mean, there's new JavaScript syntax, but it's relatively rare to get a new JavaScript syntax that is a fundamental new syntax that you need to rethink large parts of the system. If I had to do anything, if I had infinite time and money, I think it's an interesting question because Prettier is a thing that I use every single day. And it covers all the things that I use in JavaScript. So to me, it kind of is completed. To be totally honest, I don't know because I understand the Rust rewrites.
26:55I understand people run Prettier on their entire code base and they want that to be fast. I don't really even resonate with that performance need. Like you're rewriting an entire project in Rust. I respect it. I think you should do it. I think aux format is a great tool if people want to spend their time on it. But I run Prettier in my buffer, in my Emacs buffer. it always runs fast enough and it just feels like a completed project from my perspective and i'm sure there's all sorts of use so i don't really use it to format markdown or format all these other things so i'm also not exposing myself to this entire like world of plugins so i i embedded prettier into obsidian so as i'm working in a code block i can run a keystroke and it runs prettier on just that code block like i never want to run it on the rest of the markdown file, it just run it onto that code block.
27:46And so I don't know if I have anything. I'm sorry to disappoint you. To me, like it's perfect. To me, it's like completed and I'll happily switch to aux format if it works just as well. And it's like a tiny bit faster. That's interesting on two points. One, you have to love open source maintainers saying that the thing is done. You don't get that in corporate life as much, but two, you don't use prettier on markdown. I would have thought for the same reasons it's useful in JavaScript, you know, consistency, ease of writing code, not having to manually format. Is that not a thing for you? I use prettier in kind of a weird way in Markdown.
28:20I personally don't find it as useful to format my Markdown code or my Markdown narrative content. Like that is the content that I am writing paragraphs on. I'm typing out paragraphs. I do a little bit of Markdown syntax and it's just not, there's not nearly as much structure there as code. Now for the code blocks though, I run prettier on the code blocks, but the way I do it is in Obsidian as I'm writing code in the code block, and it could be like a hundred lines. I have a keystroke that runs prettier on just that code block, right? Like I do run prettier on the code in my Markdown files, but I don't run it on the entire Markdown file.
29:00Like I don't just reformat the entire Markdown file every time. As I'm writing code in Markdown, I reformat the code block that I'm working on because that's the only thing I'm interested in. And maybe I don't hit these perf problems because like I do write massive posts. I want to be able to write 20 page posts and the formatting of my code block is because it's all always only applied to the code. It's always instant. It's always like super fast. Like I'm not needing to reformat the entire markdown file every time, if that makes sense. So it's a little bit of a maybe esoteric setup. But that does make sense.
29:34When you talk to companies like VoidZero or organizations like Biome, oftentimes they describe the user need they're targeting is sort of one step higher or larger in scale than the common open source project, where a company might have thousands, tens of thousands more files. And if they, let's say, update a dependency like Prettier, then they need to run on all thousands upon thousands of files, and then they get into performance issues. So what do you think of kind of that user pain or that solution of rewriting in Rust? Does that feel reasonable to you? I think it's totally reasonable. I think it's a question of resources and if there's the right number of people that are going to invest in this and it's not going to be a, you know, if it's managed well and resourced well, I think, you know, there is a couple of part-time maintainers of Prettier.
30:21Like if a user was going to come in and say, hey, you all need to rewrite this in Rust, It's like for the current state of things, it's better for the current maintainers to just work on the current JavaScript code base and make that better. But if there is a whole separate group of people working on like this aux format tools and biome and they have like funding to pay developers to work on this full time for like a year or two, I think it's amazing. I think it does solve a pain point for sure. So I'm fully supportive of those tools. Like I'm not, again, I'm also not like super involved in Pretoria right now.
30:52And also, this might not be surprising, but I don't have any super emotional investment in Pretty. If Pretty was to go away and say Aux format was to completely replace it, as long as it meets the similar needs and works like a similar way, and it formats the code in a similar fashion, then I'm all for it. And I fully support those tools. It's very pragmatic. I want to take a step back and kind of talk about JavaScript and web tooling as a whole. There's a criticism sometimes targeted towards the ecosystem that we have a million tools. It's hard to keep track of them. They all do different things.
31:23It's hard to set up. And on the one hand, Prettier has been stable for a very long time. Although we just discussed modern-ish, competitor-ish to Prettier, it's for the most part just what people use. That being said, there are a lot of tools that it has to integrate with. How do you feel or what is your reaction to people criticizing the fluid, ever-changing form of JavaScript dev tooling? Yeah, it's kind of a mixed bag because I think that there was a time, you know, I remember when we were tweaking our Webpack config. and just hyper-optimizing things and the ability to compose together kind of a unique system that only applies maybe if you're at a company.
31:59Stripe is a super complex company and so they use Webpack. They're moving to, I think they're moving to Vite now actually, but the ability to kind of compose your own system that meets your needs if your company is kind of like, has specific needs that something out of the box. I think there's a higher risk of something out of the box that doesn't, is supposed to do everything together when you can't use that because it works a certain way, right? So that there is a benefit for things being composable and you can kind of hack them together. I would say that those complaints though are well, like I think they are grounded in something real, like a real pain point.
32:36We've also seen tools like Bun, right? Which just, they literally just work. You don't have to do anything. I never run, when I was using Node, you'd run into all these kinds of issues where an import was trying to import a file with like a wrong file extension. I just don't hit those things in button. And there is a significant user experience improvement with tools that do just work where you don't have to kind of like duct tape things together. And I also think like Vite, I think is another great example of this. And I think Vite is just a really great tool because it does allow you to configure things to a certain level.
33:09And that's why a company like Stripe is actually able to adopt Vite. However, Vite has that sort of out of box feeling, right? You can take Vite. It doesn't take hardly anything to configure it. You can get an index.html file that loads a JavaScript file and it renders something to the page very, very easily. We've grown a lot. I think those complaints were valid five years ago. I think since then, the state of the tooling right now is much better. So I think that those complaints are either out of date and they just haven't used some of these newer tools. But I think we've certainly grown a lot out of that kind of pain.
33:39And I don't think there's as much pain anymore as there used to be. It's funny. People still complain about how CSS, the joke is, it's difficult to center. and that's been a part of Flex for over a decade now. What do you see as kind of the next big pain point to be solved for web tooling then? I have to be honest that I'm really happy with tooling right now. A lot of my thought goes more on the web itself and like the runtime of the web. So I don't have a great, I hope to not disappoint you again. I don't have a great answer. I think Bunn is amazing. I think Bunn has solved the backend environment and the ability to run scripts very well.
34:18I think Vite has solved the bundling problem very, very well. I am not a huge fan of React server components. I'm just going to say that right now. So I don't, like, I think that the Next.js and that world, I am of a lot of hesitation around that kind of stuff. I think that has introduced a lot of pain points which you require tooling to kind of see what's going on in those things. But I think that the solution is not better tooling for those things. I just don't agree with that fundamental approach, generally speaking. which is maybe a different topic. But I think I'm thinking more along those lines, which is like, is React server components really the right thing here?
34:54How can the client and the server communicate better? What are better strategies? Like what is Remix doing? Those are kind of where most of my thoughts are right now. And I think we need better ways to do server-side rendering with hydration. And I think we should be exploring more things with that, which will probably require specific types of tooling to kind of be able to control those environments more. Is there a stack out there that you think is closest to your target end state for this type of area? So I've been thinking about this. So I left Stripe back in October. So I've had a couple months to sort of reevaluate things at Stripe.
35:27I just didn't really have that much time. I'm still evaluating my opinions. I have been looking at SolidJS a lot for the front end part. I really do like what they're doing in SolidJS a lot. I looked at Astro, which was interesting. I wasn't a huge fan of some of the way that they do. like the syntax and how you actually have the astro files but like the actual islands concept and things like that was pretty compelling i think remix 3 i'm decent friends with like michael and ryan the creators of remix and this this new version that's going to be coming out soon that potentially might match some of my more recent thoughts the most because i think there's some solid starter kits which do some sort of server-side rendering with stuff i'm not super familiar with that, but I would probably say Remix 3 is a very interesting take on this and probably is something that I'm going to keep a close eye on like the most.
36:20Well, we'll have to look forward to having those folks on the show at some point. Is there anything else before we start talking about wrap-up topics that you want to bring up about Prettier tooling around it and so on? One thing that might be more maybe to go dig into it a little bit more technically is, and maybe to go back to your question about what I would work on in Prettier is the reason why duct taping these types of tools together gets really slow is because they have to parse the JavaScript into whatever they're doing. And then they generate JavaScript out of that. And every single tool in that step does that.
36:57And that's why I never, to be totally honest, I never liked the ESLint Prettier plugin stuff because it's so slow. And And like, basically, if you use that setup, right, and you that is the setup that you use to format your file, that is so much slower than just invoking prettier directly. Don't do that. If you're going to format your files, just call prettier. Don't call ESLint and tell it to call prettier because there is a significant overhead there. And maybe they've solved that. I'm not entirely sure, but I'm at one point, at least you solved it. We did not. We just told people to stop doing that.
37:31I'm so happy to hear you say this. There are so many reasons why you shouldn't be running Prettier and Eoslint, primarily what you just referred to of the performance of it directly. But also, we have a lot of slow rules now, rules that use type information or import analysis, cross-file info. And when you have autofixers from those rules and autofixers from Prettier rules, you end up running all of them all the time, constantly. Eoslint will rerun rules up to 10 times when there are fixes that conflict with each other. So you take sometimes multiple seconds after each save where it should have just taken maybe half a second, which is obscene as a user experience.
38:08Yes. And I think this is where going back to kind of the fragmentation of tooling also, which is like, it's powerful, right? Because you can take these different tools and like put them together in different ways. But there is a really compelling motivation for bundling things together into a single tool. And I honestly haven't looked super closely at what the Aux format and other, I think the interesting thing here, I think, is that it is a suite of tools. So, and this is what Biome, I think, was kind of trying to aim to be also. But the reason why this is so compelling, and actually, I should have talked about this when I talked about my support of these tools.
38:43What probably does excite me most about these tools is that it solves this core problem where they have a standard workflow to work with ASTs and they reduce the amount of time that they're parsing JavaScript and generating JavaScript. And now they can parse JavaScript once, work with the ASTs, get the formatter to format the AST and it stays in AST. And then they pass the AST to like a linter and then they can lint against the AST and it's a whole standardized tool chain. So it's not even just, I'm kind of guessing here. I'm not super close to how all of this is working. a lot of times a javascript to rust rewrite isn't faster because it's in rust i mean it probably is faster but a lot of times it's faster because you've had a chance to rework all the algorithms and how the entire thing works all together so the fact that they're able to do that and it probably is faster because it's rust but i think there are cases where there's been like a rewrite from some front-end job or like a javascript thing to rust and they use like web assembly and they say it's like 10 times faster.
39:40And then you go and look at it and it's just, they use a completely different algorithm, right? If they had rewritten it in JavaScript, it might've been just about the same. I don't think that's the case for these tooling, but I do think it's a fun, it's like an addition, not only will Rust be faster, it's an additional reason to also optimize all of this kind of tool chain stuff too. So I'm very excited about that. I think that was the core problem with Prettier and how it integrates with the rest of the ecosystem. That is exciting. I've got two more topics to bring up with you, a technical and a non-technical.
40:08For the technical topic, a lot of people might be listening to this and thinking, wow, this is really cool stuff, or wow, this is really useful stuff, ideally both. And they might want to get involved. I know a lot of developers get a little intimidated when you start throwing around terms like parsing and ASTs. Let's say you were talking to a relatively new developer who's not very confident in these areas. How would you explain what file parsing, ASTs, printing out, what that all means, and what it means for tools like Prettier and ESLint? I would explain it as if you have code in a file, it's a string.
40:40You need to be able to work with that. Like the code that you're writing is not English, right? At least now with AI, most of the time we are writing English. But if you're going to talk about just code, it is a structured formatted thing. We have a specific grammar that you are abiding by when you write code. You have like a function and you have the name of the function and you have the arguments and then you have a bracket. To work with that in the compiler or whatever is running your code or doing whatever, it needs to be able to work with that somehow, right? And so it's just a way of parsing that into a data structure.
41:14That's kind of all that a compiler is. And the ASC is a data structure and it just is a thing. It's a tree and it represents the different pieces of the code. And it just gives semantic meaning to what you visually see on the screen, which is like the code, which looks like it's a readable piece of thing. It's really a semantic tree of information. And so that's all that a parser is, is it takes that and creates that ASC, which is a tree of semantic information. And then the compiler can take that ASC because it has all the semantic information embedded into it. It can do interesting things to it.
41:47It can say, oh, this is a JavaScript function. And let me compile that out to a Go function. if you're working on like a JavaScript to go compilers or something like that. I think that would be the most basic explanation. Does that make sense? That does make sense. But it brings up another question of, okay, so Prettier as an example of a tool that works with abstract syntax trees and parsing, takes in your text, your string, turns it into an AST, then what? So Prettier is a unique one in that it generates another layer. So there's like an intermediate representation. so most compilers what they do is they take in an ast and then they will generate another ast and then they'll generate the code from that ast and that's this is a very simplistic way to put it but if you're like compiling c code to assembly you you you have one thing in which is the ast for the c code and then something out and there's there's different ways to do that out part so prettier is like another version of that out part.
42:45And the way that it does that out part is it converts the AST into its own intermediate representation grammar, which is another data structure. It's not an AST. I'm not going to go into why. It's more like a flat array of description, which is like little pieces of text with additional information about where to break the code. And so it has this like nested tree of arrays with the snippets of the text, plus these break information, which is like where we encode how to format the code. And then there's like one more pass, which takes that data structure and generates a string. And that's how it kind of works like the whole thing.
43:20So that's, that's all prettier is basically a compiler. It's a JavaScript to JavaScript compiler, right? And so you have source code to AST to the compiler to whatever intermediate output format is, and then something which generates the string from that intermediate output. And then you have the string in and string out. Leading question. That sounds real easy. Why is it not easy? Yeah, compilers are really hard. The biggest thing is just performance. So you can be really naive and write actually pretty simple compilers. You need a lot of caching to make things really performant. There are a lot, especially for JavaScript, it's a very complex language.
43:58And so an AST is a tree of nodes, but there could be a hundred different types of nodes, right? And so you need to, if we're talking about Prettier specifically, it needs to be able to know how to handle every single one of those nodes. And so there's like, could be one big compiler file that's thousands of lines long. That is a big switch statement that has like switch on the node type. You have to implement every single one of those nodes, right? And then on the output of it, you need to also kind of do like similar things also. And something else that comes to mind that a lot of people don't think of is error handling.
44:28So when something goes wrong, you need to know where you were in that original source string. so you can say oh i like failed on this like open curly bracket node or that's not actually a node like a like a switch statement node this is wrong right here and so i need to throw an error well you can't just tell the error hey this switch statement is is not correct you have to tell the error oh this switch statement is not correct here is the line of code that is not correct on and he let me display you the piece of code and point to exactly where it's wrong and that is really hard it's actually really easy you can sit down and write a compiler and i think there's like simple tiny compiler, like instructions of how to do that out there right now that you could probably do pretty easily.
45:06But how to trace the source information through that compiler is a really hard problem. And there's like whole areas of research about how to do that. So it's the kind of thing that to make this workable in reality, it has a lot of little practical problems that make it hard. I think this will be the last leading technical problem. What you just described sounds really cool, but also a fairly large amount of work. I'd rather do something more straightforward and simple like prettier printing out code is pretty easy right so here's a perfect example about why it's really hard actually is comments so yes you can take something and print it out easily but how do you handle comments so in specifically thing this is a unique thing about a formatter which is unlike a compiler which if you're combining c code to assembly you just get rid of all the comments and you just output the assembly code if for a formatter you have to maintain all of those comments.
45:58And what's weird about it is because you've changed the code, you got to like figure out where to put the comment. And that's a really weird problem because comments are not semantically meaningful, right? So I think that was the hardest thing in Prettier is how do we handle comments? Like comments are not an AST node either. When you parse something into an AST, it's not part of the AST. So we had to extend ASTs to have like a, I think this is how it worked. We could like tag AST nodes with like, this was the comment and this is where it was around this node. And then when that was formatted, we could decide where to put the comment in the output.
46:32But there's so many weird edge cases where you can't just put a comment here because we've changed it. So now that we've collapsed, we've collapsed it on one line. So we can't put the comment in there because the comment will comment out the entire rest of the line, right? So we have to like move the comment up. And it's a whole bucket of edge cases. It's hard. Lovely. All right. Last question for you. You have a fantastic personal site with a bunch of explorations. Can you tell us about things like the Circle of Fifths and Lydian scale? What is cool about sound and noise? Yeah. So this is something that I've been recently getting into is music theory.
47:07And I'm going to sound like a dork talking about this and also probably be very wrong because I'm very new to this. I think when I was learning piano years ago, it was like, to me, the simple conceptual way to think about it was that you just have to learn all of the keys. And as long as you play within those keys, then that's how you play music. What I've learned like two years ago, when I started picking this back up is like, that is just so completely wrong. There's these things called harmonics, which if you play a certain note, like a C, I'm not going to be able to say this right, but like G is harmonic with C, right?
47:40That's a fifth. And I do have like a little synthesizer on my site because I was exploring this, like what are the harmonics about this? And what's weird is that the circle of fifths are, I'm not going to be able to explain this well, but it's like frequencies that sound harmonic. But the way that the harmonics work with music theory is that if you keep walking up through the circle of fifths, you'll get into notes that sound harmonic, they're actually not in the same key. So in music, the thing that is fascinating to me about this, and it's not that it sounds perfectly in tune. But what's interesting is that like, it's a little bit dissonant, but it's like a good dissonance.
48:18It's a dissonance that gets you to expect something else in the next note. So if you play a, I was just learning about this. So there's seventh chords, right? Well, there's actually major seventh and minor seventh chords. So if you play C, a C seventh, right? That's C, E, G, and B. That is the C major seventh. but the C7, I think the default seventh is a minor seventh. So a C7 is actually a B flat. It actually is playing a C minor seventh, which is like the B flat is not in the key of C. And that is getting you to, it's a little bit dissonance, but it's like a beautiful dissonance. And it's getting you to expect it to resolve like either to a full C chord or, you know, something else.
48:59And so music is this like beautiful movement about like a little bit of dissonance and moving up and through the keys. And so it's something that's really fascinating to me. And I'm not explaining it well. But if anybody is here listening to this that is in music theory, you know exactly what I'm talking about. You're learning to play the piano again? I am learning. Yes. That's a beautiful instrument. Yes, the piano is great. So I tried to learn the guitar for about a year. And it just doesn't map to the way... Guitar is crazy hard. I don't know how people play guitar. On the piano, you can see the entire chord and everything laid out perfectly, right?
49:35With guitar, you have to learn patterns. And then the way that the strings relate to each other is really weird. And you're having to like do these weird shapes. Piano is way easier, like for me, for sure. Well, thank you for all this. This is great. I'm so excited to process everything you talked about, not just with musical theory, of course, but also Prettier and your thoughts and toolings. We talked about how Prettier came to be, some of the problems that it solves for users, some of the pushback that users previously gave tend to no longer. James, if people wanted to find you online and learn more about you or your work, where would you direct them to go?
50:07There's jlongster.com, which is my website, but then I'm also on Twitter slash x at jlongster. So that's kind of the name that I use everywhere. Well, for Software Engineering Daily, this has been James Long and Josh Goldberg. Thank you for listening, everyone. Cheers.
50:30Thank you.
From the publisher
Developer tooling shapes how software gets written day to day, but the best tools often disappear into the background once they succeed. Formatting, linting, and build systems can either create friction and endless debate, or quietly remove entire classes of problems from a team’s workflow. Over the past decade, the JavaScript ecosystem has wrestled with
The post Prettier and Opinionated Code Formatting with James Long appeared first on Software Engineering Daily.
