3 ms·
I object to the 're-write as function'. Functions come with abstraction overhead. You don't know who will consume them, so you may have to put up type checks,
by jollybean 4y ago
I object to the 're-write as function'.
Functions come with abstraction overhead. You don't know who will consume them, so you may have to put up type checks, null checks other BS.
Also - functions split up the logic all over the place, it's confusing.
I think what we need are 'nested functions' which serve to kind of create a scope pushed to the stack - with an implicit 'return' - which we can then 'collapse' in the GUI etc..
I mean, it's purely cosmetic from a CS point of view, but it might help to organize things a bit better and hand off abstractions in long function implementations.
Huge projects with 1 or 2 line functions drive me crazy - you have to constantly jump around all over place to figure out what's going on. I actually believe it's a historic anti-pattern.
I make functions when we need 1) used in different places 2) meaningful abstraction.
Otherwise, well documented longer functions for me.