/ Faster React Native development trick #1: use TypeScript

Faster React Native development trick #1: use TypeScript

Tom Riglar

First let me be very clear: there are no shortcuts to faster software development. Many companies and developers try to cut corners. It always ends badly.

Thu Feb 06 2020 - 3 min read

First let me be very clear: there are no shortcuts to faster software development. Many companies and developers try to cut corners. It always ends badly.

Good news: you can speed things up — but to do so requires the most important attribute any developer should have: discipline.

Uncle Bob, the author of Clean Architecture and all round software guru says this:

The only way to go fast, is to go well. — Robert C. Martin (aka Uncle Bob)

So how do we ‘go well’ in React Native development?

The default language of React Native is JavaScript. This non-typed language is quick to get started and great for beginners. But it quickly becomes a mess in medium sized or above projects…

To avoid this we can use a typed language. In React Native, that means using TypeScript.

This article won’t go into detail about how to use TypeScript but I will explain why a hiring a developer that uses it will get faster results than one that doesn’t.

So let’s dig into how TypeScript lets us make apps quicker and ultimately reduces development costs…

Speed boost 1: code auto-completion

Text auto-completion is everywhere — many of us use it on our smartphones everyday. It turns th into thanks and makes our messages quicker to type.

TypeScript does the same thing but with code. Let’s use an analogy…

Say I give you a basketball 🏀

You weren’t expecting a basketball. You were not ready to throw or catch. You were not wearing sports shoes. You were not prepared.

This is like JavaScript. Every time we get a new thing we have to manually work out what it is and how we use it. This takes a bit of time in small projects but it takes a lot of time in larger projects.

Now let’s say I tell you I will give you a ball 🎾 🏉 ⚽️. You can prepare. Put on your sports shoes and get ready to throw or catch.

This is like TypeScript. We know what type of thing we’re going to get. That means the compute can autocomplete the rest for us…

Speed boost 2: error detection

Every piece of software has bugs. They are especially common during development.

TypeScript is able to detect issues in software before they become bugs.

Using the basketball example, here is TypeScript telling us that something is wrong.

JavaScript wouldn’t tell us this — we would spend precious time running the app and trying to work out what is wrong!

Great — so what’s the catch?

TypeScript is a powerful tool that can speed up large projects significantly.

In order to correctly use TypeScript and gain these benefits you need an engineer that is disciplined.

This is because TypeScript’s constructs (classes, interfaces and types) need be kept up-to-date in order for auto-completion and error detection to work.

TypeScript is like going to the gym every day so that you can run faster. It gets results but only if you’re committed and professional.

At App Sapiens we use TypeScript every day to deliver these benefits to our customers. If you would like to find out more about how to increase speed without cutting corners on your project, please reach out via our website.

Copyright © 2021 App Sapiens Ltd | Registered in England #11169148

Privacy Policy