DEV Community

Discussion on: What's wrong with code in 2022? πŸ€·πŸ»β€β™€οΈ

Collapse
 
pengeszikra profile image
Peter Vivo • Edited

I was checked my "hello world" "mmorpg poc" application written in NextJS ( react + BE ) memory footprint was 2.5Mb. That is still count as huge. But I think that is quite fine in our memory gobbler times.

===============================================================================
 Language            Files        Lines         Code     Comments       Blanks
===============================================================================
 CSS                     1            7            6            0            1
 JavaScript             18          517          456            3           58
 JSON                    6        22672        22672            0            0
 Sass                    6         1032          865           31          136
 SVG                     1            1            1            0            0
 TSX                    10          523          444            1           78
 TypeScript             18         1284         1106           13          165
-------------------------------------------------------------------------------
 Markdown                5          440            0          321          119
 |- BASH                 1           31           24            1            6
 |- JavaScript           1            3            1            1            1
 |- JSX                  1           11            9            0            2
 |- TSX                  3           53           42            2            9
 (Total)                            538           76          325          137
===============================================================================
 Total                  65        26476        25550          369          557
===============================================================================
Enter fullscreen mode Exit fullscreen mode

./server size is: 256kb.
./static (graphic files - maybe few unwanted still left): 1.3Mb

Worst part the node_modules lib: 350 MB.

This way of programming fare more distand from my Z80 assembly game code writtend around 1987 on Videoton TV Computer.

Collapse
 
wadecodez profile image
Wade Zimmerman

We could use far less code if browsers supported other languages besides JavaScript

Thread Thread
 
pengeszikra profile image
Peter Vivo

Actually you can write any languages to browser compiled to WASM/JS/HTML. By the way if you create any JS/HTML application that is also need for compile to proper JS target, mainly ES5 for compatibility reason.

I think actual browsers is so complex application - with tons of unused API ( surprise ! ), any extra languages will be raise these complexity unnececcary.

const speak = sentence => speechSynthesis.speak(new SpeechSynthesisUtterance(sentence));
speak('What did you think about browser complexity?');
Enter fullscreen mode Exit fullscreen mode

The good question is:
Why don't able WASM reach these API endpoint and HTML page without any JS code?

Collapse
 
mariamarsh profile image
Maria 🍦 Marshmallow

Thanks for sharing 🌈