Hacker News new | ask | show | jobs
by bschwindHN 1402 days ago
Using canvas for fast visualizations is good! As you say, it's fast, you have layout management, and lower-level control of how things load and paint.

Using canvas for the entire UI...is not good. You have to reinvent _everything_, poorly. You have no accessibility support. Text selection doesn't exist, things look and behave kind of "off" from what people expect.

All that so you can avoid spending a few hours learning some CSS? Not sure it's worth it.

1 comments

You really need a good reason to choose a non native language (e.g. not JavaScript for the Browser). One reason might be that you target other platforms too (cross-platform). In that case, you are outside of the browser anyway and you need to come up with solutions to these problems. Implementing those in a consistent way across all platforms for your product is not generally a bad idea. The alternative is an inconsistent but native UX for each platform.
Isn't WebAssembly the clear answer here? You can bind to JavaScript so you can still have all that comes with a browser environment, while still being able to use a different language. Performance may not be as good depending on what you're doing, but it's certainly better than reinventing a whole UI framework in a canvas.