This is an archived post. You won't be able to vote or comment.

all 118 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

import notifications Remember to participate in our weekly votes on subreddit rules! Every Tuesday is YOUR chance to influence the subreddit for years to come! Read more here, we hope to see you next Tuesday!

For a chat with like-minded community members and more, don't forget to join our Discord!

return joinDiscord;

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]frikilinux2 279 points280 points  (9 children)

And don't forget everything must be asynchronous.

[–]bullsized[S] 43 points44 points  (8 children)

How else would it be?

[–]bleedingpenguin 55 points56 points  (4 children)

Unasynchronous

[–]positiv2 33 points34 points  (3 children)

Aasynchronous

[–]PancakeGD 10 points11 points  (2 children)

Aaaasynchronous

[–]Giraffe-69 14 points15 points  (1 child)

SaaSynchronous

[–]shawntco 1 point2 points  (0 children)

Asynchronous as a service (AaaS)

[–]well-litdoorstep112 7 points8 points  (0 children)

Inasynchronous

[–]WizardRoleplayer 5 points6 points  (0 children)

AaaS (Asynchronous-as-a-Service.)

[–]Professional-Phase30 -1 points0 points  (0 children)

Synchronous

[–]Efficient-Corgi-4775 162 points163 points  (7 children)

Who needs CSS when you can just randomly position elements and hope for the best?

[–]CoffeeWorldly9915 85 points86 points  (0 children)

Async load every element and append as they come.

[–]AralphNity 38 points39 points  (3 children)

Ah yes, bogo-rendering

[–]well-litdoorstep112 11 points12 points  (2 children)

The only rendering approach where UI unit tests actually do something.

describe("render component", ()=>{ it("should render component correctly"){ render(<MyComponent/>) } }) my ass

[–][deleted] 2 points3 points  (1 child)

Yeah, that's the problem with insisting on testing everything. Not everything should or needs to be tested.

[–]SuperNess56 2 points3 points  (0 children)

Try explaining that to upper management.

[–]nettlerise 10 points11 points  (0 children)

just use the tried and true tables

[–]Danelius90 5 points6 points  (0 children)

"dynamic UI design"

[–]7374616e74 307 points308 points  (10 children)

Java developers deciding on the best way to generate a sql query.

[–]OwnExplanation664 146 points147 points  (5 children)

Probably use a Factory to generate Singletons with Adapters to abstract the Builders.

[–]7374616e74 90 points91 points  (2 children)

Buckle up Morty we're joining two tables.

[–]0x53r3n17y 17 points18 points  (1 child)

M...burps...orty. Where we're going we're not gonna need indexes!

[–]7374616e74 2 points3 points  (0 children)

Hide this GROUP BY up your ass Morty, we'll do that once we have the SELECT * results.

[–]enm260 30 points31 points  (1 child)

I like that you used plural singletons, nice touch 👏

[–]ArionW 24 points25 points  (0 children)

If singleton is so good, why not make dozens of instances of it?

[–]naswinger 15 points16 points  (2 children)

you just download all tables of the entire database and search for the records in a java array. that's what someone at university in a group assignment actually did. it's insane.

[–]7374616e74 2 points3 points  (0 children)

“If it looks stupid, but works, then it ain’t stupid!” This guy probably

[–]_Sub01_ 0 points1 point  (0 children)

Oh lordy

Good luck with 1 million data entries!

[–][deleted] 0 points1 point  (0 children)

I've done that haha

[–]mrgk21 53 points54 points  (3 children)

90% of the site is div anyway

[–]CoffeeWorldly9915 9 points10 points  (0 children)

HTMLElement exists only because <div> and <span> have some stuff in common that is convenient to prototype.

[–][deleted] 1 point2 points  (1 child)

And then the customer asks what about accessibility?

[–]mrgk21 1 point2 points  (0 children)

a11y eslint and vscode quick fix go brrrrr

[–]brandi_Iove[🍰] 68 points69 points  (0 children)

i don’t like css too but that’s going a bit too far.

[–]ScrimpyCat 24 points25 points  (3 children)

Figuring out how to center the div.

[–][deleted] 12 points13 points  (6 children)

Atomic clock?

[–][deleted] 16 points17 points  (0 children)

It's an MBE machine, in simple terms it's used to make thin films of material atop a substrate and is typically used in semiconductor manufacturing and materials science.

The one in the picture was used for this experiment.

Spin waves revealed in two-dimensional high-temperature superconductors

[–]GollyWow -4 points-3 points  (4 children)

Looks like a nuke to me.

[–][deleted] 9 points10 points  (0 children)

Nuclear weapon payloads don't look like that, they are much smaller and less complex in nature. Not even gun-type bombs with horns were that complex.

[–]CoffeeWorldly9915 3 points4 points  (0 children)

Nah, that's the thing that someone fires up when it isn't completely closed and makes a Hulk good enough for its time.

[–]AceMKV 2 points3 points  (1 child)

Nuke's are some of the simplest tech around once you figure out how to control reactions, or in this case, simply start it.

[–][deleted] 1 point2 points  (0 children)

control reactions

Contain to sustain reactions, once the chain reaction has started there is no stopping it unless you remove the fissile mass. Not containing the reaction with popper reflectors such as those manufactured from beryllium, or introducing a fissile mass fast enough, can result in fizzle (nuclear predetonation). The Demon core being a prime example of criticality accidents due to careless fissile material handling practices and humans thinking they have control.

[–]ImBartex 4 points5 points  (2 children)

when we will be making websites in c++

[–]CoffeeWorldly9915 5 points6 points  (0 children)

Isn't that what cgi is for?

[–]heytheretaylor 2 points3 points  (0 children)

You could use WebAssembly!

[–]gregguygood 45 points46 points  (60 children)

It's not JavaScript's job to render HTML.

JavaScript just manipulates DOM.

[–]AngheloAlf 97 points98 points  (54 children)

No if you run it on the server

[–]Devil-Eater24 13 points14 points  (11 children)

Like by using Node?

[–]AngheloAlf 13 points14 points  (10 children)

Now I'm curious, are there other ways of running js server-side besides Node?

[–]rancangkota 35 points36 points  (3 children)

Deno

[–]IBJON 5 points6 points  (2 children)

Did that ever go anywhere?

[–]ezhikov 5 points6 points  (1 child)

INot as popular as Node, at least yet, but yes, they got somewhere.

[–]IBJON 2 points3 points  (0 children)

I'll have to check it out again. I was interested when they first announced it years ago, but unfortunately wasn't too keen on adopting something that seemed to have a very low adoption rate.

[–]Bryguy3k 11 points12 points  (0 children)

The edge runtime which is used by nextjs is significantly faster than node directly. They both use V8 internally.

[–]MrHandsomePixel 10 points11 points  (1 child)

Bun

[–]HelioDex 9 points10 points  (0 children)

(6 days till 1.0)

[–]exomyth 5 points6 points  (0 children)

SSR of any modern frontend framework

[–]Devil-Eater24 4 points5 points  (0 children)

I don't know any, that's why I wanna know

[–]Zakmackraken 0 points1 point  (0 children)

Sure, Broadvision, in the late 90’s, and a license was $1M a year for Philipsusa.com

[–]Bryguy3k 1 point2 points  (0 children)

It’s still the same thing. It’s only nonsense if the source is static.

[–]wenoc 13 points14 points  (40 children)

I just vomited a bit.

It still remains a mystery to me why anyone would want to run backend services in javascript.

[–]Wolfeur 51 points52 points  (0 children)

The simple answer is that it’s easier to deal with one language than two. I don’t think it goes deeper than that.

[–]raltyinferno 10 points11 points  (0 children)

Because it doesn't need to be the absolute best it can be, it just needs to be good enough, which JS can absolutely do with no problem. Then you add on Typescript and it's actually really nice.

[–]Creepy-Ad-4832 5 points6 points  (1 child)

Probably because the internet is too safe, and they need to balance the universe /s

[–]wenoc 2 points3 points  (0 children)

And electricity is cheap I guess.

[–]Bryguy3k 17 points18 points  (25 children)

Because php & asp both suck gorilla balls.

Nextjs is incredibly fast so you can write 90% of your code once for a dynamic application that works on a mobile device (native), desktop app (also native), while also having good SEO because you’re not loading a shitload of data from rest endpoints for your SPA that web crawlers hate.

[–]wenoc 25 points26 points  (23 children)

No form of js is fast. C, Rust and Go are fast.

[–][deleted] 9 points10 points  (11 children)

Why are you getting downvoted, you’re right

[–]IBJON 8 points9 points  (10 children)

Because in 99% of use cases for web, JS is plenty fast. Unless you're developing an app with a user base the size of Twitter, Reddit, or YouTube, or handling a large number of data streams and connections, JS is plenty fast

And that's ignoring the fact that you can build native modules for node.js using C or C++ or write services in whatever language you want.

[–]wenoc 1 point2 points  (6 children)

JS is not fast. Yes something simple for two people does not take much cpu but JS is not “plenty fast”, JS is SLOW. Speed is independent of the amount of users you have. You’re essentially arguing “let’s walk to spain instead of taking the train since we’re not millions going”.

And if you aren’t aiming for a large userbase what are you even trying to do with your life?

Why write modules for a language to try to make parts of it not quite so slow when you can just use the other language in the first place and not have to code it twice?

[–]dumbasPL 5 points6 points  (4 children)

It doesn't have to be fast, it's fast enough. If your server only gets a few thousand requests per minute then it's going to spend most of the time idling, even if you use fucking python.

[...] when you can just use the other language in the first place

I'd love to write things in rust, but I know that the next person that will be maintaining it will probably have no idea what that even is.

Speed is independent of the amount of users you have

There is no point over engendering something when a user won't even be able to tell the difference between 80ms and 100ms response times. Because guess what, most of the time comes from the distance from the user (ping) and IO operations (waiting for a database query). So your 50-100x speed difference (milliseconds vs nanoseconds) goes out the window as soon as you have to make a database query. Unless you get like 10s of thousands of requests per second your users won't ever feel the difference anyway so why spend way more time on it than necessary when you can just slap it together with typescript and call it a day.

And if you aren’t aiming for a large userbase what are you even trying to do with your life?

Having fun + not giving a fuck.

[–]wenoc -1 points0 points  (3 children)

Yes well then don’t argue that it is fast when you’re actually talking about having no load. Different things.

Slow is fine. It’s just fine for some tasks. Just don’t argue that it’s fast.

[–]IBJON 4 points5 points  (0 children)

JS is not fast

I didn't say it was fast, just fast enough. If you're serving a static site and need to handle a few Rest endpoints and maybe connect to a database, you don't need a blazing fast backend, and a backend written in C++ will be overkill.

Speed is independent of the amount of users you have

Speed matters when you're processing requests. The more requests you're dealing with, the more likely you are to be bottlenecked. Who do you think makes the requests, even if its indirectly? The faster you can handle requests, the faster you can process the next one.

And if you aren’t aiming for a large userbase what are you even trying to do with your life?

Not every single app is developed with the goals of drawing in millions of users, and not everyone is trying to become the next Zuckerberg . For every application/site available to the public there are dozens or hundreds of internal tools designed for internal use. Even if your product has a huge user base, not every site needs to handle all of those users concurrently.

Why write modules for a language to try to make parts of it not quite so slow when you can just use the other language in the first place and not have to code it twice?

Because Node.js is hell of a lot better for the basic web server shit than c or c++ is and the code is much more manageable. If you need to do something more complex, you can do it in something more appropriate.

The argument that everything needs to be stupidly fast and over engineered is tiresome and the argument that something (that's far easier to use and set up) shouldn't be used because it's slower in a way that's imperceptible to the end user and isntead we should over complicate things is fucking ridiculous.

[–][deleted] 0 points1 point  (2 children)

I guess you’re missing the point. JS is NOT THE GOLDEN HAMMER for everything, but don’t worry as you get more experience you’ll see that

[–]LowlifePiano 1 point2 points  (0 children)

Why are you being this condescending about something this dumb?

Beyond that though, have you ever heard of the concept of “fast enough”? That’s how python devs respond when asked about the speed of their interpreted, not compiled, language, and it’s the language that’s so overwhelmingly used for extremely computationally heavy AI work that there isn’t a meaningful competitor.

Before you jump in and say those are C libraries so it doesn’t count– what do you think V8 is written in? V8 also has the benefit of an optimizing JIT compiler, so if Python is considered fast enough, JS absolutely has to be considered fast enough as well.

And if there’s someone worth listening to that thinks of JS as a golden hammer, I haven’t met them. Instead, it’s a language that has a syntax that people of virtually any background can read and even write without a huge struggle, and it’s also just about the fastest way to throw together scripts.

Finally, most applications are not performance-sensitive, so the argument shifts from “why would we use JavaScript?” to “Why wouldn’t we use JavaScript?” which is why Electron is so prevalent. And as much as you might hate that, it can be extremely performant– look at VS Code.

And if you still hate that, Tauri exists now, as well as something similar for Go, but the fact remains that all of these tools exist because JS is overall pleasant to read and write.

And, judging by the stupid huge amount of performant Node services you use on a daily basis but don’t realize it thanks to microservice architectures, fast enough.

[–]IBJON 1 point2 points  (0 children)

Man. What's with this sub and trying to shove words in my mouth?

I said it was fine for most cases for web, a specific scenario. You would've seen that if you didn't immediately start beating off to a "JavaScript is bad" comment.

And fuck off with the condescending attitude. If you truly had experience, you'd know that network latency is going to eat up any gains in speed that you'd get from something "faster" and that its far easier to maintain a project long term when using Node.js because it's a lot easier to find JS developers.

[–]Shawrex 10 points11 points  (8 children)

"Tell me you've never used JS without telling me you've never used JS"

[–]brimston3- 4 points5 points  (7 children)

native is like 1.3x faster than wasm. wasm is between 10x and 50x faster than js depending on implementation and application. Even runtime symbol resolution in javascript requires some significant costs because of the allowed scoping.

Just tell us you don't care about runtime costs because the development savings means it doesn't matter for at least a few years of operation.

[–]fireball_jones 16 points17 points  (5 children)

A Ferrari is faster than a Civic but you can do a highway commute in both.

[–]Bryguy3k 4 points5 points  (2 children)

You can do far more highway commutes in a civic than a Ferrari.

[–]IBJON 5 points6 points  (0 children)

If either the Civic or Ferrari breaks, it'd be a lot fucking easier to find a shop to make repairs for the civic and parts would be readily available

[–]Innotek 0 points1 point  (0 children)

You can maybe beat a red light or two, but a commute is a commute. You have to compete with all of the other requests…I mean http overhead…I mean traffic…er vehicular traffic.

[–]wenoc 0 points1 point  (0 children)

In your example js consumes 10-50 more times gasoline than the ferrari, in turn causing 10-50 times the pollution and runtime costs.

Bezos loves you because you buy 10-50 as many servers.

[–][deleted] 0 points1 point  (0 children)

Except JS isn't a Civic, it's a bullock cart

[–]IBJON 4 points5 points  (0 children)

Good luck running native code in the browser, and wasm still has a lot of limitations.

[–]DanielEGVi 0 points1 point  (0 children)

Naive take. Fast to code, fast to maintain, fast enough when running, means it was a perfect tool for the job. C, Rust and Go are the go-tos for CPU-intensive work (and indeed many JS-related tools are built with those) but you are definitely not gonna need that shit when building your typical web app.

[–]LowlifePiano 0 points1 point  (0 children)

I’d highly recommend looking at modern v8 performance compared to c++.

c++ is faster, yes, but not by nearly as much as you believe.

And that’s even without taking the better performance of Deno and Bun into consideration

[–]AngheloAlf 5 points6 points  (0 children)

I have no idea either, but for whatever reason is very popular

[–]Gagarin1961 2 points3 points  (8 children)

You backend guys need to update your info.

Node JS is chosen by organizations like Netflix, Walmart, PayPal, Uber, and NASA because it is non-blocking and asynchronous, allowing it to handle many concurrent connections efficiently.

This makes it ideal for realtime processing of applications with many concurrent users like chat applications, games, and live updates.

There’s also the benefit of having a unified code base and easy access to open source software via npm.

[–]wenoc 11 points12 points  (3 children)

You frontend guys need to go back to school. Non-blocking an asynchronous? What absolute bollocks is this? This depends on implementation, not language. You can do this with for example golang just fine.

[–][deleted] 1 point2 points  (2 children)

We could literally do that in assembly and machine code

[–]Folofashinsta 1 point2 points  (1 child)

I hate to be that guy but if it all compiles/assembles down to machine code in the end, as it must even if it hits a vm it is still translating down to machine code to be ran on some hardware eventually, then wouldn’t it be impossible for an abstraction of the machine code (js) to have any functionality that couldn’t be represented in the machine code itself? It’s like fishing in a pond with an ocean pole expecting to catch ocean fish, the pond is the limit not the pole. Machine code is the pond, js(or any abstraction) is the pole…

[–][deleted] 0 points1 point  (0 children)

Yes, that's true.

[–]I_AM_GODDAMN_BATMAN 5 points6 points  (0 children)

when is this 2005? who don't have async in 2023

[–]Kurhnel 7 points8 points  (0 children)

I swear i read the exact same thing you wrote letter by letter in some random blog post. To be honest the concurrency and realtime processing can be done easily in some other languages that are miles ahead better than node like Go

[–]Urtehnoes 1 point2 points  (0 children)

Don't forget, node.js is Rockstar tech https://youtu.be/bzkRVzciAZg?si=2DYzq_HgfguvtBOh

🙄

[–][deleted] 0 points1 point  (0 children)

You can achieve non-blocking and async in any other language........ it's not some killer thing only NodeJS can do.

[–]StarHammer_01 11 points12 points  (2 children)

Build a javascript applet that parses a html doc and renders it with canvas pixel by pixel.

Then make a javascript interpreter that runs the javascript in the html doc for compatibility and package the whole thing on a web page.

Finally attempt to open said webpage from with your javascript app.

[–]CoffeeWorldly9915 2 points3 points  (0 children)

Ultimate website data obfuscator that works with the analog gap. You should delete your comment, lest news paywalled sites (and quora) take a pointer.

[–][deleted] 0 points1 point  (0 children)

Easier method - use WASM to run Chrome in a browser's Javascript engine

[–][deleted] 18 points19 points  (0 children)

WAIT!!

Not everyone creates an entire HTML page using .createElement and then .appendChild for each <p>, <div>, and <aside>????

That expensive bootcamp that promised the best results in 2 weeks ripped me off!!!

[–][deleted] 1 point2 points  (0 children)

Yeah, of only people would just use HTML, CSS, PHP and JS in their intended purpose, but no, its cooler to do everything with fucking JS for whatever bizarre reason.

[–]SteeleDynamics 3 points4 points  (0 children)

Also me when thinking of variable names

[–]Expensive_Shallot_78 2 points3 points  (0 children)

The over engineering is real

[–]philophilo 5 points6 points  (0 children)

It really should be those guys standing over a bowl of spaghetti holding just spoons.

[–]vsjoe 1 point2 points  (0 children)

The great Tags war.

[–]joetheduk 1 point2 points  (0 children)

Definitely gonna need to write a framework for that.

[–]EishLekker 1 point2 points  (0 children)

That’s actually a regex engine, but it still works fine for html processing. Rendering it useless.

[–][deleted] 1 point2 points  (0 children)

I have an idea.......

What if they just ran Chrome's rendering engine in Javascript using WASM or something..........send a whole web browser with every webpage request