Live data from Hacker News

Today’s JavaScript, from an outsider’s perspective (2020)

lea.verou.me

221–230 of 391 posts

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#221

It's still mostly the same. Nothing much has happened in the JS space in the last 2 years that would make all this easier. The JS ecosystem suffers from a huge issue of duplication. There's multiple module systems, multiple ways to make a function, multiple ways to make a class, multiple ways to make a variable, multiple ways to loop over the array. Some of those exist in other languages as well but it's pretty bad i…

> The module system fragmentation is the worst thing that can happen to a language. Unfortunately, I haven't seen anything remotely close to a bridge between CommonJS & ESM so both can coexist peacefully. If you turn towards one, node starts screaming about how ESM modules can't contain require and if you go the other way, well then CommonJS doesn't have import.

It's possible it's more confusing on backend node, but on my current frontend project I can import any module without caring what type it is. Yes, I have to pick one import syntax, but I'm not sure why I'd want to mix them.

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#222
post #49

I think the problem was using Node in the first place - most the article is fighting node + NPM nonsense. I personally try to avoid Node + NPM where I can these days, and use Deno for backend stuff since it is much more sane IMO. I've never heard of people putting typescript into a .js file - is that some node thing? Modules in the browser for vanilla JS is a delight and Just Works though. I've started doing it recen…

I completely disagree with this as someone who's spent a significant number of hours bashing my head against the same issue and reading tons of GitHub issue threads It seems to come down to the es module spec being half baked so that it's not possible to implement them in a backward compatible way with the rest of the nodejs ecosystem I'm not sure what the solution is, but I no longer use any packages which export on…

You made a similar comment elsewhere about ES6 being "half-baked", and I'll ask my question again here:

Can you explain more what is half-baked about ES6 modules? To me the logic and syntax of how imports [1] and exports [2] are organized seems clean, but maybe I'm missing something?

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

[2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#223
You don’t really have to get an outside’s perspective. I’m a literally JavaScript developer with a long career and I’m still incredibly annoyed by the state of JavaScript tooling. Fixing those errors on larger projects isn’t exactly a walk in the park either. I constantly find broken packages because people simply don’t understand how Node ESM work.

Every build tool has had a decade to figure ESM out and they still all suck at it. Rollup is the only “somewhat” savior because it’s “almost” ESM-only.

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#224
Package management just breaks package management and software distribution most of the time. It just shouldn't be used, when not necessary.

Just put your things (and the dependencies) into a single downloadable folder.

Especially with javascript, it is one of the most stable things ever, everything written in the past 27 years just runs on every device, on every environment, without any problem. Heck, you can't even navigate yourself into troubles, i bet if you reverse some javascript files, browsers still will figure it out. Try that with any other top TIOBE languages.

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#225

It's still mostly the same. Nothing much has happened in the JS space in the last 2 years that would make all this easier. The JS ecosystem suffers from a huge issue of duplication. There's multiple module systems, multiple ways to make a function, multiple ways to make a class, multiple ways to make a variable, multiple ways to loop over the array. Some of those exist in other languages as well but it's pretty bad i…

This "duplication" allows tooling, libraries and ideas to compete with each other and evolve.

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#226
post #72
post #63

This thread is also a good read: https://twitter.com/Aella_Girl/status/1522633160483385345 Shows that a lot of people, ESPECIALLY programmers, vastly overestimate the competence of the average person when it comes to whatever they are an expert at. You may think that this person is silly - but that is tainted by your past experience of already knowing it warping what you think the baseline average knowledge level is…

Was going to edit this in but it quickly turned into a related rant about the state of things: if you don't want that, scroll past. The real problem is that there's no more room for the technological "middle class". We've gotten to the point where you cannot be SLIGHTLY interested in computers, want to make a quick app for yourself, or make something small to share with the world. You either have to have no interest…

I’m pretty sure you can still write some js and load it into the browser or node. The issue is that 10 small instructions become a hundred (thankfully) and so if you read the wrong article you will be lost.

If this guy was told to use `require` instead of `import` it would have most likely just worked. The instructions were wrong so he failed.

Even back then though you still needed to RTFM. The first time I wanted to do a bubble menu (the one that follows your cursor, focusing an item of the menu) I was redirected to Flash.

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#227
post #72
post #63

This thread is also a good read: https://twitter.com/Aella_Girl/status/1522633160483385345 Shows that a lot of people, ESPECIALLY programmers, vastly overestimate the competence of the average person when it comes to whatever they are an expert at. You may think that this person is silly - but that is tainted by your past experience of already knowing it warping what you think the baseline average knowledge level is…

Was going to edit this in but it quickly turned into a related rant about the state of things: if you don't want that, scroll past. The real problem is that there's no more room for the technological "middle class". We've gotten to the point where you cannot be SLIGHTLY interested in computers, want to make a quick app for yourself, or make something small to share with the world. You either have to have no interest…

I've been programming on the web since 1997. All the techniques developed since then still work. I still have a couple of "web 2.0" websites I've developed running at work... because while I nominally have all the language skills, I only dip my toes into the chaotic world of "the latest JS best practices" a few times over the years and have not been able to justify the effort of keeping up when it is changing at a higher frequency than I have needs. If someone drops me into a functioning project I can adapt quickly, but starting from scratch has become virtually impossible in any reasonable period of time anymore.

This really only hurts with UI stuff. Other JS I can write just fine; pure Javascript in the browser has gotten pretty powerful, it all but has jQuery built in now, you've got XPath, a templating language (simplistic, and needs a bit of XSS care, but adequate for small needs) and a lot of other useful things all just sitting there, but if you want a big widget setup there's a huge learning curve to get there, even for an expert programmer.

For the novice, "classic web" would still be a very powerful thing to learn that isn't too hard, but it's hard to find those references now underneath the pile of not quite functional tutorials, broken install instructions, entirely different languages creeping in (Typescript), etc. It's a total disaster for someone trying to learn this way.

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#228
post #72

Earlier quoted context omitted.

Was going to edit this in but it quickly turned into a related rant about the state of things: if you don't want that, scroll past. The real problem is that there's no more room for the technological "middle class". We've gotten to the point where you cannot be SLIGHTLY interested in computers, want to make a quick app for yourself, or make something small to share with the world. You either have to have no interest…

I've started programming around 10 year ago without any Visual Basic code. There are so many more resources nowadays to get started programming, back in the day there was no way in hell you'd get something like repl.it where you don't even need to install anything. What stops you from creating the most simple html page and playing with CSS? That counts as programming to me, there's also scratch for people who are com…

Not to be an ass, but playing with css and html isn't programming. At all. It's making web pages. The web is so universal today that many people conflate "making web pages" and "programming". And there's nothing really wrong with that _if your goal is to learn to make web pages,_ but I'm pretty sure there are still more than a few people out there who want to solve problems with code, or just learn to code, with little or no interest in the web. Telling them to start with html + css is kind of like telling an aspiring painter that it's easy to start making sketches with a pencil and paper.

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#229
To me this reads like "I'm a programmer, I can just pick this up without understanding the environment I'm working in."

That's not a justification for whatever they ran into, but I suspect is the reason for many of the issues.

If I thought I could just write some C... I probably couldn't and nobody would think twice about that.

Re: Today’s JavaScript, from an outsider’s perspective (2020)

#230

Earlier quoted context omitted.

Read the rest of this persons twitter, or their website for that matter. No I don’t think there is anything enlightening whatsoever about their experience “trying” to learn to program. They spent 10 minutes installing the interpreter, and then got upset for their social medial followers because they weren’t immediately able to write software to do something useful with their CSV. I cannot think of any other disciplin…

I think the problem here is that there's so many tutorials, articles etc telling people that if they want to do data analysis then the best way is to use Python without making it clear that this advice is predicated on you already having a programming education. If you start with a CSV file and want to do some analysis, without knowing programming, then you need to using a spreadsheet app, but this context isn't bein…

It's no different in woodworking. I'm constantly turned off when I try to start by the fact that basically every easy-to-find woodworking tutorial assumes you have 3-4 different power saws already ready to go in your garage. It's hard to find content that gets you started with basic tools on small, inexpensive projects.

Experts in any field are usually terrible teachers because they don't understand anymore what it means to be a beginner.

(As an aside, I'd love suggestions for woodworking content that does start small.)

Post reply on HN