upvote
It’s become okay in the past few years after two decades of absolutely Herculean effort of the whole industry and some particularly dedicated individuals.

The foundation is still abysmal, but it doesn’t hurt because you don’t have to look at it anymore or you can use modern facilities instead. Note the striking similarity to what LLMs give you, it’s the same thing on a higher level.

reply
though on second consideration, there was something that was AWFUL about JS in that era - the total confusion about the state of the art. I was getting constantly bombarded with articles about how JS is the future of engineering, how the biggest companies have already transitioned to this or that framework and that is the future.

When learning something new, there's a transitionary era, where you just don't get it, but assume the experts do, and eventually you will as well.

That is unless you're talking about something like quantum mechanics, where not getting it is the sign that you're not smart enough.

And I didn't get it, and I constantly assumed I was two tutorials away from eureka. But no. I suspected that maybe the people dispensing wisdom and confidently decrying how their stuff is better might have been wrong, I thought it was just hubris and hunkered down, and eventually gave up, assuming I can't keep up with the state of the art anymore.

The turning point came when I encountered a bundler bug in a fairly reputable library, and delved into its source - I expected to find some reasonable compiler stuff in there - tokenizing, parsing etc. etc. but what I found was a bunch of regexes and string replacements.

At that point I had evidence that to at least some degree, the patients were running the madhouse, and while VB6 might be deeply unsexy, I highly doubt it's compiler ever featured gems like this (PHPs might have)

reply
I agree. But I am disappointed that none of the initiatives to put another language in the browser came to fruition (except WASM). Something like Ruby would have been nice.
reply
I don't disagree on this; I transitioned from a backend heavy role rendering ASP.NET Razor templates to the bold new world of SPAs in the mid to late 2010s, and some things were genuinely baffling like What do you mean the compiler(bundler) generates invalid code? What do you mean the bundler is unfixably broken, and I should use a different one? Oh, that's unfixable as well?

That framework churn, leftpad, etc. stuff I think is something the JS community will gladly memoryhole. Thankfully, I was rightly repelled by that mess, and fled back to backend, and returned only when things calmed down.

Btw, the pre-SPA era of jQuery is an interesting paradigm, while writing modern TS feels like writing basically any other language.

reply
Javascript is actually a great language. Its garbage-collected closures made it easy to do GUI programming.

The C/C++ world where browsers came from didn't have this (closures). So it is actually a miracle we got a language as (relatively) great as Javascript.

reply
Each to their own I guess, by personally I really don't like closures (at least ones that as per their namesake, close over objects with nontrivial lifetimes).

I think it was the right call by the C++ people to explicitly list what objects are captured and how, even if the syntax's not the best.

RAII is a fact of life unfortunately, not just in C++ or Rust, but if you talk over some high level protocol over the internet you go TCP socket->HTTP connection->your stream protocol; and have to do the exact reverse.

Closures break RAII hard.

Incidentally, you don't even need closures for nice looking UI code. Immediate mode GUIs like Dear Imgui or Clay allow for super-simple looking code in basic C

reply
> Immediate mode GUIs like Dear Imgui or Clay allow for super-simple looking code in basic C

Layout computation is always awkward in immediate guis. You have to do an extra pass or throw away a frame.

reply
Clay's algorithm actually does many passes, that doesn't mean it invokes the UI function multiple times. You are allowed to retain state during computation.

Here's a cool explainer video:

https://www.youtube.com/watch?v=by9lQvpvMIc

reply
> I think it was the right call by the C++ people to explicitly list what objects are captured and how

Having recently worked a lot with Rust, which does this implicitly - I find the explicit notation entirely unnecessary. There's only one choice - are captures moved into closure or passed by reference? - and everything else is inferred. It does lead to some verbose cloning when there are many refcounting pointers at play, but other than that it works flawlessly; I've never been in a situation I couldn't do something I wanted to.

I'm confused by the point about RAII. Why are you saying that closures break it? Personally, I found that closures complement RAII very well - the closure owns its resources, and when it goes out of scope they're all cleaned up automatically. Or do you mean situations where resources outlive the closures? This is no different than any other object that needs a reference to something that lives longer.

reply
It was a missed opportunity for a mature language like Scheme which had at the time all the good parts, none of the bad parts and the only issue was slightly unfamiliar syntax.
reply
I like Scheme syntax but someone coming from a C-syntax background can easily understand this in the first look:

const add = (a, b) => a + b;

And may need to read this a couple of times because of the lone "+" and the parentheses:

(define (add a b) (+ a b))

... and this is the simplest of examples. It's not slightly unfamiliar syntax. Perhaps Rust is slightly unfamiliar syntax, if we mean really just the syntax - as in, you can tell where the functions start and end.

You could also say that Scheme has very little syntax, for example, no distinction between statements and expressions, no operator precedence, and nearly zero reserved punctuation. So I'd argue that it needs more adaptation because it is less.

reply
> the only issue was slightly unfamiliar syntax

I was banished from golang communities when I said that a language should deviate from already established standards only when it has a good reason to do so. I remember it being quite ironic that golang took pride in not overloading names, and then... overloaded the English word "go". It's really unreadable unless you specifically study golang.

I could go on very long how much I hate golang for its stupid syntax alone, even before we dive deeper into its broken features.

Regarding Scheme itself, functional languages never gain traction because both humans and machines think imperatively. Yes, functional languages are a beauty for someone who understands them well, and in some specific use cases, but I still remember that as a student I finished my project, I just needed to add a few prints... oh fuck I need to rewrite the entire thing just to add "print". Never touched functional programming again, except for functional elements in imperative languages.

reply
https://news.ycombinator.com/item?id=44885169 [flagged] [dead]

> "Once on 4chan I read an opinion about golang that isn't suitable for this website and I fully agree." -anal_reactor

Maybe your shouldn't get your opinions about goland from 4chan, or your online personality and ideology either.

Or your opinions about women and masculinity either:

https://news.ycombinator.com/item?id=50599656

> "Some time ago I've seen a comment on 4chan that simplifies things, but has a decent grain of truth in it. [...self loathing misogynistic transphobic incel rationaliztions redacted...]" -anal_reactor

reply
I really like closures, except when you need to debug them because the callstack looks like the leaning tower of Piza.
reply
True. I mean yes, so long as you weren't writing JS for Internet Explorer.
reply
> garbage-collected closures

A feature existed since 1960s...

reply
I don't get the hate for any mainstream language.

I mean, you can hate a language compared to another language, but to the point of making you hate programming? To me, if you do, you probably don't really like programming in the first place. Especially considering that Javascript is a conventional language with variables, conditions, loops, functions, etc... the kind that should be mostly transparent to an experienced programmer.

It would be like a woodworker saying that pine made him hate woodworking, sure, you may prefer to work with oak, but pine is still wood.

reply
> To me, if you do, you probably don't really like programming in the first place.

This is exactly the opposite of the truth.

Programmers don't program because they like variables, conditions, loops and functions. In fact some of the best languages ever created don't have most of those things. Apparently your experience of programming doesn't extend very far given your idea of programming seems to go only as far as those basic concrete concepts.

There is such thing as neatness, elegance and beauty, especially in programming and mathematics. As in other fields it's the people with the least taste and appreciation of that who are the haters, like yourself, because they don't understand the issue at hand.

reply
This is silly. In ruby I can put down my thoughts 4x faster than if was writing JS. The syntax is more readable. etc. Each to their own but can't stand looking at JS nevermind all it's weird quirks we still have to live with.

Your analogy with woodworking is deeply flawed as well. Woodworkers do actually strongly prefer certain types of wood.

reply
deleted
reply
the stdlib is ass, the language is crude (just look at available data types), and the ecosystem is managed by groups of unsupervised children.

> It would be like a woodworker saying that pine made him hate woodworking, sure, you may prefer to work with oak, but pine is still wood.

It would be like woodworker getting dull tools to work and wood being rotten

reply
JS is not the worst language but I would not say it has elegant and consistent design like some other languages do. Not every languages has the list of quirks as long as JS: https://github.com/denysdovhan/wtfjs (but C/C++ have much more foot-guns).
reply
The quirks are almost all to do with the old type coercion features that js has. If you enable linting to ban these features then you remove almost all these quirks and you're left with a modern and mostly clean and consistent language.
reply
I always thought I was too incompetent to understand why JavaScript was a bad language.

I wrote software in js and then moved to ts and sometimes have to go back to js. It’s fine to me.

Ignorance is bliss I guess.

reply
Yeah you won’t get it if you haven’t bashed your head trying to claw your way out from the depths of callback hell. Or any of the dozens of quirks in the language, compounded the hundred different environments it could run in, each with their own special edge cases. Gary Bernhardt, the person mentioned in TFA has another fun talk worth watching called “Wat”.

Eventually with a lot of lipstick on the pig, like async / await, it has become much more tolerable.

reply
I think people both are stuck in the 2000s image of JS, and conflate the language with the ecosystem a lot, as well as with using it where other tech stacks would be so much saner. The latter two things give JS a worse rep than it deserves imo. Although to be fair, if you write JS for work the ecosystem is almost unavoidable, so hating JS for that is somewhat deserved.

Personally, ever since ES5 I really started to enjoy writing javascript, and by now practically all the warts feel quite easy to avoid. I can't say if that's personal mastery or language improvements, probably bit of both.

I still hate the ecosystem though, and always disliked it more than I ever disliked the insane var scoping rules or whatever from twenty years ago.

reply
He said his shift to management happened 5 years into his career, so he wasn't ever very experienced as a programmer.
reply
I think you can become a pretty good programmer even in a year or two, if you start as a teen, have a lot of passion for it, and know what you want to learn.
reply