Readit News logoReadit News
Animats · 7 years ago
He's talking about basic arithmetic. Sums. Averages.

(Front end design ought to have more math behind the scenes, like a constraint solver, and less arithmetic visible to the web designer.)

bmuon · 7 years ago
I was also a bit disappointed to find basic arithmetic. There is more. I was expecting something like an algorithm for a tile layout like https://masonry.desandro.com/ or https://github.com/d3/d3-hierarchy#treemap. In terms of animations, understanding linear algebra can help you take full advantage of CSS matrix and matrix3d transforms. Certain parallax effects can be done done better with trigonometry...
panic · 7 years ago
When you're implementing a user interface, you typically have some "design" or model of how it should work in your head. The main challenge is translating this intuitive model into a formal model that the computer can interpret for you. Math can definitely help you with this!

I think we should be emphasizing mathematical knowledge in front-end design and implementation, not trying to hide it under the covers. The better you are at math, the easier it is for you to implement the correct system for the design you want, and the less you have to compromise the design to fit the systems you have at hand.

j2kun · 7 years ago
IIRC Apple had a svg layout system that used integer programming for optimizing layout.

At least, the dot graph layout language uses integer programming to lay out it's graphs.

anothergoogler · 7 years ago
How would one express those constraints? I think it's more efficient to let a human designer figure out some approximation of decent design and usability.
Animats · 7 years ago
The way it's done in 2D sketch programs such as the sketch feature of Fusion 360 or Autodesk Inventor. Graphically. I've discussed this before on HN. All the modern CAD systems do this.

It took decades to get CAD GUIs right, but now they're quite good. They solve a far harder problem than web design. Look to them for guidance.

perfmode · 7 years ago
iOS Auto Layout is an example
JAdamMoore · 7 years ago
Tantek Çelik did some of this experimentation, amazingly, over a decade ago (2001). Right-click for his CSS: "A Study of Regular Polygons" http://tantek.com/CSS/Examples/polygons.html
Waterluvian · 7 years ago
I pretty much just abuse flexbox to make things go where I want them to. It's nice to see how you'd calc all these things though!
kgoutham93 · 7 years ago
Off topic, but are there any accessible resources to learn: 1. How fonts get rendered? What happens when I present browser with a font file and some utf-8 bytes, how does it convert this into viewable text.

2. Once browser creates DOM and CSSOM how does it use this information to create the view that I see?

g_delgado14 · 7 years ago
kgoutham93 · 7 years ago
Hey nice resource but this is more of a tutorial on how to optimize font loading etc... >The browser performs layout and paints content to the screen. This is the step I want to understand more thoroughly..

Deleted Comment

Bahamut · 7 years ago
I'm surprised at the lack of talk about matrices with regards to frontend for animation.
Animats · 7 years ago
Game developers have to know far more math than web developers. Basic game developers need to know trig and matrix math cold. Advanced game developers need differential equations for physics engines, some topology for mesh handing, and AI for NPCs.

Deleted Comment

tzahola · 7 years ago
I find the font on this site pretty annoying to read.
suprfnk · 7 years ago
Same, and this seems to happen so much on different websites that I made this bookmark:

    javascript:(()=>{document.querySelectorAll("p,div,article,section,ul,ol,li").forEach(x=>{x.style["font-family"]="Verdana";x.style["font-size"]="16px";});})();
It selects all tags that generally contain content and sets the font to Verdana, with a font size of 16px. Whenever I get to such a site, I just click the bookmark and it's readable.

onion2k · 7 years ago
You have control over what your computer does. You don't have to accept things you don't like. Change it.
tzahola · 7 years ago
Sure! For example I commanded my browser to close this page.