Stop Using JavaScript For Everything

Sorry if this is a rant.

JavaScript is the ubiquitous client side scripting language and has been for a while.  Then a few years back NodeJS was created allowing for JavaScript to be used on the server side.  It’s actually a great completely event driven platform that can power many high scale systems.

But then it got weird.  I suppose UI engineers have been locked into client side work for too long and found Node to be their escape into other worlds.  People started using it to solve every technical problem – load balancing, code deployment, crontabs, system scripts, build tools, etc…

JavaScript and Node are NOT the best tool to solved every problem.  I feel like engineers fall into this hole for two major reasons:

  1. UI engineers are too lazy to learn another language.  There i said it.  I know you say your “expertise” is in JavaScript, but I’d bet that a majority of people who claim to be experts in any language are just average or slightly better than average.  Each language has its pros, cons, and best uses.  Pick up a book and learn another language.  Python is great of systems scripting.  Java / Scala is awesome for long running processes, etc…  Stop using the butt of your drill to hammer a nail into the wall.
  2. Node makes things too easy.  There are a load of libraries easily accessed via NPM.  The event driven model makes the concurrency problem abstracted from the developer so they can develop “scalable” applications without thinking too much.

So why am I whining?  JavaScript has a lot of nastiness.  It was built for the client side.  Once you start building large back end applications, the funk of the language becomes more and more obvious.  I cannot count how often global scope or the lack of types has caused a production outage.  Or an indented mess of code with callback hell becomes impossible to maintain.  Or how developers do not understand what the event driven model actually means and the limitations (hint, not everything you program is magically non-blocking).  Or someone decided to reinvent something that works perfectly fine just because they now can write it in JavaScript.

Node and JavaScript have their uses.  Just think before you build.  Don’t let the MEAN stack be mean to you 😉

Good Luck,
-Larry

 

Advertisements