Live data from Hacker News

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

lea.verou.me

141–150 of 391 posts

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

#141
post #28

I always go into these things hoping the outsider will be an Amish farmer or professional welder, but it always turns out to be just another programmer.

in what scenario an amish farmer, a professional welder, or, well, anything but a programmer, would know anything about this "javascript" thing?

>in what scenario an amish farmer,

I was hoping a young Amish farmer goes on his rumspringa to decide if he wants to continue on as Amish farmer, he likes the modern world well enough but is so scarred by the JavaScript experience he runs back to the safety of the church, never to stray again.

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

#142
post #131

Earlier quoted context omitted.

An astonishing number of people here are missing the point. Doing something like "making a small script to analyze CSVs" has become a massively complicated undertaking requiring you to follow random guides that might be 6 months old (practically half a century in these circles), install random programs and dependencies using other random programs and dependencies that you don't even understand, and do many steps that…

Manipulating csv has become way easier than it was. You have: 1. Spreadsheets where you can import this data and manipulate it visually 2. CLI tools made especially to work on csv, with fancy colors, shortcuts, examples 3. Visual tools for data analysis like google data studio, power bi etc. Where you basically dragon drop the data and pick charts 4. RStudio where you can load your data using file->open and then copy…

swear to god if one more person talks about the specifics of this illustrative case, and then goes on to explain how they are so silly and should have used tool "xyz" my head is going to explode

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

#143
post #46

Earlier quoted context omitted.

My old go code doesn't compile anymore with the newer compiler versions

What was it that broke it? Usage of unsafe? Security and bug fixes in the compiler/tooling? Just interested.

I didn't try for a long time I have a hard time remembering. I believe it had something to do about how it handles dependencies.

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

#144
post #89

This is exactly my issue with all this modern JavaScript / Node-stuff. The boilerplate just to get the simplest thing started is brutal. Now I'm dealing with some Vue3/Quasar/TipTap stuff, and I still don't know what exactly I have there, but just that it is working somehow. Python is such a pleasure to work with that I wish that all this modern web stuff were more like it.

I'm not a fan of node, but python is horrible in this regard, especially with package management and environments. I'd take "make random js code work" to the python equivalent any day, which is already a bigger challenge nowadays because of the chaos caused by the ES module transition. Other challengers are C++ (because people get creative), C# (1000 different runtimes and library support) and Java (I don't know where to start).

I have a love/hate relationship with Go but this is the area where it shines.

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

#145
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…

For this profile, a fully integrated environment like Squeak/Pharo or Racket would be a better option. Perhaps even just Emacs! :-)

I won't disagree with you about the needless complexity, but OTOH programming does have a certain level of essential complexity, and profanes don't realize that "just upload the CSV" is fundamentally not an easy task; think about what you'd need to do if you were to do it from scratch in assembly. Lines in a text file is not something "the computer" or many OS have a concept of. I think a few developers could ragequit.

Of course, there is the "batteries included" solution - that is gluing together libraries with a simple language. Here I would rather see something like Lua rather than Python because OO is already an interference for normies. This is doable, the particular failures of Python here (or any of the languages I've mentioned) are to blame on Python's ecosystem (perhaps being too normie-friendly is a curse, because you sometimes end up with poorly done tools and libs - I see it in Lua too).

One last word: I learned programming from books alone with Basic (back in the days when phones had wires and I didn't have to shave). The books provided the source of simple games that I were to type in (Basic was a CLI but you could list and edit lines, better than the "Python Box" :-), test and then hack. This is a much easier approach than starting from scratch, and by the end of the Twitter thread it seems that this is what this person eventually came to - people would give them a basic program they could hack.

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

#146
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 all the fault of "modern Javascript", gives up.

> What hope do actual novices have?

Programming is a profession requiring learning from experience - if a novice doesn't have the patience to overcome very small speedbumps like this on a daily basis while learning a new domain, this might not be a good path for them.

Don't get me wrong, there's A LOT about the modern JS ecosystem that could be improved from a UX perspective, but... it's not these things. I don't think any of the 4 bullets above are avoidable: (1) is a painful but necessary migration incompatibility is an unfortunate reality, the only alternative of which is to stagnate and never introduce/deprecate breaking features ever. (4) is human error - it happens. The others aren't JS-related at all.

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

#147

Earlier quoted context omitted.

Meanwhile I've been trying to warn the Rust project team, or more specifically, the Cargo/Crates teams that they're cheerfully skipping down the easy/happy path towards the same mess. It's inevitable that the conclusion will be the same if the same steps are taken in the same direction. The counter-arguments fail to recognise the special case of "most of us are from Mozilla and we all get along[1]", "no-one has attac…

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.

2) Strong links between the "source ref" and the specific crate versions. An example of this done super badly is NuGet. All of the hundreds (thousands?) of Microsoft ASP.NET packages point to the same top-level asp.net or .net framework URLs. E.g.:

https://www.nuget.org/packages/Microsoft.Extensions.Configur...

Links to "https://dot.net" as the Project Website, and "https://github.com/dotnet/runtime" as the repository. This couldn't be more useless. Where is the Git hash for the specific change that "7.0.0-preview.4.22229.4" of this library represents? Who knows...

3) Namespaces. They're literally just folders. If you can't code this, don't run a huge public website. This is more important than it sounds, because wildly unrelated codebases might have very similar names, and it's all too easy to accidentally drag in entire "ecosystems" of packages. Think of the Apache Project. It's fine and all if you've "bought in" to the Apache way of doing... everything. But imagine accidentally importing some Google thing, some Netflix thing, some Apache thing, and some Microsoft thing into the same project. Now your 2 KLOC EXE is 574 megabytes and requires 'cc', 'python', and 'pwsh' to build. Awesome.

For example, in ASP.NET projects I avoid anything not officially published by Microsoft and with at least 10M downloads because otherwise it's guaranteed to be a disaster in 5-10 years. Ecosystems diverge, wildly, and no single programmer or even a small group could possibly stitch them back together again. Either it's a dead end of no further upgrades, or rip & replace an entire stack of deeply integrated things.

4) Publisher-verified crate metadata / tags. You just cannot rely on the authors to be honest. It's not even about attacks, it's also about consistency and quality. All crates should be compiled by the hosting provider in isolated docker containers or VMs using a special "instrumented build" flag. Every transitive dependency should be indexed. Platform compatibility should be verified. Toolchain version compatibility should be established for the both the min and max range. Flags like "no-std" or whatever should be automatically checked. CPU and platform compatibility would also be very helpful for a lot of users. The most important one in the Rust world would be the "No unsafe code" tag.

This would stop "soft attacks" such as the guy spamming C++ libraries as Rust crates. Every such crate should have been automatically labelled as: "Requires CC" and "Less than 10% Rust code".

Similarly, if a crate/package changes its public signature in a breaking way, then the publishing system should enforce the right type of semantic versioning bump.

Essentially, what I would like to see is something more akin to a monorepo, but not technically a single repository. That is, a bunch of independent developers doing their own thing, but with a cloud-hosted central set of tooling that helps gain the same benefits as a monorepo.

I'm expecting a lot of arguments along the lines of "that sounds like a lot of work, etc..." Meanwhile Mozilla had a large team for this, millions of dollars of funding, and did not do even 0.1% of what Matt Godbolt did in his spare time...

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

#148

We just need all this tooling to go in the browser.. which is where it always belonged. That was the purpose of JS. To "just run" in the browser. It's getting there but very slowly. As for my own rant, simply the fact that Microsoft, of all places are the ones who run TypeScript and now the proposal to add TS to native JS.. is part of the issue. MS has zero imagination. JS needs native typing and it shouldn't be done…

TypeScript and C# are both great languages from Anders Hejlsberg. The Danish know how to design a language, C# developer was Mads Torgersen. Microsoft employs them so they want it used more and people like it.

Fun fact: Anders Hejlsberg also designed Turbo Pascal, Delphi which were huge in their day.

I agree though, JS needs to just run in the browser. All the tooling is really a leaky abstraction or unnecessary guts that get in the way. Rant: Webpack is an abomination to anything simple and clear, many dev hours are lost on it.

I still think if ES4 hadn't been cancelled for ES5 we'd be in a better place. It had amazing typing, event handling and was very clear, essentially looked like TypeScript. Browsers could have easily supported ES3 and ES4, we'd have a more solid browser "just works" setup.

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

#149
post #88
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…

> needlessly complicated IMO this is unfair characterization. If using Photoshop is driving, programming is building an internal combustion engine vehicle. You cannot expect to just randomly google for car-making tutorials and get an SUV done in a weekend. Heck, you can't even expect to be able to build a very simple combustion engine from basic principles without a lot of study. I'm not saying this is Aella's fault…

I don't think this is a good analogy.

Not every programming project is a project that takes hundreds of skilled engineers. Not every programming project needs to deliver a product for others to use.

What Aella wants to do is something pretty simple, and it's frustratinc that this is so hard.

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

#150
post #89

This is exactly my issue with all this modern JavaScript / Node-stuff. The boilerplate just to get the simplest thing started is brutal. Now I'm dealing with some Vue3/Quasar/TipTap stuff, and I still don't know what exactly I have there, but just that it is working somehow. Python is such a pleasure to work with that I wish that all this modern web stuff were more like it.

If you try simple vanilla javascript, then you may be surprised at how pythonic it is in cerain ways - e.g. just open a browser (any browser!) and you have a javascript REPL read to go in the developer tools. Node severely complicates and confuses things, but node alone is not javascript. Vanilla JS is IMHO a very nice and expressive language, and you do not need any of the Node/Webpack/React/Vue/jquery/whatever to d…

Python is a mess too! There is pip which works great(if you’re lucky), but then the scientific community moves to a different variant of cinda like every two months, which just isn’t necessary usually and way more complicated than just using pip
Post reply on HN