Lars Wirzenius

Lars Wirzenius at

At work, I'm written a big bunch of code and now i'm reviewing it before I show it to others. Such bad code, several methods are more than five lines long!

When I was young, I found it exciting that I could write functions that were several hundred lines long. Then I realised that was silly, so I shortened them to under a hundred. Than to under 50. Then to under 25. Now I go for 5. Old age and senility...

Claes Wallin (韋嘉誠), Tyng-Ruey Chuang, Timo Kankare, jrobertson and 2 others likes this.

Claes Wallin (韋嘉誠), Claes Wallin (韋嘉誠), Claes Wallin (韋嘉誠) shared this.

on some of the code I support at work, there are some procedures >1500 lines. :-(

jrobb at 2015-04-15T14:23:34Z

I recently refactored some signal processing code at work. My goal was to both make the code more maintainable as well as reverse engineer what it was doing. Most of the code was contained in a few large functions that could not be understood readily. I broke it up into many smaller functions that did one thing, keeping the code otherwise the same, and not only is it now easier to understand, but the compiler produced faster code. About 15 to 30 % reduction in runtime. (I verified the new code has exactly the same signal response as the old code.)

Charles Stanhope at 2015-04-16T12:55:19Z

Amitai Schleier, Claes Wallin (韋嘉誠), Lars Wirzenius likes this.