The language itself has come an extremely long way from being used as only a facilitator of interactions on websites to a fully-fledged, universally useful programming language. We will take you on a journey from its creation to the TypeScript days.
At one point, people woke up, realising that more can be done. Pages still had to completely reload to show new information, which resulted in a slow and inefficient process. There had to be a way to prevent websites from reloading to get and process new data, right?
The first widespread example of such an innovation was when Microsoft allowed Internet Explorer 5 to make HTTP requests. In 1999, they implemented an object called “XMLHttpRequest” which allowed for getting data from an external source without reloading the page.
Why was this functionality even implemented? Long story short, MSFT did that just so Outlook’s website fetched emails in the background. The long-term effects were much more than making one website run better.
According to Monika Mazurczak, Frontend Developer at ITMAGINATION:
In 2006, the world saw a solution that aimed to address the problem. Fourteen years ago, jQuery saw the light of day, abstracting the differences in implementations. The image you see above was how jQuery handled the differences in implementations between browsers. What you see below is just calling the “jQuery.ready()” function after a page finishes loading.
Do you know how would it look like now? Thanks to the standardization of implementations, it is pretty straightforward. There are few ways to go about this, and this is one of them:
In comparison, React.js, which is widely regarded as a modern standard for front-end development, React is used on 43.7% of the top 10,000 most popular pages. When it comes to the front-end side, jQuery was the final important step to get the ball rolling. Consistency across browsers allowed developers to create the apps they wanted to, but previously couldn’t.
One of these events was the initial release of Node.js, the other one being the first revision of the language – ECMAScript 2009 (better known as ES5) saw the light of day.
The First Event – ECMAScript 2009
ES5 brought many features that were absolutely necessary. Strict mode, essential operations on arrays such as filter, map, and reduce (“The Holy Trinity of Functional Programming”), the JSON object, property getters & setters, and much much more that is outside of the scope of this article.
The Second Event – The Birth Of Node.js
You see, when you are thinking about writing an app that will get bigger than your standard beginning starter projects, you will run into problems sooner or later. Strongly typed languages, such as Java or C# give you a layer of safety – they will catch some bugs themselves, without having to involve you, the developer, in any way. That’s because they will ensure the correctness of the code themselves upon running it.
It has some features that made it extremely popular among the pros.
First of all, since C# and TypeScript were created by the same person, they share some similarities. Of course, don’t expect the two to be twins.
Third of all, TypeScript integrates with e.g. React and Vue on the front-end seamlessly. On the backend, all major libraries work with TypeScript out of the box. Nest.js uses TS by default; while Express.js and Fastify have their additional type definitions for you to install and forget.
If whatever library you need is not on the TypeScript hype-train, you generally will still be able to use them while enjoying the enhanced design-time support. Users contribute type definitions for free for all the most popular libraries, and in the worst-case scenario, you can write your own declarations. In other words – if you’re using it – there are type definitions for it.