Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What’s wrong with js?


It's rushed half-finished edge case riddled language with awful tooling. Some of the issues are outlined here: https://blogtitle.github.io/lets-talk-about-javascript/

Of the many programming languages I have used over the last 20 years, there are several I prefer, several I would rather not use, but PHP and Javascript are the only two I refuse to ever touch again because they are so utterly unpleasant to write anything in.

It also makes my life as an end user miserable on the web on account of the gigantic gobs of program I have to download to make even simple websites work these days, when most could work just as well as a simple HTML page served from a server that didn't somehow manage to spin the fans on my powerful laptop just so it could show me some fancy font and I utterly resent the language, and the developers choice of it for forcing this on me.

Apart from all that, there's nothing wrong with Javascript at all.


I find it ok for it's intended original use, which is browser scripting. It's totally fine to write small JS scripts to make the pages a bit more interactive.

People got it wrong when they started writing huge applications in JS.

Just because a language is Turing complete, it doesn't mean it's fitted for everything.

It's like you did your job fine as a carpenter using carpenter's tools and you get a dentist job, but you insist on using carpenter's tools because you already know them.


Yeah, I've recently started using Stimulus JS for the odd enhancement to web pages on a personal project. That's far enough.

Interestingly I believe the sendmail config file syntax is Turing complete. You could theoretically create a web app using SMTP as the backend API.


Not OP, but I personally could not use JS, and would outright refuse to use, in production. It's fraught with headaches that seem trivial but drastically change control flow, == and === being my favourite example. Linters help, but it feels like a band-aid solution.

I've had good fun with JS in my own time (where else can you get a GLES window up in 3 lines of code?), and I've written my fair share of helper application that notify me of certain album releases. But I would never ship something using it (and in fact I generally switch to Dart if I get serious enough about a web project, another band-aid solution). It could be preference, or it could be the years of embedded programming expecting timely results with minimum overhead (make no mistake, a modern web browser is a hell of an overhead).


>where else can you get a GLES window up in 3 lines of code?

Everywhere somebody built an abstraction to do it.

#include <SDL.h>

...........

SDL_Init(SDL_INIT_VIDEO);

SDL_Window *window = SDL_CreateWindow("MyApp", 0, 0, 1920, 1080, 0);




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: