- Sentry is a $1 billion startup that makes open source error monitoring software.
- The developer team now has increased productivity and fewer bugs in production.
- See more stories on Insider’s business page.
The firm decided to embark on this massive undertaking because its engineers realized that, with JavaScipt, they were shipping software bugs that Typescript would have caught automatically.
While the effort to make the switch took Sentry far longer than expected — the engineers had an “overly ambitious” plan to complete it in about four months — it’s created a groundswell of benefits, including increased productivity, the company said.
Sentry decided that
In the fall of 2019, the company was shipping “more frontend bugs than what was acceptable,” many of which were so-called runtime errors, or bugs that occur while the software is executing.
Story and others realized that TypeScript’s features would have allowed it to detect these kinds of errors before the code went live on the website. He team estimated that it would take between five and eight engineers about four months to switch over to TypeScript. While some worried this would be an ineffective use of the engineers’ time, they realized that, in the long-run, it could help save the company time by avoiding mistakes.
“There was pushback initially from certain people around the cost and the complexity it introduces,” Story told Insider. “But those people didn’t have good solutions for preventing all the runtime bugs.”
So, in August 2019, the team made a plan to switch its codebase over by the end of the year, an aggressive timeline that would have required engineers to convert 74 files per week. They would quickly realize how unrealistic that initial timeline would become.
The reality was much more intense than expected
The team broke its switch strategy into three phases.
The first was educating the team on how to code in Typescript, which meant providing additional resources and materials. Sentry shared a list of introductory articles and had a technical committee that helped train the team and carefully reviewed all the new code.
“We didn’t approach it from a ‘stick’: It was more of a ‘carrot’ approach. So instead of hitting people and saying ‘Use TypeScript!’ it’d be more like ‘If you use TypeScript, you won’t have these kinds of bugs,'” Story said. “Internally we approached it from a teaching angle versus a punitive one.”
Once the team was educated on the new language, step two was writing all new projects using TypeScript. Building new features in TypeScript also helped developers gain experience while working on lower-risk parts of the code that customers didn’t have exposure to.
Workers had too much new work to spend so much time on the conversion.
“We didn’t take into account the ability to sustain the energy level for that long for that much work,” Story said. “People just didn’t have the amount of time available to focus on backfill work so that just kinda blew out our timelines.”
Throughout the beginning of 2020, contributors felt burnt out and discouraged by the length of the project. However, a light-at-the-end-of-the-tunnel moment came over the summer: The team hit the 70% conversion mark and felt excited to cross the finish line.
The benefits of TypeScript and what the team learned
Since the team completed the shift, the company now has increased productivity and greater protection from mistakes, including fewer bugs in production, Story said.
Because of the way annotations work in TypeScript, developers also have a better experience where they’re spending less time on documentation. TypeScript also has an active community, which came in handy when the Sentry team needed to ask questions of other developers.
“The approach we took is the path I would suggest: It has the drawback of being slow but doesn’t require halting other product work and lets you focus on correctness versus completion,” Story said.
Once the team accepted that they would miss their initial timeline, they gave themselves permission to gradually and carefully chip away at the project instead of rushing. That allowed them to balance the undertaking’s scale with the other important work they had to do to keep building out Sentry’s software.
Overall, Story says the project has benefitted the company significantly and he’d recommend a similar strategy to other firms in the same position.
“I would recommend it if other organizations are running into the kinds of errors that TypeScript can help with,” Story said. While TypeScript might not be able to solve all of an organization’s issues, “it can help with a bunch of problems that are hard to catch with testing and code review.”