-
6 votes
-
JavaScript bloat in 2024
51 votes -
Node's "Single Threaded, Event Driven" programming model seems highly deceptive and farcical
The more I think about it, the more I'm convinced of it. The biggest selling point of Node folks has been the "single threaded, event driven" model, right? Unlike JavaScript, other languages work...
The more I think about it, the more I'm convinced of it.
The biggest selling point of Node folks has been the "single threaded, event driven" model, right? Unlike JavaScript, other languages work on a "blocking" basis i.e. you run a statement or command and the program "waits" until the I/O is complete. For example, you issue
open('xyz.txt', 'rb').read()
in python and the program waits or blocks until the underlying driver is able to read that whole text file (which could take arguably long time if said file is too large in size).But with the Nodejs equivalent, you just issue the statement and then pass the "event handler" so that your program is never in the "waiting state". The whole premise of Node/JS event-callback is that "you don't call us, we will call you".
This is all nice in theory but if this were indeed true then Nodejs scripts should be blazing fast compared to Python and even Java considering that most programs we write are I/O heavy and 99% of time, they're just waiting for an input from a File/URI/User? If this event callback model indeed worked as effectively as claimed, Node would have been the numero one and only language being used today?
I think I'm starting to understand why that isn't the case. This whole "single threaded, event driven" thing is just a farce. You can also replicate the same thing that Node.js is doing in your Java or Python too by applying multi-threading (i.e. one thread just "waits" for the I/O in the background while the other keeps doing its job). All you've done here is just handed or delegated that complexity of multi-threading to Node.js?
Realistically, it's impossible to wait or block an I/O request while at the same time also letting the other part of the code engage in other tasks, that's the very definition of multi-threading. Doing "async" is impossible without multiple threads in that sense. Node must have a thread pool of sorts where one of them is engaged in the wait/block while another is running your JS code further. When the wait is over, the control is then passed to the "event handler" function it was bound to in that other thread.
What Node is selling as "single threaded" applies to application or business logic we are writing, node itself can't be single threaded. I feel it's better to just implement multi-threading in your own code (as needed) instead of using something convoluted and confusing like Node.js. What say you?
8 votes -
Announcing TypeScript 5.3 Beta
12 votes -
Announcing TypeScript 5.2
8 votes -
Announcing TypeScript 5.2 RC
10 votes -
Introducing TypeChat
19 votes -
Announcing TypeScript 5.2 Beta
6 votes -
The Javascript Gom Jabbar
7 votes -
UnsuckJS : Progressively enhance HTML with lightweight JavaScript libraries
4 votes -
Build Your Own: React, ProseMirror, and Redux
12 votes -
What is the present state of NPM Packaging System?
As I recall, about 2-3 years ago I had experimented with what is called the npm install xyz through some tutorials, etc. The objective was to improve my tooling or toolchain at least with things...
As I recall, about 2-3 years ago I had experimented with what is called the
npm install xyz
through some tutorials, etc. The objective was to improve my tooling or toolchain at least with things like css/js minification, etc. along with Bootstrap customization. The idea was to then move on to other newer learnings like react, etc.But I was soon disgruntled by the whole process! Neither bootstrap turned out to be an easy horse to tame, and NPM was like this astronomical universe of packages that keep on downloading into your folders! I soon lost taste of the whole thing and kept using my tried and tested stack of PHP scripts and using stock Bootstrap through CDNs.
But today, I want to give it another shot. Has NPM improved than earlier days? What is the best way to go about building a toolchain using it? Are there any useful guides that make the whole process easier to digest?
6 votes -
First impressions using Astro
4 votes -
JavaScript physics engine for the absolute beginner
1 vote -
Looking for a Simple WYSIWYG Editor for my Blog
I'm going to be building a simple blog for myself. Partially I just want something really simple and customizable, and also it will be a fun little programming project. I'll be using PHP and mySQL...
I'm going to be building a simple blog for myself.
Partially I just want something really simple and customizable, and also it will be a fun little programming project.
I'll be using PHP and mySQL for the backend. I won't be using any sort of framework as it shouldn't be necessary for a very simple blog. I'm fairly comfortable with JavaScript.
What I'm imagining is some sort of JavaScript library I can just download, link to my html and then turn a textarea into a simple wysiwyg editor. It could be as simple as a markdown editor or something with a little more features.
It has to be free. Open source would be a plus.
If anyone has any recommendations or advice I would be very grateful. Thanks!
5 votes -
A proposal for type syntax in JavaScript
10 votes -
Breaking of "colors" and "faker" NPM libraries show that everything isn't right in the FOSS ecosystem
7 votes -
Microsoft unveils 'Super Duper Secure Mode' in latest version of Edge
6 votes -
A reality where CSS and JavaScript don't exist...?
8 votes -
Announcing LittleJS - The tiny JavaScript game engine that can
10 votes -
Microphone Audio Spectrogram
2 votes -
A modern boilerplate for Vite, React 17, and TypeScript 4.3
2 votes -
Observable Plot
2 votes -
TeXMe Demo: Self-rendering Markdown + MathJax documents
6 votes -
What features do you want to see in a userscript manager?
I'm currently developing a minimal userscript manager who's main goal is to be fully auditable by any user in only ten minutes or so - my prototype uses less than 300 lines of javascript, and I'm...
I'm currently developing a minimal userscript manager who's main goal is to be fully auditable by any user in only ten minutes or so - my prototype uses less than 300 lines of javascript, and I'm trying to keep it that way.
To get the codebase this small, however, I have to be very picky with what features I implement - most notably, the code editor has to be very barebones. Are there any features that I'd be shooting myself in the foot by not including?
For example:
- syntax highlighting
- cloud sync
- regex url matching
- fullscreen editor (currently, it's just a browser popup - the intention is that you write code elsewhere and paste it in)
Any feedback is greatly appreciated!
7 votes -
A look through some of the new features and updates in Vue.js 3
9 votes -
A case study on vanilla web development
10 votes -
An explanation of JavaScript modules for grumpy developers from 2005
7 votes -
Moment.js is now considered to be a legacy project in maintenance mode - Reasons you might want to keep using it, and recommendations for what to use instead
14 votes -
An exploration of Project Zero Issue 2046, a seemingly unexploitable and simple bug in the V8 JavaScript engine that turns out to be exploitable in a very complex manner
7 votes -
Svelte & Capacitor - Build hybrid mobile apps with livereloading and access to device APIs
4 votes -
Announcing TypeScript 4.0
13 votes -
Welcome To OS13k – A Tiny Web Based OS and Game Engine
8 votes -
1Keys: my 1 kilobyte JavaScript piano is open source on GitHub
17 votes -
Let's celebrate 4th of July with fireworks! Only 60 lines of pure JavaScript
10 votes -
Create No-JavaScript friendly sites
22 votes -
Comprehensive guide on the JavaScript tooling system by MDN
5 votes -
Free open source app to create GitHub issues faster
4 votes -
Easy JavaScript unit tests in WordPress with Jest
3 votes -
I created a simple JS library for the Johns Hopkins University CSSE COVID-19 data
8 votes -
Promise.all vs Promise.allSettled
3 votes -
Making of Impacts – Programming ⋂ Art
6 votes -
The cost of JavaScript frameworks
5 votes -
Wikimedia RFC: Adopt a modern JavaScript framework for use with MediaWiki
6 votes -
GitHub acquires npm
26 votes -
The main Avast antivirus service contained a custom JavaScript interpreter, enabling wormable pre-auth RCEs. Avast has now disabled the emulator in response to a vulnerability report
13 votes -
Why the world needs CSS developers
6 votes -
Fixing memory leaks in web applications
6 votes -
Why JavaScript is eating HTML
33 votes -
TSLint will be deprecated by the end of 2020 in favor of ESLint
7 votes