29 ms·
Now you've got way less code, and way more cognitive load per line. To someone who isn't familiar with that particular idiom, perhaps it causes more cognitive
by Silhouette 13y ago
Now you've got way less code, and way more cognitive load per line.
To someone who isn't familiar with that particular idiom, perhaps it causes more cognitive load at first. Sometimes you have to learn new ideas and techniques to make the best use of your tools.
On the other hand, once you are familiar with the idiom, what you see there is a concise and easily readable representation of the main algorithm, together with a quickly recognisable, robust way of dealing with the edge cases.
Would you also object to someone using structured programming because it causes way more cognitive load than just writing goto everywhere?