A TypeScript Rant. Stop Implementing Misguided Solutions

TypeScript isn’t a new invention. It’s certainly not a cure for all ills and has never been said to be such but it can make the software development journey better for those tired JavaScript developers. 

“Let’s get real though. TypeScript is often used by developers in scenarios where it shouldn’t be. I want to walk through with you and explain the why and why not of this situation.”

The TypeScript Temptation

“I’ve heard variations on this story for the entirety of my career. There is a tool for us to improve our work if we integrate it properly into our project. It will also give us faster compilation times / reusable code / solve all our problems/ increase the price of our houses.

The problem is one of asking the wrong question. If you want to use TypeScript that is fine but you need to make sure that it’s solving a problem that you want to be solved. Oftentimes people use TypeScript because it’s better without exploring why it’s better for your particular context”

The TypeScript Temptation. Using a solution without sufficiently understanding the problem.

At My Last Gig, TypeScript Helped us

“There’s a problem with the project. Things do not work as well as they might, and everyone looks towards your senior developer for help.

They come up with the suggestion. ‘Use TypeScript’. The justification is they used it at their last job and it made everything cool.

It doesn’t matter that their last product is in a totally different market to yours. The team is totally different in composition. The question TypeScript answers isn’t in play now, yet the developers agree to ‘try’ TypeScript. Everything goes ahead.”

The clash of the titans

 the TypeScript devotees vs. the JavaScript purists. The squabble in a nutshell:

The Case For

  • “I Used It, So It’s Great”: Some developer from softingsoftware waxes lyrical about how TypeScript is the second coming. Apparently, no one complained there, so it must be the holy grail.

  • “TypeScript Exists, So JavaScript Must Be Rubbish”: The mere existence of TypeScript is taken as proof that JavaScript is lacking. Well, news flash: just because something exists doesn’t mean it’s necessary.

  • “JavaScript’s Flaws Are Just Too Big”: We can all have a laugh at JavaScript’s expense (NaN === NaN, anyone?), but does that mean we should jump ship?

Why TypeScript Isn’t the Messiah

  • “Solving Problems That Don’t Exist”: Is typing really the hill we want to die on? What about the bigger picture, the real issues at hand? Nope, it’s all about TypeScript because it worked somewhere else, right?

  • “A Band-Aid Solution”: TypeScript is often slapped onto projects like a Band-Aid on a broken leg. Does it address JavaScript’s inherent issues? Hardly.

  • “Limiting, Much?”: TypeScript can be like a straightjacket for JavaScript’s flexibility. It’s not always the one-size-fits-all solution it’s made out to be.

To TypeScript or Not to TypeScript. That is the Question

If you’re in the lofty position of being able to make a decision about whether to use TypeScript in your company (or to influence decision-makers) then follow this advice.

“Put away the number for the shrink. You don’t need to interrogate your sole for the answer to this particular conundrum. 

Make a list of what needs to be done and give priority to each element. Tackle the list in order, coming up with a solution (or potential) solutions for each one.

Start to understand the question before working out what the answer is and do not look for a one-size-fits-all solution.”

The Real Decision-Making Process

“I can’t believe I need to say this. We are all adults here, aren’t we? The answer to whether you should use TypeScript (or any other tool) is to employ some common sense.

Is TypeScript truly the solution for your buggy code? Is the answer a better testing process? Or is there some other potential solution that might be a better fit for the problem at hand?

You should also keep in mind that humans code. They might be prone to errors but that’s part of the fun of working in a team. You know what your style guide is for — make sure that is properly used, before switching languages to find the solution to a problem that may or may not exist.”

Conclusion

“TypeScript Should Be Deleted! Okay, maybe not TypeScript itself, but certainly the flawed decision-making process leading to its adoption. This isn’t about the technical merits of TypeScript; it’s a parody of the approach and a call to make decisions that truly fit your project’s needs.

I’ve seen it a million times: developers working aimlessly, not understanding the problem they’re trying to solve. It’s a death sentence for professional software development. Misunderstanding or failing to grasp the problem is rife in this industry.

So, as I watch this pattern repeat across the development landscape, I’m convinced that cultural fit is crucial in hiring. Shocking for a techie, right? But technical skills aren’t everything. We need solutions that fit the problem, not shoehorn TypeScript into a role it’s ill-suited for. And if you’ve read this far, maybe, just maybe, you’re starting to see my point.

Sigh…”

Previous
Previous

I Wish I Knew This as a Junior Software Developer

Next
Next

Use Git Kracken and Other Bad Advice