Live data from Hacker News

You might want to build your WebApp in Canvas instead of HTML

hivekit.io

51–59 of 59 posts

Re: You might want to build your WebApp in Canvas instead of HTML

#51

> The document in Google Docs is a Canvas. This is only mostly true, and no justification at that. I’ll just quote myself from a couple of years ago https://news.ycombinator.com/item?id=42253177 >: > Google Docs isn’t pure-canvas: they only switched their document area to use it for layout. Text rendering is still browser (necessary to keep performance even close ), and all the rest of the UI is still DOM. Having tho…

• Portability: unreasonable claim, HTML is more portable than what you will use instead.

> Take the humble element, for example. With it, you get crispy rendering at any resolution, support for tab, focus, selection, mouse interactions and arrow key navigation, internationalization for right-to-left text and Asian compound characters, accessibility for screen readers… the list goes on.

This is a poor choice of example for “why wouldn’t you use Canvas”, because even pure-canvas apps will use a backing for text input (probably invisible, hopefully appropriately positioned), because that’s the most primitive thing there is in this way; you cannot emulate it.

—⁂—

The rest of the article is fairly reasonable, showing some of the important considerations and why doing it to acceptable quality is more complex than people often imagine, because you’re basically reinventing a sizeable subset of what the browser already offers; and you can’t do as good a job of it in various areas, and are unlikely to do as good a job in most of the rest.

I’d say: things like Canva and Google Maps should obviously use canvas; things like Google Docs and Sheets should almost certainly not. I see enough of their product to see why they would choose canvas, but I’m not yet convinced that HTML only wouldn’t have served them better, and I strongly suspect that, if not, HTML + SVG would have been a better choice than HTML + canvas (and I hope they’re not pure canvas, because that’s an irredeemably bad approach for the foreseeable future of browsers).

Re: You might want to build your WebApp in Canvas instead of HTML

#53
post #49

Earlier quoted context omitted.

Please read TFA > for most web apps, you’re much better off with good old DOM elements. Take the humble element, for example. With it, you get crispy rendering at any resolution, support for tab, focus, selection, mouse interactions and arrow key navigation, internationalization for right-to-left text and Asian compound characters, accessibility for screen readers…

I did read the article. It is not a balanced piece. The title is “You might want to build your webapp in canvas instead”. Almost the entire article - basically everything except for that paragraph - is talking about canvas rendering. About when and why it might be better. There is nowhere near enough discussion of the downsides. If you read this article you could walk away thinking Google docs is implemented entirely…

The author is not obligated to lay down every single pro and con for something, it's just a blog post with some examples and if the reader wants, they can research more into the topic themselves.

Re: You might want to build your WebApp in Canvas instead of HTML

#54
post #44

Earlier quoted context omitted.

There is absolutely such a thing as a web app. What else would you call Google Docs, MS Word and the like?

Google Docs is a program for Android written in java and compiled into dalvik/art byte code. MS Word is just a program for Windows, written C/C++.

Sometimes I wonder how people like this navigate real life with such strong opinions and trying to redefine common definitions.

Re: You might want to build your WebApp in Canvas instead of HTML

#55
post #49

Earlier quoted context omitted.

I did read the article. It is not a balanced piece. The title is “You might want to build your webapp in canvas instead”. Almost the entire article - basically everything except for that paragraph - is talking about canvas rendering. About when and why it might be better. There is nowhere near enough discussion of the downsides. If you read this article you could walk away thinking Google docs is implemented entirely…

The author is not obligated to lay down every single pro and con for something, it's just a blog post with some examples and if the reader wants, they can research more into the topic themselves.

I just don’t want to log in to my banking portal in 3 months to find the whole thing has been rewritten on top of canvas for no reason.

Re: You might want to build your WebApp in Canvas instead of HTML

#56

Earlier quoted context omitted.

Google Docs is a program for Android written in java and compiled into dalvik/art byte code. MS Word is just a program for Windows, written C/C++.

Sometimes I wonder how people like this navigate real life with such strong opinions and trying to redefine common definitions.

https://en.wikipedia.org/wiki/The_Emperor%27s_New_Clothes

Re: You might want to build your WebApp in Canvas instead of HTML

#58

I’m always curious how Google, Microsoft and Co. build their web apps - given that they need to work well on any computer, from a top-shelf speed machine to a potato with wires. In my experience, Microsoft webapps (which now includes many of their desktop apps) are rather sluggish. Even the Copilot Chat website. How hard could it be to make a chatbox and a session transcript not be sluggish?

This is appeal to authority and largely made out of the same cowardice that gives us "no one got fired by buy IBM".

Re: You might want to build your WebApp in Canvas instead of HTML

#59
post #55

Earlier quoted context omitted.

The author is not obligated to lay down every single pro and con for something, it's just a blog post with some examples and if the reader wants, they can research more into the topic themselves.

I just don’t want to log in to my banking portal in 3 months to find the whole thing has been rewritten on top of canvas for no reason.

Just because people use a technology incorrectly does not make the technology bad, especially when people like the author explicitly state where it does and does not make sense.
Post reply on HN