Live data from Hacker News

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

lea.verou.me

271–280 of 391 posts

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

#271
post #31

sounds like the same experience I have with pretty much every language I'm not used to. I just want to try this C++, download, unzip, oh it's windows so .project file. Fine, redo on windows , oh it's 3 versions of vstuido old and says it wants to upgrade , okay. Hmm errors. Try to fix. Now it's getting linking error. repeat the same with xcode and any project in c, c++, objc, swift okay how about ruby? oh I have old…

I think C and C++ are a fair comparison in that their build ecosystems also a bit of a mess. I offer 3 counter-examples: Rust, Python, and JS-without-NPM.

edit: After reflection, I think Python straddles a middle ground. If you use modern packages and Python 3, it can be a smooth experience. If you use older (improperly-specified) packages, or FFI-wrapped-libs, it can turn into a mess too.

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

#272

Earlier quoted context omitted.

X is not hard, you just have to Y. Be careful of these statements, you have to understand why a person says X is hard. The OP stated he did extensive work trying to get it to work and found it difficult. You posted one link out of thousands. When talking about these things - its not like there's a problem with one solution. There's one problem with thousands of answers that are frustratingly close to correct, but not…

That "one link out of thousands" is the first page of the official docs for pretty much the only complex bit of getting started doing frontend. If people are getting stuck because they're trying to get into something by following a "Frontend stack in 10 minutes!" blog post that introduces 10 dependencies and aims to skip all the actual learning bit in the interest of "getting up to speed" then they fucking deserve to…

I agree with this view, but not everything is black and white. Webpack is hard because it's a tooling, and a big and complex one at that. And usually it lacks resources other that official documentations in which can be used to learn/debug it.

However your view is also correct. They're too overwhelmed with the capabilities and complexities of webpack that they missed how there are hundreds of working webpack configuration for react etc, that they can use as reference, or how easy it is to be configured when you follow the tutorial and know what is babel, loader, presets, etc.

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

#273

The examples in the article are all realistic, but I'd like to add something important: This is using the NPM ecosystem and JS dependencies. A language's tooling and ecosystem are arguably part of the language itself for practical purposes. So, the article is a fair assessment. I'm making this distinction because you can use JS in what it accels at without invoking build tools and dependencies: As an imperative langu…

> I'm making this distinction because you can use JS in what it access at without invoking build tools and dependencies.

Theoretically, yes. Practically, no, because almost all javascript code is written in typescript, packaged into modules and distributed on NPM nowadays. There's the tiniest inking of a "vanilla js" movement out there, but otherwise all of the libraries and tutorials and advice assumes that ecosystem is a given.

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

#274

Earlier quoted context omitted.

I have, but to be honest I've forgotten a lot of the specific debates and their finer points. I don't have a single, definitive, clear solution -- as pointed out by others -- nobody does. It's not a simple problem. That doesn't mean that steps can't be taken to improve the situation, perhaps dramatically in some cases. 1) Enforced MFA to publish a crate -- credential theft is semi-regularly seen as an attack vector.…

Good answer. Here is one more, and I got to say I am really unsure why it isn't done this way: Check each update to a crate for the usage of a TCP / HTTP / UDP stack usage. There is absolutely no reason a crate for math (for example) should be introducing any of that in its code. If you catch something like this, you can be 99% sure it's malware. Or even better, make crates request permissions for what kind of functi…

Transitive crate "permissions" would be amazing. To know at a glance if a crate does networking, filesystem access, IO, etc.

Someone could always roll their own IO, but self reporting and automated detection tooling (to catch those that slip through the cracks) would bring this percentage way down.

Maybe the language could even evolve "unsafe" for IO, even if just as a flag for users. That way it would all be incredibly easy to audit.

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

#275

The author encounters four problems trying to approach a programming task: 1) A problem common to every programming language (feature introduction/deprecation compatibility conflicts w.r.t. import/require) 2) A security issue around browser filesystem access (not-JS related at all: HTTP content-type sniffing) 3) A usability issue with the VSCode IDE (not JS related) 4) A bug in a single JS module Concludes this is al…

[deleted]

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

#276
post #31

sounds like the same experience I have with pretty much every language I'm not used to. I just want to try this C++, download, unzip, oh it's windows so .project file. Fine, redo on windows , oh it's 3 versions of vstuido old and says it wants to upgrade , okay. Hmm errors. Try to fix. Now it's getting linking error. repeat the same with xcode and any project in c, c++, objc, swift okay how about ruby? oh I have old…

this is why i love docker :D

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

#277
post #208
post #193

Earlier quoted context omitted.

A big issue is that 10 or 20 years ago the steps for creating a webpage were simple: just open notepad (or whatever) and put some HTML. Today you "gotta" install node, yarn, webpack, react. Then you gotta make a package.json and configure webpack. Or replace webpack with something called "crap". At least that's what all the "for beginners" tutorials that everyone recommends says! Nobody ever said I could just use not…

You can still do a webpage just like you did 20 years ago, inserting a couple HTML tags in a notepad. Now the scope of what a webpage is capable of is infinitaly larger, and so is the complexity required for using all the new possibilities. If you want to use advanced stuff without learning the basics, than of course you're going to have a bad time.

3rd party JS code used to be snippets you were expected to copy-paste into your own code, or whole files you were expected to save and then load with a tag before your own code.

Now there are like 50 ways to import JS code, most of them don't work most places, a lot of the code itself won't work in a browser at all (node-only), and a great deal of it is a pain to get into a browser if you're not fully bought into Node and probably also serving the whole "app" from Node.

It's about as easy to write your own JS in a browser, now, but it's vastly harder to start using code from the overall JS ecosystem.

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

#278
post #162

Earlier quoted context omitted.

It is not quite hard to learn actually. You just need to go through the webpack Concepts section[0]. Documentations in the JavaScript ecosystem are quite good and explanatory compared to other languages (like Java). Not every front-end developers learn the internals of the tool they chose, like create-react-app. Most of them settled down if the solution "just work". [0]: https://webpack.js.org/concepts/

X is not hard, you just have to Y. Be careful of these statements, you have to understand why a person says X is hard. The OP stated he did extensive work trying to get it to work and found it difficult. You posted one link out of thousands. When talking about these things - its not like there's a problem with one solution. There's one problem with thousands of answers that are frustratingly close to correct, but not…

He’s saying X is not hard if you read X’s docs.

I don’t think that’s unreasonable.

What’s unreasonable is this culture in web dev that you shouldn’t have to read the docs!

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

#279

Earlier quoted context omitted.

You've obviously thought about this quite a bit... Do you have any ideas as to how projects could avoid this problem?

I have, but to be honest I've forgotten a lot of the specific debates and their finer points. I don't have a single, definitive, clear solution -- as pointed out by others -- nobody does. It's not a simple problem. That doesn't mean that steps can't be taken to improve the situation, perhaps dramatically in some cases. 1) Enforced MFA to publish a crate -- credential theft is semi-regularly seen as an attack vector.…

I work with a lot of .NET Framework legacy code. Those nuget packages have even more useless links, I’ve had both official packages 404ing (to be fair, making their own links 404 is a specialty of Microsoft, for documentation they have the opposite approach as for windows, nothing should be backwards compatible -.-) but more often link to some modern .NET core (or .NET 6 now I guess) and thus be completely unrelated.

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

#280
post #118

Earlier quoted context omitted.

Have you ever actually tried to do this? Programmers are extremely opinionated people. If you somehow manage to get past the barrier of "pretending to look smart so you can even ask a question without getting flamed to hell and back (hello, stackoverflow!)" you will be met with people suggesting different things, which quickly devolves into a giant argument about which thing is better and why this guy is so stupid fo…

I'm one of those learners and this is true to an extent. But there's fantastic people in r/learnprogramming for example. Even better than the Discord of the self-paced bootcamp I'm doing... But the complexity is real. I'm learning Django, which is supposedly easy, and it's a completely different beast than learning the in and outs of a language. And Django has good documentation, for some libraries it's a mess.

You picked a tough spot to start!
Post reply on HN