What's Unscalable about JavaScript? | TypeScript OOP
Microsoft called TypeScript JavaScript that scales... what's so unscalable about JavaScript?
With respect to software development, there are two ways to think about scalability.
- Performance scalability
- Productivity scalability
TypeScript is meant to address 2. Productivity scalability.
Like most dynamically-typed languages, the lack of types in JavaScript can drastically improve initial productivity levels on certain projects, but there are factors that exist in other projects (team size, code size, intended code lifespan, domain complexity), in which the lack of types can be detrimental to code quality and understandability.
It's been agreed upon that:
- It's better enable the compiler to catch silly bugs, typos, and other errors at compile time, rather than in production at runtime.
- Tests are the best documentation possible for your code. Types are no substitute for writing tests, but they can do a good job at reducing the surface area of bugs.
- Tests also enable faster and safer refactoring. Similarly, if no tests exist, types can (at the very least) catch syntatic inaccuracies.
We've talked about it previously, but TypeScript addresses #3 of the Hard Software Problems: The Compled Domain Problem.
See also: "When to Use TypeScript", a Detailed Guide through Common Scenarios.
Discussion
Liked this? Sing it loud and proud 👨‍🎤.
🚀 55% off The Software Essentialist sale - doors open in 2 days
A lot of devs get stuck in “best practices”.
Between things like SOLID, Clean Code, microservices, single-file components, and so on — there’s a lot you can do...
But in my experience, there’s only a small set of things that really matter at this stage when it comes to making the shift from coding to crafting.
There's only a few things that really move the needle in terms of writing scalable, testable code (on any side of the stack).
That's what the Best Practice-First Phase is all about: the real best practices.
We're doing a 55% off promo of The Software Essentialist from March 31st to April 4th to celebrate the launch of The Best Practice-First phase of craftship in the Early Adopter course.
Folks have been asking me to do one of these for a while, but I wanted to wait until this valuable module dropped.
Join the waitlist for bonuses and to get early bird access (1 to 5 hours before everyone else) when the sale goes live.
Only 200 spots available. Join the waitlist here đź”—.
PS: You can track updates on the course progress & the companion book (solidbook.io) here.
Stay in touch!
Join 15000+ value-creating Software Essentialists getting actionable advice on how to master what matters each week. đź––
View more in TypeScript
You may also enjoy...
A few more related articles