I strive to have single-responsibility consise functions, but regularly I have functions that flow like this:
logic part1 (~5 lines of code)
logic part2 (~5 lines of code)
return (the results of part1 and part2)
In JavaScript, I have found this style of programming very self-declaring and easy to read (perhaps in an AMD-flavored environment):
performCalculation: function() {
function part1() {
// 5 lines of code
return ...
}
function part2() {
// 5 lines of code
return ...
}
return part1() + part2();
}
Is this good form? Or, is using "function foo() {}" clunky?