Thomas Weidenmueller wrote:
Casper Hornstrup wrote:
Oh please don’t go there. Do you honestly think you (in general) are smarter at generating microprocessor instructions than a multi-million hour compiler software?
In some places it does matter, especially in the kernel.
Splitting up a 200 lines functions in 10 helper functions IMO is ugly, especially when those helper functions are only used by that one single function. To avoid code duplication I *do* create helper functions, but most often only for things that can be shared with other code. I don't have problems with functions with a few hundreds of lines of code as long as the coding style is acceptable and it is sufficiently documented with comments.
However, we're going off topic...
I think you are on topic. These 10 helper functions usually make you avoid the gotos or the defines. One mans ugly is anothers beauty. Are 10 functions instead of one ugly? Are macros? Are gotos?
regards, Jakob