- Sentry is a billion dollar startup that makes open source error monitoring software.
- The developer team has now increased their productivity and fewer bugs in production.
- See more stories on the Insider business page.
The company decided to embark on this massive endeavor because its engineers realized that with JavaScipt, they were shipping software bugs that Typescript would have detected automatically.
While the effort to make the change took Sentry much longer than expected – the engineers had an “over-ambitious” plan to complete it in about four months – it created a wave of benefits, including productivity. increased, the company said.
Why Sentry decided to make the switch
In the fall of 2019, the company was shipping âmore front-end bugs than was acceptable,â many of which were so-called runtime errors, or bugs that occur while software is running.
Story and others realized that TypeScript’s features would have allowed it to catch these kinds of errors before the code was uploaded to the website. The team estimated that it would take between five and eight engineers about four months to switch to TypeScript. While some feared that this was an inefficient use of engineers’ time, they realized that in the long run it could help the company save time by avoiding mistakes.
âThere was initially some reluctance from some people about the cost and complexity that it introduces,â Story told Insider. “But these people didn’t have good solutions to avoid all the runtime bugs.”
So in August 2019, the team planned to change their codebase by the end of the year, an aggressive schedule that would have required engineers to convert 74 files per week. They would quickly understand how unrealistic this initial timeline would become.
Reality was much more intense than expected
The team has divided their switching strategy into three phases.
The first was to train the team on how to code in Typescript, which involved providing additional resources and materials. Sentry shared a list of introductory articles and set up a tech committee that helped train the team and carefully reviewed all of the new code.
âWe didn’t approach it from a ‘stick’: it was more of a ‘carrot’ approach. So instead of hitting people up and saying ‘Use TypeScript!’ more like, âIf you use TypeScript, you won’t get those kinds of bugs,â Story said. “Internally, we approached it from a pedagogical rather than a punitive angle.”
Once the team was trained in the new language, the second step was to write all the new projects using TypeScript. Creating new features in TypeScript also helped developers gain experience while working on low-risk parts of code that customers weren’t exposed to.
The workers had too much new work to spend so much time on the conversion.
âWe didn’t factor in the ability to maintain energy levels for that long for so much work,â Story said. “People just didn’t have the time to focus on the backfill job, so it just blew our deadlines.”
Throughout 2020, contributors have felt exhausted and discouraged by the duration of the project. However, a moment of light at the end of the tunnel happened 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 change, the company has now increased productivity and better error protection, including fewer bugs in production, Story said.
Because of the way annotations work in TypeScript, developers also have a better experience where they spend 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 have taken is the route I would suggest – it has the downside of being slow but does not require stopping other products to work and allows you to focus on accuracy versus completion, âStory said.
Once the team agreed to miss their initial schedule, they gave themselves permission to gradually and carefully scale down the project instead of rushing. This allowed them to balance the enterprise scale with the other important work they needed to do to continue developing the Sentry software.
Overall, Story says the project has been of great benefit to the company and that he would recommend a similar strategy to other companies in the same position.
âI would recommend it if other organizations encounter the types of errors that TypeScript can help with,â Story said. While TypeScript may not be able to solve all of the problems in an organization, “it can help solve a number of problems that are difficult to spot during testing and revising code.”