Hacker News new | ask | show | jobs
by endorphine 529 days ago
I was expecting a visual comparison towards the end of the article, where you would be able to click a button and both the eager and lazy versions would start executing simultaneously, one displayed next to the other, and you would clearly see that the lazy one completed earlier. This would make it even more obvious how the lazy one is faster.

Nevertheless, this was great.

1 comments

Thanks for the feedback. I was thinking along those lines but settled on a version that let you toggle between the two. I’ll keep this in mind for next time though.

There are probably a lot of fun variations to explore. Since this post seemed to resonate, I may be motivated to try some more experiments.

I find horizontal/vertical is usually confusing (not to you obviously). Here is an example: https://www.investopedia.com/terms/h/horizontalanalysis.asp Maybe easier to stick with the lazy/eager wording?
That’s fair. I acknowledge that terms like "horizontal" and "vertical" may be overloaded or even confusing, in this case, if it’s difficult to see the connection with the visuals. This is somewhat part of the risk in trying to explain a concept in a less-than precise way to introduce a new concept.
I love the visuals - they are fantastic at showing the difference.

If the visuals were vertical then the filtering might look more natural because time would be left-to-right and balls would have natural gravity and fall "down" through filters? Code runs top to bottom so I'm guessing it would still be clear.

And putting a number in each of the balls might help clarity too :-)

The only crazy thing is that Haskell lazy is pull (right) whereas Ruby lazy is still push - so the lazy keyword is somewhat confusing but that can't be fixed.

I am not criticising and certainly don't want to make unnecessary work for you. Graphic design and animation are dark arts!

Your site is broken...
Bummer, I can’t reproduce. Could you share more details?