Look At All The Code I Wrote!
/via https://abstrusegoose.com/432 Every time I hear stuff along the lines of “ Look at all the code I wrote ”, I check for code-coverage. And I’ve never, ever been disappointed (in a bad way). It’s amazing really — as far as I can tell, the propensity to brag about lines of code written is inversely proportional to test coverage . “I don’t worry about code coverage — that’s what the QA group is for” — #CowboyDeveloper One way to measure the complexity of a piece of code is Cyclomatic Complexity , something Thomas McCabe came up with it back in 1976. At heart it is the number of linearly independent path through code. Or, to put it differently, think of it as all the possible ways in which a given piece of code can actually do whatever it is doing. As you’d expect, the more paths there are through code, 1. the harder it is to keep track of things, and as such, the more documentation you should have. Also 2. the more likely it is tha...