Hacker News new | ask | show | jobs
by mattdw 4514 days ago
I quite like this idea. A lot of toolkits already allow a widget to specify a "preferred size." I wonder if a simpler approach to your idea would be similar to e.g. the Accept-Content-Type HTTP header; a widget lists a series of preferred widths (or width ranges) with weights.

  preferred-width: 300px, 1.0; 200px..299px, 0.7; 100px..199px, 0.5;
That's slightly less flexible than a utility curve function, but (especially if ordered) is far easier to optimize for, as choices are ordered and restricted.