HACKER Q&A
📣 benboughton1

Keeping javascript simple, what are our options?


Self taught dev here. I have had two experiences working in front end development. The first is basically script tags in HTML. HTML is built by bottlepy template engine. *.js files sat in the /static folder on the server. Javascript makes json calls to server with a database etc. Pull in Bootstrap and projects can be put together super quick works well.

The second is a recent unplanned deep dive in to Angular CLI which to me seems at the opposite end of the spectrum, single page, Typescript, NPM, compiled js etc. Fun, but Full On. But for as much that this brings, a lot of things that just worked before are complicated.

I recently started a new personal project. I have started with my comfortable bottlepy sever with templates. But as the javascript becomes involved, more libraries seem to give examples in the ES6 style (imports etc), I think I need to think this through more.

My question is, in late 2019, if you want to keep your javascript simple, what are your options? There must be something that sits between plain javascript and Angular CLI. No Angular, React, Vue etc. Think more like leaflet.js with a few plugins.


  👤 yuwu9145 Accepted Answer ✓
Hi,

I personally completely agree with you that we should use simplest javascript to achieve a project requirement. I guess the decision is really depend on:

Do you have to build single page application?

If yes, then its easier to build via a framework like Angular, react or vue.

If no, then you will have freedom to choose whatever library you want to use in order to satisfy requirement.

In addition, recently I started to look into web components. It is now part w3c standard and supported by most modern browsers. It allows us to construct components via raw javascript.


👤 diminoten
I'd urge you to think about why JS keeps getting more "complex" (your phrase). There is a reason, but no one can tell it to you; you have to discover it for yourself, or it'll always feel like you're blindly following others.

It's very hard to approach a thing you don't know and accurately point out the flaws. What I suggest doing is first get to know some of these "complex" JS frameworks/libraries, and then figure out what it is you don't like. Otherwise you're going to end up not really understanding what you're talking about, and you'll miss out on some cool tech just because the popular kids online didn't like it.