Hacker News new | past | comments | ask | show | jobs | submit login

People pick SVG because it looks sharp, has certain features that make development easier, and because they are hack developers who do not understand how performance graphics work.



So the simpler and better solution for [eg] icons or graphs is for idiots, and the Very Smart Developers are are all off building solutions that might, just might have utterly trivial perfomance gains at the expense of easily writable and modifiable code? Hmm.


Okay, so icons are a different use-case than "graphics" and in particular graphs, right? Font-awesome (as an example) and The Noun Project are excellent packages and ones that use SVGs to good effect.

Graphs, though? Graphs?

The sweet spot for SVGs is when you have relatively small data set sizes, need interactivity, and update the data very little. There's also the question of how competently different browser vendors handle SVG and animation--if you're on a nice desktop or laptop, it'll be great!

Once any of those things change, you need to start looking at using raster or GPU graphics. If your dataset updates frequently (say, faster than every few hundred milliseconds) or is large (say, larger than a few thousand points) or needs to reliably run on mobile devices or older workstations, the SVG approach will show issues pretty quickly.

Oh, and it's not trivial performance gains, unless you have your head so far up your ass that you don't watch how balls slow the average user's device and browsing experience is. Nor is it at the expense of easily-writable or modifiable code, unless you're a hack script-kiddie who cannot fathom how to modularize their code and write clear solutions to problems.

I'm not even going to apologize for this, because there is just so much garbage advice and bad practices going on in the frontend right now because some chucklefuck found D3 and has decided that it has solved all of their charting and drawing problems forever--and never notices how badly their cutesy demos perform in the wild.


>and because they are hack developers who do not understand how performance graphics work.

Nothing "hack" about vector graphics, and nothing about graphics that necessitates "performance" above all else.

We're not all making AAA games.


nothing about graphics that necessitates "performance" above all else.

Brzzt, wrong.

Computers are, at the end of the day, meant for crunching numbers. Graphics is perhaps one of the last pure workloads that is about crunching numbers--it's probably the best match of the advances of the last 20 years to a problem domain we could hope for.

If your code cannot quickly do graphics, you have failed to competently make use of the user's resources. You are bad and are wasting their time and power, and in the one place where that inefficiency isn't justifiable.

> We're not all making AAA games.

Sure but we're also not all running MacBook Pros or GTX1080 cards on Xeons, now are we?

There's this mindset that high-performance graphics somehow only benefits gamers and games, and that's wrong.

Especially in the (mostly single-threaded, highly-marshalled) graphics environment of the browser, it is really easy to write code that will choke older machines to death and murder mobile devices.

This can be done with a large chart dataset, a quickly updating visualization, or any number of other reasonable and normal and non-game use cases.


>If your code cannot quickly do graphics, you have failed to competently make use of the user's resources. You are bad and are wasting their time and power, and in the one place where that inefficiency isn't justifiable

Bzzt wrong. Nobody cares much about efficiency above a certain level. If they did we wouldn't be using your "efficient" canvas, where 30% of calls is JS overhead, but native code.

>Sure but we're also not all running MacBook Pros or GTX1080 cards on Xeons, now are we?

No, but we almost all are running multi-core PCs, laptops and phones that are perfectly capable to run SVG for most things people use it for.

Maybe not plots with 10.000 points, but then again those are just badly designed, the screen doesn't have 10.000 pixels horizontally or vertically to show them all at once anyway.


> Nobody cares much about efficiency above a certain level

This line of thinking is why web mobile experience is garbage.

> Maybe not plots with 10.000 points, but then again those are just badly designed, the screen doesn't have 10.000 pixels horizontally or vertically to show them all at once anyway.

300x300 scatterplot holds potentially 90K points. Even in the case of just 10K datapoints, sampling considerations may mean that it is simpler and more maintainable to just ship full-resolution data to the frontend to be drawn--an option that only exists if you can do so efficiently.

You're wrong on this mate.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: