Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: What are ways programmers "reframe" problems to make them easier?
3 points by canxerian 36 days ago | hide | past | favorite | 3 comments
I write shaders and I often use HSL colour space rather than RGB. This solves a few problems: keeps contrast ratios consistent (by keeping luminance, L constant). Adjusts hue, H, whilst keeping the colour palette in harmony.

It also means I need only modify 1 value rather than 3.

What are other ways in which programmers reframe problems to make them conceptual easier and the implementation more straightforward?




Not to be dismissive, but we could describe all of programming this way. Since computers just run machine code and deal only with simple math and swapping memory and storage values, all of our code is just "reframing" the problem in different ways. We pick the language or abstraction that's easiest to work with for what we're trying to accomplish, like you did with picking the "HSL" language over RGB. In reality, both will be converted to binary values in storage and voltage levels in your monitor.


While trivially true, I think the question has merit as some of these reframings are more interesting than others.

In physics for example, Lagrangian mechanics[1] is an interesting reframing of classical physics allowing for drastically simpler implementations in certain cases, while still just being a bunch of partial differential equations and numbers.

In engineering and signal processing, the Laplace transform reframes time-varying signals such[2] that it's much easier to calculate or design the resonse of a system.

Back in programmer land, several such useful reframings that aren't directly rooted in physics or linear algebra that I can think of come from crossing the functional-imperative border.

Another is inversion of control[3], in the general sense[4], where you pass the code modifying the behavior, rather than explicitly drive the modified behavior from the outside.

[1]: https://en.wikipedia.org/wiki/Lagrangian_mechanics

[2]: https://en.wikipedia.org/wiki/Transfer_function

[3]: https://en.wikipedia.org/wiki/Inversion_of_control

[4]: https://martinfowler.com/bliki/InversionOfControl.html


Thanks for these.

Here's another one: coordinate space (e.g object, world, normal, tangent) to make vertex transformation calculations almost trivial.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

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

Search: