You Do Have Time to Build it Twice

Rate this content
Bookmark

If you don’t have time to build it right, when will you have time to build it twice? In hyper growth startups the old adage breaks down. You get an expanding time horizon – IF you can get it shipped. An imperfect feature next week beats the perfect feature 2 months from now. Your code won’t matter if you’re dead. I didn’t believe this until I saw it myself. A startup on the cusp of hockeystick hired me to rewrite their jQuery app in React. Their tech proved the idea then became a burden. Over the next year we rewrote the whole app from scratch, grew a team of React experts, created a codebase that’s a joy to work with, and got the company to a $100,000,000 Series B. All because the early engineers knew that if the crappy version works out, there’s going to be time and resources to fix it later. This talk is about what I’ve learned while rewriting an app with users banging down the door.

This talk has been presented at React Summit 2022, check out the latest edition of this React Conference.

FAQ

Rewriting a software application allows for modernization, improved design, better user experience, increased conversions, and potentially higher net promoter scores. It also offers a chance to use new technologies and methodologies that can make future modifications easier and more efficient.

The Strangler pattern in software development is an approach where old code is gradually replaced with new code piece by piece, rather than rewriting the entire application at once. This method helps in managing risk and maintaining functionality throughout the process.

A software rewrite can lead to significant business growth by improving product functionality and user experience, which in turn can attract more users and increase revenue. For example, a company mentioned in the text grew four or five times and secured a $100 million Series B funding round after rewriting their application.

A company might opt to rewrite an application in React to take advantage of React's component-based architecture, which makes the code more organized, maintainable, and scalable compared to jQuery. Additionally, React's popularity and active community support make it easier to hire skilled developers.

Challenges of software rewriting include potential disruptions to existing operations, the complexity of migrating data and functionality, and the risk of introducing new bugs. Moreover, balancing new development while maintaining the old system can strain resources.

A well-managed software rewrite can maintain or even increase team velocity by improving the codebase's maintainability and efficiency. The example in the text showed that during the rewrite from jQuery to React, the company not only maintained its operational pace but also experienced significant growth.

User feedback is crucial during a software rewrite as it guides the developers on which features and functionalities are important, what needs improvement, and how the changes affect user experience. This feedback helps ensure that the rewrite aligns with user needs and expectations.

Swizec Teller
Swizec Teller
21 min
17 Jun, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Today's Talk focuses on software rewrites, specifically the transition from jQuery to React. The speaker shares their experience of rewriting a jQuery app to React, highlighting the benefits of the rewrite in terms of improved user experience and increased conversions. Approaches to software rewrites are discussed, including the page-by-page approach which allows for product innovation. The speaker emphasizes the importance of prioritizing rewrites or refactors for startups. The Talk concludes with insights on testing, server-side functionality, and the overall value of the rewrite.

1. Introduction to Software Rewrites

Short description:

Today, I want to talk about software rewrites. Later is the magical time when everything can happen, with more money, a bigger team, more experience, and a better understanding of the problem. We rewrote a jQuery app to React, which didn't slow down team velocity but actually grew the company. jQuery is still popular, with 84% of production JavaScript using it. React has won the Framework Wars with 8% of production JavaScript. The objection to rewriting from scratch is discussed, using the example of Netscape losing to IE.

Hey, everyone. I'm Suez. I'm a software engineer, author, and you can tell I'm legit because there's a big screen behind me. So today I want to talk to you about software rewrites.

Who has seen this quote before? If you don't have time to build it right, when will you ever have time to build it twice? I couldn't find an attribution for this quote because so many people have said it. What I want to tell you today is that you will have time to build it twice later. Because later is the magical time when everything can happen. Because, at least in a growing company that's doing really well, later also comes with more money, bigger team, more experience, better understanding of your problem, and just, later is this magical, magical time.

The story I want to tell you about is how we rewrote a jQuery app, yes, a jQuery app in like 2020, from jQuery to React, full rewrite, we went from scratch, and while we were doing not only didn't slow down team velocity, we actually grew the company like four or five X and got a $100 million Series B round that was announced on the famous NASDAQ screen, which by the way, doesn't happen just for IPOs. If you know the right people, you can just pay them a hundred bucks and you're on there.

So I know, I know, I know, I said jQuery and who here has used jQuery in the last, who remembers using jQuery. Okay, okay. Who has used jQuery in 2020 right before the pandemic? Okay, we have three hands. Nice. So I know jQuery is bad, but it's actually still super popular. This is what I tweeted right after SWIX, Shawn Wang gave a talk at React.com in San Francisco a couple months ago. It turns out that 84% of production JavaScript is still jQuery. And he has this nice graph which, okay cool, you can see it. If you look at the graph, there's like jQuery, 84%, then you have jQuery, Migrate, and I don't know what even that is. And then React is at like 8% of production JavaScript. However, that still means you're at the right conference because React 1, because none of the other frameworks are on the graph. So, at owning 8% of the web, React has won the Framework Wars, yes, amazing.

The other objection you might have to rewrite and starting from scratch is if you've ever read this blog post that came out in 2020, no, sorry, not in 2020, in the year 2000 back when blogs were still popular, this Jolon software guy who later went on to make stack overflow and a bunch of other things wrote a really cool article called Things You Should Never Do and he essentially explains why we're not all using Netscape right now. Who remembers Netscape? Okay. Who has actually used Netscape? Nice. Okay. So there's a couple of you. He makes the argument that Netscape was winning the browser wars until they decided, you know what, Netscape 4 kind of sucks. We're going to write Netscape 5 from scratch. And then IE came in and ate their lunch.

2. jQuery to React Rewrite

Short description:

When I joined the company, they had a jQuery app with 100,000-200,000 lines of code. It was difficult to work with, using global variables and magic mixins. We decided to rewrite it using React, without server-side rendering. The new app not only looks better but also has more conversions and happier users. The rewrite allowed us to improve the product and leverage what we learned. Writing software is like kicking a can, exploring and solving problems incrementally. Our rewrite involved changing and updating things based on user feedback.

So the story about the jQuery to React Rewrite. When I joined the company was like June 2020, and they had this little app. Will it play? It's playing. Okay. So this is a jQuery app. It's recorded in mobile mode because that was all that there was. If you open this on a full screen, it would still look just as wide as it looks right now. And this was about maybe 100,000, 200,000 lines of jQuery code. Nobody exactly knew where any of the functions were. If you tried to move anything, it would basically blow up in your face. It was doing all of the best jQuery stuff, global variables, magic mixins that just create new code. And a lot of it was working on the frontend. And actually, here's the super funny part. When I came into the company, I was like, okay, we got to rewrite. We're going to make a React-based SPA, no server-side rendering, et cetera. Now server-side rendering is popular and all of this was actually rendered on the server because that's how you use jQuery. You take express, you spit out a bunch of HTML, then you add global jQuery variables and functions and it works, kind of.

This is what we have now. It's a little better designed. I think it looks better. There's some loading spinners. We're actually using React Query, which solved a lot of our problems. That was one of the nice parts. And the other than looking better, it also has more conversions, users are happier, our NPS scores, that's the net promoter score about how much users enjoy your company, your product actually went up. And the point I'm trying to make here is that we didn't just rewrite the app from scratch, we also used everything that we learned to improve the product itself and the rewrite was what gave us the ability to rewrite.

So, and that's because writing software is kind of like kicking a can, you know, when you're walking, it's a nice Sunday, the sun is shining, and you're walking down the street and there's a can, and obviously, you walk over and you kick the can. And then you keep walking and the can bounces around and goes to the other side and you kick it from this side, and you're kind of like going where the can is going, right? And that's kind of how software works as well. Software is all about playful exploration and discovery of your problem space, kind of like kicking a can, you know, okay, I have this little problem and I'm going to solve it, you kick the can a little further down the road, then you go where the software takes you, and you're like, okay, I now know better, I have to try to kick it more into that direction. So, that's kind of what our rewrite was all about. We were changing things, we were updating, getting feedback from users, and that's the important part, because when you have bad code, the level of effort it takes to make a change goes up exponentially.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Don't Solve Problems, Eliminate Them
React Advanced Conference 2021React Advanced Conference 2021
39 min
Don't Solve Problems, Eliminate Them
Top Content
Kent C. Dodds discusses the concept of problem elimination rather than just problem-solving. He introduces the idea of a problem tree and the importance of avoiding creating solutions prematurely. Kent uses examples like Tesla's electric engine and Remix framework to illustrate the benefits of problem elimination. He emphasizes the value of trade-offs and taking the easier path, as well as the need to constantly re-evaluate and change approaches to eliminate problems.
Impact: Growing as an Engineer
React Summit 2022React Summit 2022
27 min
Impact: Growing as an Engineer
Top Content
This Talk explores the concepts of impact and growth in software engineering. It emphasizes the importance of finding ways to make the impossible possible and the role of mastery in expanding one's sphere of impact. The Talk also highlights the significance of understanding business problems and fostering a culture of collaboration and innovation. Effective communication, accountability, and decision-making are essential skills for engineers, and setting goals and finding sponsors can help drive career growth. Feedback, goal setting, and stepping outside of comfort zones are crucial for personal development and growth. Taking responsibility for one's own growth and finding opportunities for impact are key themes discussed in the Talk.
On Becoming a Tech Lead
TechLead Conference 2023TechLead Conference 2023
25 min
On Becoming a Tech Lead
Top Content
The role of a Tech Lead involves shaping the roadmap, helping the team be more effective, and working on important projects. Lessons learned include encouraging idea sharing, avoiding taking on all the work, and focusing on delegation. Tech Leads focus on the outcome, involve the team in decision-making, and make plans based on how different pieces will interact. The role of a Tech Lead is to focus on engineering and guide the team in figuring out how the whole system should fit together. Architecting can become problematic when it loses touch with the coding part, resulting in implementation issues.
Jotai Atoms Are Just Functions
React Day Berlin 2022React Day Berlin 2022
22 min
Jotai Atoms Are Just Functions
Top Content
State management in React is a highly discussed topic with many libraries and solutions. Jotai is a new library based on atoms, which represent pieces of state. Atoms in Jotai are used to define state without holding values and can be used for global, semi-global, or local states. Jotai atoms are reusable definitions that are independent from React and can be used without React in an experimental library called Jotajsx.
A Framework for Managing Technical Debt
TechLead Conference 2023TechLead Conference 2023
35 min
A Framework for Managing Technical Debt
Top Content
Today's Talk discusses the importance of managing technical debt through refactoring practices, prioritization, and planning. Successful refactoring requires establishing guidelines, maintaining an inventory, and implementing a process. Celebrating success and ensuring resilience are key to building a strong refactoring culture. Visibility, support, and transparent communication are crucial for addressing technical debt effectively. The team's responsibilities, operating style, and availability should be transparent to product managers.
Debugging JS
React Summit 2023React Summit 2023
24 min
Debugging JS
Top Content
Watch video: Debugging JS
Debugging JavaScript is a crucial skill that is often overlooked in the industry. It is important to understand the problem, reproduce the issue, and identify the root cause. Having a variety of debugging tools and techniques, such as console methods and graphical debuggers, is beneficial. Replay is a time-traveling debugger for JavaScript that allows users to record and inspect bugs. It works with Redux, plain React, and even minified code with the help of source maps.

Workshops on related topic

React, TypeScript, and TDD
React Advanced Conference 2021React Advanced Conference 2021
174 min
React, TypeScript, and TDD
Top Content
Featured WorkshopFree
Paul Everitt
Paul Everitt
ReactJS is wildly popular and thus wildly supported. TypeScript is increasingly popular, and thus increasingly supported.

The two together? Not as much. Given that they both change quickly, it's hard to find accurate learning materials.

React+TypeScript, with JetBrains IDEs? That three-part combination is the topic of this series. We'll show a little about a lot. Meaning, the key steps to getting productive, in the IDE, for React projects using TypeScript. Along the way we'll show test-driven development and emphasize tips-and-tricks in the IDE.
Web3 Workshop - Building Your First Dapp
React Advanced Conference 2021React Advanced Conference 2021
145 min
Web3 Workshop - Building Your First Dapp
Top Content
Featured WorkshopFree
Nader Dabit
Nader Dabit
In this workshop, you'll learn how to build your first full stack dapp on the Ethereum blockchain, reading and writing data to the network, and connecting a front end application to the contract you've deployed. By the end of the workshop, you'll understand how to set up a full stack development environment, run a local node, and interact with any smart contract using React, HardHat, and Ethers.js.
Remix Fundamentals
React Summit 2022React Summit 2022
136 min
Remix Fundamentals
Top Content
Featured WorkshopFree
Kent C. Dodds
Kent C. Dodds
Building modern web applications is riddled with complexity And that's only if you bother to deal with the problems
Tired of wiring up onSubmit to backend APIs and making sure your client-side cache stays up-to-date? Wouldn't it be cool to be able to use the global nature of CSS to your benefit, rather than find tools or conventions to avoid or work around it? And how would you like nested layouts with intelligent and performance optimized data management that just works™?
Remix solves some of these problems, and completely eliminates the rest. You don't even have to think about server cache management or global CSS namespace clashes. It's not that Remix has APIs to avoid these problems, they simply don't exist when you're using Remix. Oh, and you don't need that huge complex graphql client when you're using Remix. They've got you covered. Ready to build faster apps faster?
At the end of this workshop, you'll know how to:- Create Remix Routes- Style Remix applications- Load data in Remix loaders- Mutate data with forms and actions
Vue3: Modern Frontend App Development
Vue.js London Live 2021Vue.js London Live 2021
169 min
Vue3: Modern Frontend App Development
Top Content
Featured WorkshopFree
Mikhail Kuznetcov
Mikhail Kuznetcov
The Vue3 has been released in mid-2020. Besides many improvements and optimizations, the main feature of Vue3 brings is the Composition API – a new way to write and reuse reactive code. Let's learn more about how to use Composition API efficiently.

Besides core Vue3 features we'll explain examples of how to use popular libraries with Vue3.

Table of contents:
- Introduction to Vue3
- Composition API
- Core libraries
- Vue3 ecosystem

Prerequisites:
IDE of choice (Inellij or VSC) installed
Nodejs + NPM
Developing Dynamic Blogs with SvelteKit & Storyblok: A Hands-on Workshop
JSNation 2023JSNation 2023
174 min
Developing Dynamic Blogs with SvelteKit & Storyblok: A Hands-on Workshop
Top Content
Featured WorkshopFree
Alba Silvente Fuentes
Roberto Butti
2 authors
This SvelteKit workshop explores the integration of 3rd party services, such as Storyblok, in a SvelteKit project. Participants will learn how to create a SvelteKit project, leverage Svelte components, and connect to external APIs. The workshop covers important concepts including SSR, CSR, static site generation, and deploying the application using adapters. By the end of the workshop, attendees will have a solid understanding of building SvelteKit applications with API integrations and be prepared for deployment.
Build Modern Applications Using GraphQL and Javascript
Node Congress 2024Node Congress 2024
152 min
Build Modern Applications Using GraphQL and Javascript
Featured Workshop
Emanuel Scirlet
Miguel Henriques
2 authors
Come and learn how you can supercharge your modern and secure applications using GraphQL and Javascript. In this workshop we will build a GraphQL API and we will demonstrate the benefits of the query language for APIs and what use cases that are fit for it. Basic Javascript knowledge required.