Hacker News new | ask | show | jobs
by abritinthebay 2940 days ago
Any reason for not using canvas or some kind of framework like Vue/preact/etc?
3 comments

The 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.

Not the OP but maybe because they wrote it in what they know and actually shipped.
Snarky comments will be ignored. ╭∩╮⎛○⏜⏟〤○⎞╭∩╮
Wasn'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.