3 ms·
How I explain why LoC is a bad metric to non-techsavvy people. 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 + 3 = 45 And so is 3 * 15.
by mettamage 7y ago
How I explain why LoC is a bad metric to non-techsavvy people.
3 +
3 +
3 +
3 +
3 +
3 +
3 +
3 +
3 +
3 +
3 +
3 +
3 +
3 +
3 = 45
And so is 3 * 15.
- VectorLock 7y agoI once had to work with some outsourced developers who would do "something(); something(); something();..." rather than "for(int i = 0; i < 10; i++) something();" when instructed to repeat something X times.
- ascar 7y agoIt's called loop unrolling and improves performance by eliminating loop control overhead and reducing branch mispredictions. Maybe they had a compiler background :)? /s
- ktpsns 7y agoIf they had, they would know that virtually any compiler can do this on his own. I also know these examples and I know the people who are writing them. "Copy & Paste" coding is just more convenient for them instead of writing a loop, fizzling with brackets, indation or whatever. They don't produce high entropy code.
- jeen02 7y agoNo way, you're telling me 153 is the same as 315? :O
- mettamage 7y agoYep, it's commutative.
- downerending 7y agoYou joke, but I've seen code almost exactly like this in commercial software.