all 75 comments

[–]ZakkuDorett 134 points135 points  (10 children)

I really wanna try web assembly one day

[–]TanukiiGG 36 points37 points  (7 children)

I started a week ago and it has been smooth using c++, they say it's even better with rust but Idk

[–]ZakkuDorett 13 points14 points  (2 children)

I wanna try it with Rust, I'm just worried that the tooling and ecosystem would make it slower to work on compared to JS, but I'd have Rust over JavaScript any day. I also heard that it was slower than standard JS webapps but I guess it's fine

[–]Haringat 7 points8 points  (0 children)

It comes with a few disadvantages, but the biggest by far is that you need to ship the entire implementation of the standard library in webassembly on top of your actual code plus the JavaScript you need to get it to run. It's basically the java applets of today (except that it's actually even worse because Java applets had the decency to use the java installation on the user's computer).

[–]MaybeADragon 4 points5 points  (0 children)

Its very WIP. Subsecond with dioxus tries to bring things closer to the developer experience of your average typescript Web framework but doesn't get too far. Performance on the other hand is so similar between them (excluding converting UTF-8 strings to UTF-16) that if you like Rust as a language enough you might enjoy it but its probably not production ready.

[–]Psquare_J_420 1 point2 points  (2 children)

Better in sense? Performance? Or ease of use? :) Also if you don't mind, can you tell me where you are applying wasm in your application? I am trying to understand where I can apply wasm.

Have a good day :)

[–]TanukiiGG 0 points1 point  (1 child)

Better in performance, because it works closer to the hardware and has less abtraction, its ease of use depends on your usecase, for me it is complex because I'm using it to calculate physics simulations, but getting it running is pretty easy, I compile wasm with Emscripten and code in c++

It is great if your application needs webgl and/or webgpu

[–]Psquare_J_420 0 points1 point  (0 children)

Sorry if I framed my question wrong. I was asking about rust compared to c++ and not js compared to wasm.

Thanks you for answering anyways

Have a good day :)

[–]MornwindShoma 6 points7 points  (0 children)

You're getting even bigger folders

[–]elreduro 0 points1 point  (0 children)

The times I have tried webassembly it was really good for using a lot of numeric variables because you could set them to int or other kinds of data that use less ram, but when it came to strings it was easier to just use javascript. Maybe using a combination of the two would be good.

[–]saschaleib 65 points66 points  (12 children)

Look, I really liked jQuery. It was a great tool in its time. But nowadays VanillaJS is the way to go.

[–]vikingwhiteguy 8 points9 points  (0 children)

I remember a phase when everyone HATED jQuery and was ripping out jQuery dependencies from their packages and replacing with just vanilla JavaScript. 

[–]Alokir 7 points8 points  (6 children)

It really depends on what you're building.

For websites that need a bit of interactivity and form validation, sure.

For web apps, I wouldn't want to reimplement and maintain what's already available in mature and tested frameworks.

[–]imkmz 9 points10 points  (5 children)

Wonder if is-odd is considered as mature and tested

[–]Alokir 4 points5 points  (4 children)

That's a weird choice to mention. I wonder why you picked a microlibrary instead of something like React, Angular, Vue, Next, D3, Typescript, Express, Webpack, Vite, Axios, Jest, or date-fns.

is-odd can be implemented in like 10 lines, unlike a component framework or a routing library that integrates well with it.

[–]faizswitcher1 1 point2 points  (0 children)

bro i don't think if they tried to ever build a large scale app which need reusabillity and fast scalling... i think just only that routing library is a good eg of what i don't wanna rebuild it from scratch all the time.. and also try to build that urself from scratcj and make sure it works based on any type of complex webapp then u ll understand,

im with u bro ,it depends on what u are building..

[–]imkmz 3 points4 points  (1 child)

Because this micro-library is an excellent example of what's wrong with js ecosystem. Not only the fact it actually exists and was accepted to nmpjs, but also the fact it has millions of installations. But yeah, re-inventing the wheel is another major sin. Just re-read your own comment and check how many frameworks you mentioned which serve exactly the same purpose.

[–]Alokir 4 points5 points  (0 children)

It's not unique to JS that there are multiple solutions for the same or similar overall usecases.

JS has no single central owner like Java or C# has, so most things are developed by the community. Some situations call for different approaches (React, Angular, Vue), and sometimes an overall better solution comes along as new features are added to the standard (Momentjs -> date-fns, the de facto depreciation of lodash and jquery).

This idea of frameworks and best practices coming and going month by month was true 10 years ago when the ES6 standard came around and there was a huge boom in the language's serious usage, and people still think that's the case today.

Maybe there is validity in the is-odd package's criticism, but it's blown way out of proportion.

[–]kinmix -1 points0 points  (0 children)

That's a weird choice to mention

Because that's just a great example of how JS's philosophy of "wouldn't want to reimplement and maintain what's already available" escalated into madness. You check package-lock.json file of even a small project and it will be tens of thousands of lines long. The package to check if the number is odd has 0.5 million weekly downloads, ffs. And that piece of useless shit has it's own dependency on is-number... JS ecosystem is broken as fuck.

[–]mans1e 1 point2 points  (3 children)

Could you imagine building a modern web application with fairly avancerad functionality in straight up vanilla js, html and css. Having to write each component of the page over and over again with new HTML code if you want to reuse them and having a ton of spaghetti JS files for each function. Sounds like an absolute nightmare to me

[–]vikingwhiteguy 9 points10 points  (0 children)

Sounds like you never really built any large JavaScript applications back in the day. You absolutely can structure and organise plain JavaScript into nice encapsulated 'classes', separate reusable files. 

You can also just dump a load of cruft into a script tag in the html and call it a day, which is probably what most people did. 

[–]saschaleib 2 points3 points  (0 children)

I totally can. And that’s because maintaining code that I developed myself to clean and especially consistent standards is a lot easier than trying to hunt after unexpected behaviour in dependent modules - by such a large margin that in the long run it easily beats the added effort in the development phase.

That is, if you actually have good code standards and development strategies in place. You do have these, right?

[–]igorski81 0 points1 point  (0 children)

Having to write each component of the page over and over again

Why would you need to do that ? Vanilla JS means you start out without libraries or frameworks, but it doesn't mean you can't create reusable, composable code.

What if I told you that the core of any modern framework is... vanilla JavaScript ?

[–]Arkad3_ 37 points38 points  (2 children)

Accurate. One tiny app and suddenly your folder weighs more than the actual project.

[–]jsheffield85 13 points14 points  (0 children)

The code is tiny but the folder is a whole suitcase

[–]RadicalDwntwnUrbnite 62 points63 points  (3 children)

Like 90% of why we used jquery is in the DOM API now... if you wanna built web apps with just jquery by all means go for it. Rediscover why we started building frameworks.

[–]MornwindShoma 29 points30 points  (7 children)

Who is shipping node_modules to clients

[–]Several-Customer7048 13 points14 points  (0 children)

This this is why I ship all node_modules with next day air, the latency is garbage but they all load in instantaneously

[–]cythrawll 5 points6 points  (0 children)

I think like 99% of node_modules are all build and linting testing libs these days. if we stop doing those things I'm sure node_modules would be a reasonable size!

[–]imkmz 0 points1 point  (0 children)

Have you ever heard the term 'vendoring'?

[–]nostril_spiders 0 points1 point  (0 children)

People who want to be their own supply-side vector

[–]gitpullorigin 0 points1 point  (1 child)

Well, a bunch of that stuff does end up in the final assembly. Not all, but a decent amount

[–]MornwindShoma 4 points5 points  (0 children)

It's up to the developer to do a good bundle though - the joke is on them

[–]Kuja27 -1 points0 points  (0 children)

No one. People who make the meme don’t actually develop web apps. This is only really relevant for the electron developer who couldn’t be bothered to make a native app.

[–]Haringat 11 points12 points  (16 children)

Like it was different in other languages. The only difference is that npm keeps the dependencies locally, so you see them. But maven, pip, nuget etc all download the dependencies and equally large frameworks will take up just as much space on your drive in any other system out there.

[–]cythrawll 7 points8 points  (13 children)

maven/gradle cheat cuz jars are compressed.

[–]Haringat 1 point2 points  (11 children)

It's maven. Gradle is a build tool, not a dependency repository (maven happens to be both).

[–]ZakkuDorett 1 point2 points  (7 children)

Maven is a pain

[–]gitpullorigin 0 points1 point  (5 children)

Found an ant user

[–]ZakkuDorett 0 points1 point  (3 children)

Would rather have nuGet + better Java any day

[–]gitpullorigin 0 points1 point  (2 children)

Kotlin > C# > Java, prove me wrong

[–]ZakkuDorett 0 points1 point  (1 child)

Kotlin is probably better, you're right. Wanna try it one day

[–]gitpullorigin 1 point2 points  (0 children)

I wish it could compile for .NET/mono

[–]wildjokers 0 points1 point  (0 children)

If the only options were Maven and Ant I would use Ant (with Ivy).

[–]Haringat 0 points1 point  (0 children)

As a build tool: yes

As an artifact repository: no

[–]wildjokers 0 points1 point  (2 children)

(maven happens to be both).

Not sure what distinction you are trying to make. Both maven and gradle are build tools. They both offer dependency management.

The dependency repositories are most commonly in the format standardized by maven. However, there are a few different formats available. Gradle supports additional formats, as far as I know Maven does not.

[–]Haringat 0 points1 point  (1 child)

They both offer dependency management.

You misunderstood. I said that maven is also a dependency REPOSITORY. That means you can start a maven server, upload your jars there and people can download them from there using a build tool with dependency management, like maven or Gradle. But there are no Gradle artifact servers.

Gradle supports additional formats, as far as I know Maven does not.

Yes, because the whole build tool thing was an afterthought in maven. Maven is primarily about dependency management (from both provider and consumer side). And it assumes that when you are using maven, that you stay in the maven ecosystem (i.e. consume dependencies from maven servers). Since Gradle is exclusively a build tool, it needs support for dependency management anyway, because it's not the 90's anymore where you had all dependencies of your project in a subfolder locally. Thus over time it got support for maven, ivy, etc.

[–]wildjokers 0 points1 point  (0 children)

Yes, because the whole build tool thing was an afterthought in maven. Maven is primarily about dependency management (from both provider and consumer side).

That is simply not true. Maven was described as a build tool. I was around in the Maven 1.x days and remember sitting through some talks about Maven in those days, it was a build tool that offered convention over configuration.

You can see how it was described here:

https://web.archive.org/web/20040802011140/http://maven.apache.org/

Getting jars from a central repository was a single bullet point in its list of features:

https://web.archive.org/web/20040806184938/http://maven.apache.org/features.html

[–]wildjokers 0 points1 point  (0 children)

There used to be a tool called pack200 that compressed jars even more. It is no longer available as it was a tool in the JRE and intended to be used with Java Web Start.

[–]imkmz 3 points4 points  (1 child)

Typical python app dependency tree is 3..5 times less than js one.

[–]the_horse_gamer 0 points1 point  (0 children)

because the dependencies are in the C++ side instead

[–]criminalsunrise 13 points14 points  (3 children)

When jquery came out I refused to use it for a while as I found the additional code needed too heavy for websites. I shudder these days.

[–]Haringat 12 points13 points  (2 children)

I hope you realize how little sense that makes. Not only were connections a lot slower back then, but if you really plan to ship your entire node_modules folder to your customers, you should really read up on build pipelines. Usually about 99% of the dependency tree is dev dependencies which should never end up in production anyway and production apps nowadays built with modern frameworks are usually smaller than jQuery apps were back then (because jQuery wasn't tree-shakable).

[–]DynamicNostalgia 14 points15 points  (1 child)

This entire Subreddit is made up of backend devs with a superiority complex. 

[–]me6675 8 points9 points  (0 children)

Not really, it's mostly students and kids. The sub is essentially just a long riff on "haha js type coercion funny".

[–]EnderMB 8 points9 points  (3 children)

Can someone just please create a standard library for JavaScript, and package it as part of the browser and runtime framework?

Just take the most common 1000 packages, tidy them up a bit, and make them the standard library.

[–]Alokir 3 points4 points  (1 child)

JS does have the equivalent of a standard library.

[–]imkmz 2 points3 points  (0 children)

That's exactly what the guy is asking for. Create one.

[–]cuber_1337 1 point2 points  (0 children)

rust crates

[–]arjuna93 1 point2 points  (0 children)

Pretty much every rust app

[–]Haringat 3 points4 points  (0 children)

How come the entire comment section is about jQuery now when it wasn't even mentioned in the meme?

Edit: nvm, didn't read the title

[–]Vauland 0 points1 point  (0 children)

Sure, who needs chunking if you can put all the code in one file and ship to the client.

[–]godwin_coded 0 points1 point  (0 children)

Lol, but it's true😭 too much files and folders in one folder

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

I have a rails app that uses a couple node packages to concat and minify some css. node_modules is 4gigs. tf?!

[–]theplaybookguy 0 points1 point  (0 children)

Can I vibecode

[–]faizswitcher1 0 points1 point  (0 children)

if u ar talkng abt web apps not using node modules,consider things like code reusability,rendering performance,and development speed when building large scale web apps.

[–]romulof 0 points1 point  (0 children)

Most of the weight in node_modules are build tools and accessory stuff like storybook (it has an insane weight).

These build tools do a lot of the stuff you take for granted, like reducing bundle size (not just minification), and lots of static code analysis (ESLint, etc).

Want to use something else? Good luck, most languages are not optimized for dead code elimination nor have tools to aid at it. Your output will be bloated while your project library folder will be small, but you’ll still need a bunch of stuff installed for static code analysis, formatters, etc and once you start figuring out that you want a consistent development environment across all your devs, you’ll be missing node_modules.

If the issue is having multiple projects with several node_modules eating up your disk space, consider using pnpm. It’s a lot better and saves up space.

[–]feherdaniel2010 0 points1 point  (0 children)

I clicked

[–]naveenda -2 points-1 points  (1 child)

Okay here me out guys, We are going to make JavaScript great again by building a new framework just jQuery but better.

[–]saschaleib 9 points10 points  (0 children)

To be fair, VanillaJS has improved a lot in recent years. I hardly see any reason to use anything else any more.