How JavaScript took over the world

Why is it in every web page?

· #substack

Most people who spend time online have heard of the JavaScript language. People usually mention it in the same breath as HTML and CSS. Each of these three languages plays a different role. HTML is for formatting and laying out web pages. CSS is for styling parts of web pages. JavaScript, as its name implies, is a scripting language. Without it, web pages would be simple documents with links to other documents. Once your web page loaded, that was it. If you wanted any interactivity, you had to load a new page. JavaScript gave web pages the crucial ability to be more interactive. According to Wikipedia, 98% of websites in 2022 used JavaScript.

black flat screen computer monitor

Photo by Joan Gamell on Unsplash

Brendan Eich invented JavaScript in 1995. He spent ten days making the first version. Since then, it has evolved and increased in complexity and sophistication. A lot of technologies develop along a similar path. First, people look at them as a toy. As they grow, people take them seriously. After people build a few multi-billion-dollar businesses on a platform, it gets some respect.

The same thing happened with the personal computer itself. The hobbyists and obsessives were the first users. They were willing to put up with the quirks and bugs in early versions. Next, businesspeople and scientists realized that computers could help them do their work. Now everybody carries a supercomputer in their pocket. Nobody thinks a personal computer is a toy or a fad anymore. Nobody thinks the web is a toy or a fad either.

JavaScript became popular because the web browser became popular. Every web browser uses JavaScript as its scripting language. As the browser became the universal platform, JavaScript became the universal scripting language. Software that ran in the browser didn’t care whether you were using a Mac or PC. 

We usually divide web applications into the “backend” and “frontend” parts. The backend refers to the software that runs on the remote server - the actual “web server.” The front end is the name for everything that runs in your web browser.

So what? You can use many different programming languages for building backend software. For building frontend software, there is only one: JavaScript [1]. This unique niche guaranteed its growth. Every interactive web page runs on JavaScript. Every front-end software developer is a JavaScript developer.


[1] To be precise, you can use different languages for front-end programming. But, you must use tools to translate them into JavaScript for the browser to understand them. For the web browser, all roads lead to JavaScript.

text

Photo by Ferenc Almasi on Unsplash

Originally published on Substack.