3 ms·
For me it's portability first, decent performance second and third the 'seamless distribution model' of the web (no installation, no app shops, no code signing,
by flohofwoe 12y ago
For me it's portability first, decent performance second and third the 'seamless distribution model' of the web (no installation, no app shops, no code signing, just an URL).
I wouldn't write a web-only app in C++, but if the same code needs to run on other platforms as well (e.g. native mobile, desktop or gaming consoles) then C/C++ is basically the only choice. Also, at least in emscripten, compiled code is faster then hand-written JS for several reasons (asm.js, LLVM optimizer passes, no gc), so it makes sense to write stuff like physics/pathfinding/AI engines in C/C++ and compile it to JS.
Plus, it's fun to write a desktop OpenGL demo, flip a build system switch and run it in the browser ;)