DEV Community

Discussion on: Should you pick C# over JS? Maybe.

Collapse
 
denvercoder profile image
Tim Myers

Huge file size now. But is it really though? I think now it’s 2.4mb which is large but that only has to be downloaded once. And the file size is getting smaller. I heard that some of the experimental branches have it down to 100k.

Collapse
 
mohdahmad1 profile image
Mohd Ahmad

2.4 mb is also huge, preact project is 4kb + your code size i.e ~40kb

Webassembly is designed to do low level computations on the web, so better usecase will be making apps like video editor, photo editor, ml projects, etc.

For frontend you can't just replace JS, its the only language for frontend capable for doing backend too

Thread Thread
 
denvercoder profile image
Tim Myers

I disagree. The size is coming down.

Thread Thread
 
denvercoder profile image
Tim Myers

However, the biggest win came from enabling Brotli compression when publishing an app. Brotli is a very efficient compression format and implementing it led to the default Blazor template application going from 2MB to 1.8MB. If the Bootstrap CSS is removed, the size can go as low as 1.6MB.

It's new, it's just going to take time. Most JS based projects area about 3.0mb total including images so this is not that bad.

Thread Thread
 
mohdahmad1 profile image
Mohd Ahmad

yes, I agree but the bundled size is >1Mb in js projects images are excluded.
Images are served via CDN so they cant be count in project size, we are talking about code here.

I built many projects, each has source code less than 200Kb which is less than 1.6MB

Thread Thread
 
mohdahmad1 profile image
Mohd Ahmad

WASM is a great language, it is fast and safe too.
It is meant for making Web Apps whether SPA or PWA, It is not meant for making websites. Smaller SPAs can be made in JS or WASM but WASM is recommended for larger projects where speed matters or security needs.

WASM can do cryptography, cinematography, Hashing, video editing, sound manipulation, ml projects, browser games, etc. It does all the low-level computations for you and gives you lo level hardware access.
These things are not required in a simple website or web app

Its real-life example is Figma it uses WASM with JS

Thread Thread
 
denvercoder profile image
Tim Myers

Now you’re just being shitty and pandering so I’m not going to engage with you anymore.

Do you REALLY think it’s necessary to point out that

200k is less than 1.6mb to someone that’s been writing software since 2004?

🤡🤡🤡🤡🤡