Peter Seliger
4 min readFeb 6, 2024

--

The statements made in 14 out of 18 comparisons unveils the author’s half-baked wisdom respectively cluelessness.

Though I’m not uncomfortably with TS, articles, like the one I’m going to criticize, do not contribute anything good. In opposite, the are oil to the my language versus your language fire.

1. Release

“…. JavaScript was created in 1995 by Brendan Eich.”

… and has ever evolved since. So what’s exactly the point.

2. Purpose

“…TypeScript, in simple words, is a superset of JavaScript. It improves the developer experience.”

One should leave the evaluation, suggested with the last sentence, up to the individual developer. But of cause TypeScript strength comes with its enforcement of type-safety, thus targeting the development and maintenance of enterprise code.

5. Syntax

Im not even quoting this one. It’s just utter nonsense.

6. Tools

Same as “5. Syntax” … and looks like a desperate attempt to prove exactly what?

7. Compatibility

“TypeScript is compatible with JavaScript. But JavaScript isn’t compatible with TypeScript.”

The worst of all. Where is the logic? How about Set-Theory? Since TS is a superset of JS, the opposite is true. TypeScript Syntax is entirely incompatible to JS Syntax unless one writes the former like the latter.

8. Debugging

“It’s faster in TypeScript to spot errors because of stronger typing. In JavaScript, it requires more time to debug.”

Even this one is debatable since e.g. any IntelliJ IDEA is astonishing good with its warnings based on its parsing algorithms. In addition one easily can provide jsDoc annotations. And most of all, properly written tests and a at least 90percent (if not higher) test-coverage are the only guarantee for properly working code. And the latter accounts to any PL. TypeScript is no exception.

10. Compilation

“There’s no need for compilation in JavaScript. But TypeScript codes must be compiled.”

It actually is transpiling (source-to-source translation) and not compiling. And even the JS modules, when aimed to be bundled for the web, need to undergo such tasks.

11. Generics

“TypeScript not only supports generic features but also enables the development of reusable components. JavaScript, on the other hand, doesn’t support generics.”

Wow, this one is really bad too. Did the author himself within the last 10 or even only during the past 5 years develop any relevant piece of JavaScript code, node.js based and within any available modern IDE? And being generic is one of JavaScript core features. TS got it from there and helps unexperienced TS-developers with crippling it.

12. Notion

“JavaScript is a lightweight programming language that has some amazing features for developing dynamic and interactive web pages. TypeScript is used for making larger projects.”

See my comment on “2. Purpose” . TypeScript is a good fit for enterprise-code. And as for JS, having been stamped right now as lightweight, it does hopefully not mean featureless. Hence, no argument against being not used for developing and maintaining enterprise code as well.

13. Suitability

Again, just like “5. Syntax” … not a single fact which does prove such a biased opinion. There is nothing reliable in the author’s statement. Actually in the projects I’ve seen in the last couple of years, JS and TS do almost equally share their parts at server- and client-side.

14. Execution

“JavaScript … also provides cross-browser functionality.”

The author seems not to know the difference/border in between JavaScript’s language core and the DOM-API, the Web-APIs and a browser-API.

In the same time the author’s before made claims about TS being suitable for FE development gets contradicted by this comparison. Remember, since TS transpiles into JS, every JS-environment is a possibly targetable platform.

16. Client side

“TypeScript can only be used on the client side. JavaScript can be used for both server and client side.”

And that one can not stay uncommented. Does the author actually remember/recall or at least read any of the before made statements. At “13. Suitability” the author says … “Though TypeScript can be used for developing both backend and frontend, it’s ideal for front-end.” … which already is devoid of all reason, but at least acknowledges the fact, that TS actually is used for frontend and middleware/backend projects alike.

As a reminder to everyone, the author titled this article … “a thorough comparison”.

17. Annotation

“There’s no use of annotations in JavaScript. TypeScript needs specific scripting.”

Why are a lot of the authors claims are so fuzzy(ly) articulated like the one above? Of cause one can make use of type-annotations in JS, but one does not get forced to do so. On the other hand, making use of e.g. jsDoc annotations does not make the code unreadable for a JS-engine like the TS syntax does.

18. Examples

“Almost all big websites like Google, Facebook, LinkedIn, Amazon, Quora are made using JavaScript.”

How does the author know? At least with a production build (transpiling, minifying/bundling) one should not find any trace which points to an development environment where one would do all or just some partial development in TypeScript.

Is the author familiar with JS/TS development at all?

--

--

No responses yet