Growth/decline of language over time, Stack Overflow Survey, 2017
Today, JS can be used for whatever you need to do in the front- and back-ends of software development. This is a wonderful thing. The ability to share code between the server and client is great for performance and scalability. Devs from both ends can more easily collaborate, reducing the scope for bugs and miscommunication. The JS community is large and growing everyday, too. With strong support for JS from the likes of Facebook and Google, this is no surprise.
Which languages do developers use?, Stack Overflow Survey, 2017
Stack Overflow Survey, 2017
First-class programming language?
When we say “first-class programming language” we mean a language that is used as a core technology across industries for various, vastly different purposes and at scale. In other words, a “go-to” language for many software-related tasks.
Why the shift?
JS hit it big with single page applications (SPAs). This was novel stuff at the time - loading an interface once and not needing to refresh the whole page to see new data. It showed many people what JS was capable of in the front-end.
Google, Facebook, and others began taking the language more seriously, putting a lot of engineering hours into improving the tooling around it internally. Better runtimes were developed, like V8. This in turn became Node.js, moving JS from a browser-only language to something that also runs on hardware. Frameworks and libraries such as Angular and React were developed, enabling you to create fully functioning apps, including application routing and communicating with web servers, with only JS.
Nowadays JS is used for:
- RESTful API services that handle database modification, image storage and access authentication
- Communication between servers
- Data processing
- Building entire UIs of apps and websites
Here’s a telling statistic: more companies use JS on their back-end than either Python or Java. JS also has the most open source projects on GitHub. And alongside more widespread use, JS is being used for increasingly complex scenarios. NASA even trust it for managing essential spacesuit data in space. For NASA, the ability to build a simple, end-to-end application with centrally located data at a small cost was what drew them to JS. If that’s not a first-class use, then what is?
Open for interpretation
Because JS is so flexible and functional it can be interpreted in many ways. This is clear from the number of frameworks knocking around: there are hundreds of that enhance raw JS. Just a week or two ago Google released Flutter, a new mobile UI framework.
Which frameworks do developers use?, Stack Overflow Survey, 2017
Node.js is currently the most popular framework and it’s wicked fast thanks to webpack. When it comes to the front end, we’re spoilt for high-quality choice. Just look at the engineering effort Facebook’s put into JS - it’s given us tooling like React and the associated pipeline. Or there’s Electron, which Slack is built with.
But here’s the thing - you’re not limited to a small set of frameworks or libraries. And libraries themselves are versatile, offering up flexibility and power for building software.
With continuous improvement to the language, frameworks, and tech around it it becomes increasingly advantageous to use JS for everything - front-end and back. The widespread applicability of JS isn’t something we can just ignore either.
Windows, the king of native Windows-only apps, even made a whole editor in JS and published native Windows React bindings so it’s possible to build native Windows apps in JS. Then there’s Google’s serverless functions, which only execute node.js. JS is even an option for overcoming the massive hurdle of interoperability in IoT.
From web to desktop to mobile to IoT to backend services - JS can literally be used for everything.