I just read an article where someone wrote down their thoughts after watching a developer game show.
What i took away from the article is that developer education is geared too much to web development.
And because javascript is now used for backend and frontend code, that has become the language for most code examples. I want to explore the language aspect more in this post.
The first example where someone didn't know to create a website without javascript, is in my opinion a little extreme. I think most people that use javascript know that you have node to run javascript on the server, and the browser engine runs javascript you send to it.
I think because there are so many javascript options today, people have to specialise too quickly. Which leads to people that have a deep understanding of a specific framework and become blind to solutions that could be closer to the source.
For example when the request becomes to slow, the knee jerk reaction is to add caching. Instead of figuring out what makes the request slow, and find a solution based on that conclusion.
I see the benefits of a codebase that is almost all javascript, the problem is that it could skip the benefits of other languages. There is a reason no current operating system is rewritten in javacript.
I think it is great that you can use a javascript framework to create an android or apple device app. But I hope people know that to create a running app a part of the code is in a backend language, in order to communicate with the device.
It is like only speaking English. Because it is so widespread you can communicate with a lot of people. But if you learn a few language well enough you will have a better experience talking to native speakers. Even learning a few words can get the ball rolling.
What do you think? Is javascript the only language you need? Or is it good to know multiple languages?
Top comments (3)
JavaScript is great because it can be the only language that you need. That is huge for someone just starting out. You can build an entire stack end-to-end with just JS based tools. Node is incredibly versatile. You can use the REPL for quickly testing snippets. You can spin up any service you want. You can wrap native binaries or call other languages through IPC. You can easily implement real-time communication between back and font-end. You can scale horizontally or vertically with very little friction. It has a huge ecosystem of packages that are easy to install and use, or publish your own if you want. I could go on an on about this and that's just the back-end.
Now add to all that the fact that you can then seamlessly switch to front-end work without changing hats. That's awesome for productivity. And the code is often completely interchangeable. You can easily move an algorithm from your front-end to your back-end without a rewrite. You can run JS on any device without compiling. And you can use experimental new features like WebSocketStream.
Of course it never hurts to know some other languages, but JS is definitely the English of the programming world. It's flexibility outweighs it's imperfections.
You mention javascript can be the only language you need, but is that a good thing?
I agree having the same language backend and frontend is great for websites. I think it is getting murkier is you are creating mobile or desktop apps. In those cases you take a website specific language to create something that resembles the notion of what an app looks like in that environment. So you end up with apps that are essentially dedicated browsers.
I once got an app from students and it had no device functionality, so when there was no internet, the app didn't work.
Is this the best way forward?
Even in the browser environment everything is javasciptified, while the three pillars are HTML, CSS and javascipt.
There is css-in-js. The components of the frameworks are just javascipt functions with a html syntax.
I'm a big fan of the movement where javascript is getting toned down again with frameworks like Remix and Astro. Also frameworks like Stimulus and htmx that enhance HTML are a win.
I love web development, but everything has to have its place.
There are a lot of things javascript can't learn you about programming because it is so specific for the web.
Well, I think certainly think so. I gave plenty of reasons why, but I can go on.
Not really. You aren't bundling a browser, you're just using a chrome-less browser window to present your app. You can do the same thing with desktop app installs. So one codebase can be deployed on any platform. For desktop apps, you CAN bundle an entire browser/server combo, if you want, by using a tool like Electron. But a typical web app is just a way to give your users a more native experience, with seamless updates. And you get automatic access to a rock-solid rendering engine with millions of tutorials available.
That is not a failing of the platform. That is a lack of understanding on the student's part. There is plenty of literature available on how to make a web app work offline. And JS even can even be given access to USB these days.
Remix uses JSX which is not even a web standard... Personally, I have never needed a framework. The core Web APIs provide everything necessary with excellent documentation. And with Web Components, you don't even need to know any JS to build a rich, interactive UI. Just take a look at the source of my website as an example:
view-source:https://bes.works/
. It's almost purely declarative in the front-end. All complex functionality is modularized into Custom Elements. I use this method for all apps that I build.Except for all the stuff you can do with Node that has nothing to do with the web. Like create command line applications, or system services... Of course there are some things that JS can't do, but for someone learning to code, those are not even on the radar. And that gap is shrinking every year. I know plenty of languages, but I prefer JS over all of them. Maybe I'm a bit biased because I've been writing it for 30 years 🤷