3 ms·
I sympathize with your position, but in this case the two liner is significantly more readable. I had no problem digesting it. I then looked at the longer versi
by BeetleB 3y ago
I sympathize with your position, but in this case the two liner is significantly more readable. I had no problem digesting it. I then looked at the longer version and it was a much higher cognitive load to digest that. I have to look at multiple for loops to realize they're merely counting the words in a corpus. The shorter version lets me see it immediately.
- NathanFulton 3y agoIt's probably a matter of audience. For the folks I've been teaching lately, who mostly know some combination of Java/C++/MATLAB, the Pythonic version is probably harder to follow. Anyways, now I have two ways of saying the same thing, which is always nice to have when teaching.