Hackers News

Just say no to JavaScript

“The TypeScript compiler only finds minor errors”

Uhm, yes. Exactly right. 

“All these types create too many errors”

Uhm, yes. Exactly right.

Okay, those last two comments were a bit flippant. But the errors are the point. The TypeScript compiler will find errors that could make it to deployment if not caught via testing. It is always better to find a problem earlier in the development cycle, and nothing is earlier than a little red squiggly showing up immediately as you type an error. 

As for “Too many errors,” well, that’s a feature. TypeScript is precise, and precision is good and desirable when coding. There’s no limit to the ways you can shoot yourself in the foot with JavaScript. I see way too many “Guess what this JavaScript code would output!” problems. If there is ambiguity and imprecision in a language, that language will result in buggy code. If you have to run code to know what its output should be, you have bad code. 

“I can use unit testing to make sure my code works properly”

This is one argument that gives me pause. I love unit testing and test-driven development, and I think we all ought to be writing our code that way, so this argument is compelling. But then I remember that you can do unit testing with TypeScript as well, so this argument kind of falls apart.

admin

The realistic wildlife fine art paintings and prints of Jacquie Vaux begin with a deep appreciation of wildlife and the environment. Jacquie Vaux grew up in the Pacific Northwest, soon developed an appreciation for nature by observing the native wildlife of the area. Encouraged by her grandmother, she began painting the creatures she loves and has continued for the past four decades. Now a resident of Ft. Collins, CO she is an avid hiker, but always carries her camera, and is ready to capture a nature or wildlife image, to use as a reference for her fine art paintings.

Related Articles

Leave a Reply