Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> We should be using whatever abstraction is easiest to reason about

I dare mention Rich Hickey and his talk “Simple Made Easy”, and postulate that we should be using whatever abstraction is _the simplest_ (not the easiest one) to reason about, to which the grand parent rightfully refers, as far as I understand.

Objects are easy to many, but far from being objectively simple.



I would have linked the Principle of Least Power[0], but same idea. Rich certainly fleshes the idea out with more examples and I deeply respect his opinions.

I can't find it but there once was a blog that expressed this as: Reddit is a site where you can talk about anything with the exception of a few banned topics. Voat(might have been another reddit clone?) is a much less popular site where you can talk about anything. What do they talk about on Voat? Only the few topics banned on reddit.

While is strictly more powerful than for, for is strictly more powerful than foreach, foreach is strictly more powerful than map. And yet 95% of the time, the power in map is sufficient. Therefore 95% of the time you should use map. When you encounter a foreach, you should be expecting non-purity. When you encounter a while, you know that it's doing some recursive operation that requires that power.

This let's you reason about it. This allows you to compose these less powerful things.

[0]: https://blog.codinghorror.com/the-principle-of-least-power/


Rather than that I should've written, "we should use whatever abstraction makes the problem easiest to reason about".

I have no preference for either fyi.




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

Search: