Skip to content

Comment on Simple Is Not Smallparent

Comments

This bothered me too. The author even said:

Now, let's say we want to make a small change: show the output in the original file order. In Clojure, this is fairly straightforward: store an ordered sequence of the words in word_seq, store a map from each word to its frequency in freq_map, iterate over the sequence, and look up each word in the map:

Emphasis on just "storing" something. The author seems to not understand that this change makes the solutions categorically different.

It's a little like critiquing the efficiency of moving a piano up a stairwell by saying why didn't they just use a crane via the window? Using a crane isn't a better way of getting a piano up the stairwell.

I think the assumption here is that the set of distinct words (hence, also the keys of the frequency map) will be small compared to the overall file.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.