Why did JS became so popular?

So, the lessons state this 5 points:

  1. JavaScript can be used in both the front-end and back-end of web development.
    ==> Why can they not program every language for both?
  2. JavaScript is standardized so it’s frequently updated with new versions.
    ==> But why is this standardized and not any other language?
  3. JavaScript integrates easily with HTML and CSS.
    ==> Okay, this one is clear.
  4. JavaScript allows websites to have interactivity like scroll transitions and object movement. Modern browsers still compete to process JavaScript the fastest for the best user experiences. Chrome, the most used Internet browser in 2017, has been so successful because of its ability to process JavaScript quickly.
    ==> but why is this interactivity unique to JS?
  5. JavaScript offers a wide range of frameworks and libraries that help developers create complex applications with low overhead. Programmers can import libraries and frameworks in their code to augment their application’s functionality.
    ==> Yeah, but surely this wasn’t available when Eich just created it? This looks like a consequence of its popularity to me…

I’ve put my remarks/questions in bold.

thanks fr feedback.

kr,

Yannick

To answer some of your questions, I think we need a bit of time travel (aka history), here is a good article:

The History of JavaScript: Everything You Need to Know | Springboard Blog

So it seems JavaScript seem to have been born in the midst of a browser war. Where a simply scripting language was required. So initial, JavaScript (or whatever it was named back then) was only supported by the browser (so only front-end). A such, javascript was designed to interact with webpages

then JavaScript popularity skyrocketed, resulting in nodeJS (developed by google/alphabet if I am not mistaken), which means we could run “javascript” in the back-end. The idea being that its easier to have one language for both front- and back-end. To ease communication between the front- and back-end developers I guess? Or make it easier for someone to work on both front- and back-end?

Because building another front-end browser language would be a massive effort. Browsers are massively complex. Getting another front-end language of the ground would require massive investment and massive risk in failure. You would either need to build something which complies with the browsers current engine, or convince them to support your engine (very unlikely)

lots of programming languages gets updates. Keeps us developers busy haha :stuck_out_tongue: Bit of vaguely formulated from the exercise.

JavaScript became a monopoly. It succeeded, maybe right place, right time? Difficult to say for certain.

EDIT: not entirely through, there is web assembly. But that doesn’t seem to take off yet.

those came later indeed. These frameworks and libraries have a variety of task. Jquery was popular a while, when JavaScript wasn’t easy to get consistent across different browsers. Jquery took care of that

now we have vue, angular and react. vue and react make it a lot easier to build a SPA (single page application). Angular has an MVC (model view controller) design pattern in the front-end. But worked very little with angular, so couldn’t tell you the details of it

I hope this covers some of your questions? If you have further questions, feel free to ask of course :slight_smile:

4 Likes

The most fun one for me is that javascript was not the original name (Mocha/Livescript?) and it was supposedly changed to javascript to try piggy-back of the new hot ticket in town…: Java!

The part that’s fun for me is that the start of Java had a huge marketing campaign to promote it as the new next big thing (partly aimed at C++ developers telling them it wouldn’t be too different). I have the impression (though it may be false because I was much younger) that it was a bit more hyped than necessary.

In school at the time the teachers were pushing that java was a beast, and that javascript was a joke (it was kind of true then…). It’s funny to see how a couple of years turn the tides with these things… like @stetim94 says, it may be a matter of right place, right time!

1 Like

That is valuable feedback, since this is something I’ve wonderd to. If JS is so great, why didn’t they only use that since invention. Your post explains that :slight_smile:

I tried to keep my answer neutral up till this point, but I don’t think JavaScript is a great language. If I had free choice of what programming language I could use, JavaScript would be pretty low on the list

But I am not really in the mood to discuss the pros and cons of JavaScript. Everyone is entitled to there opinion, so if you think JavaScript is great, then that is great :slight_smile: (I am happy for you? how do you say that in English?)

2 Likes

Coming from other languages, whether writing in oop or functional there are always some behaviours that always surprise me (in unpleasant ways) about javascript. But it’s useful to know if you’re into web development.

For a laugh, here’s documentation on odd behavior:

Example:

parseInt(1 / 1999999); // -> 5

Another:

1 < 2 < 3; // -> true
3 > 2 > 1; // -> false

I am trying to make a career switch, simply because I always fix everyone problems with programs, installing things,… And I have the patience to keep looking for answers, eventually I’ll find them. That is why I chose to start learning programming/coding.

Based upon what I heard, I chose to focus on JS. But I’m not yet that experienced in this matters, so, which one would you advise me to learn? What i also really would like to learn is to build small games/apps. I thought JS was also good for this.

This is actually a problem (not really a problem offcourse), but for everything new I learn, I also get 10 extra question, if not more :slight_smile:

Developers are a different “breed” then fixing software on someones computer. But I guess that how a lot of people start. So your mind-set, attitude and questions seems right :slight_smile: I think those are good qualities.

Good question, but one that has an incredible long answer

I think web-based/browsers are written in Javascript or web-assembly. AAA games (games published by large companies like rockstar games (GTA), cd project red (witcher 3, cyberpunk 2077), ubisoft, EA, Bethesda) are mostly written in C++.

There two kind of mobile apps: native and hybrid.

native apps are in Java or kotlin for android and swift for IOS
hybrid apps can be done in Javascript using react native (and other frameworks, but can’t remember which, would have to google)

electron (also Javascript framework) can be used for cross platform desktop apps, and I am trying to remember if electron could also be used for mobile apps. Would have to google that. can’t remember

1 Like