This month I want to highlight a blog, The Bumpy Road Code Smell: Measuring Code Complexity by its Shape and Distribution by Adam Tornhill. Adam first reviews cyclomatic complexity, a long-used measure of code complexity, and posits that cyclomatic complexity is ineffective because it does not account for human psychology. We can only store a small handful of items in our working memory at any one time, and code that requires larger working memory buffers are inherently complex. Adam positions Bumpy Road complexity as an improved measure that accounts for our humanity when measuring fragile code. Since humans remain the common thread across all code creation, it makes sense to improve our tools’ effectiveness by leveraging human psychological limitations.
https://codescene.com/blog/bumpy-road-code-complexity-in-context
“The human brain is the most limiting factor we have in programming. From a cognitive perspective, one major bottleneck when reading code is a construct called working memory…Unfortunately, working memory is also a strictly limited cognitive resource; there’s only so much information that we can hold in our head at once and reason about effectively…Depending on the type of information, our working memory might be limited to as little as 3-4 items.”
Leave a comment