3 ms·
Any reason for not using canvas or some kind of framework like Vue/preact/etc?
by abritinthebay 8y ago
Any reason for not using canvas or some kind of framework like Vue/preact/etc?
- uuu8728dw8d8d 8y agoSnarky comments will be ignored. ╭∩╮⎛○⏜⏟〤○⎞╭∩╮
- abritinthebay 8y agoWasn't snark, Mr Hostility. DOM manipulation is a very expensive operation and is abstracted by a lot of useful libraries - was wondering if there was a specific reason to not use them. Canvas is another type of abstraction - and blitting to the screen is easier with it - so same applies.
- JustSomeNobody 8y agoNot the OP but maybe because they wrote it in what they know and actually shipped.
- kroltan 8y agoThe problem here is not a lack of framework, but the overkill usage of elements. I think even a game-like approach of using a single canvas and re-rendering the whole screen when something changes would be more efficient than manual DOM mutations.