Orignally posted here. idm if someone goes and claps there :p
Hey there, this is a brief introduction to a series of blog posts I’m gonna put out, titled JavaScript for Noobs.
JavaScript is one of the most versatile and widely used languages there currently is. You can term it as “A poor man’s Java” or as I like to call it, “what-the-hell-is-this-spaghetti-language”. It is currently the only language other than HTML and CSS natively rendered in an internet browser and has evolved from simply being a tool to make text move around in a fancy way, to becoming a building block for full-fledged frameworks on which many of today’s major industries are built on.
It basically went from Bruce Banner to The Hulk.
And much like the Hulk, it is now a rampaging monster.
In its most basic incarnation, Javascript is a simple weakly-typed language that does basic DOM (Document Object Model. That’s the structure of every HTML page) manipulation. That’s what the kids learn, and what they stick with till they know how hardcore javascript actually is. When they do learn how good it is, they still do DOM manipulations, only then they call it snazzy names such as Virtualizing the DOM or Shadow DOM and other cool stuff and call themselves Full Stack Web Developers.
But no seriously, here are some good use-cases of javascript, that are used in the industry
- Making Dynamic Websites — Almost every website that currently exists uses javascript, even if it is simply one single line.
- Making Desktop Applications — Javascript is rapidly being developed as a means to build robust desktop applications, examples being Atom (It’s this awesome IDE which is highly configurable, though I prefer VSCode over it, coz the dark theme is… darker), Slack Desktop & WhatsApp Desktop.
- Building Single Page Applications (SPA) — SPAs are also commonly known as web apps, which simply means a full-fledged application running inside your browser. Basically they are websites that are not built in the traditional way, not requesting a new page every time you click on a link & highly improved performance (since everything is loaded in one go).
- Building Progressive Web Apps (PWA) — Think of it as a SPA gone Super Saiyan. Or for the cavemen, think of it as a SPA with rockets attached to it. What this means is that a PWA is a SPA that can be used offline (you can make your changes to the interface, and whenever you get connected to the internet, your changes will instantly be pushed to the central server, but till then, you can use the PWA as you please). Slight downside, it uses something called HTTP/2 and is not yet supported fully in all browsers
- This is not exactly another use-case, but some genius also made an entire OS using NodeJS (That’s another Javascript Framework that is INCREDIBLY popular and useful, especially for server-side usage). It just goes to show how hardcore Javascript can be. It’s called NodeOS, by the way.
So, let’s learn how to write some amazing spaghetti code Javascript :)