digitalcourage.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Diese Instanz wird betrieben von Digitalcourage e.V. für die Allgemeinheit. Damit wir das nachhaltig tun können, erheben wir einen jährlichen Vorausbeitrag von 1€/Monat per SEPA-Lastschrifteinzug.

Server stats:

811
active users

Lenny

@bagder I'm sure you're aware of the caveats but using function length may not be the best metric to measure complexity. What I'm about to write is therefore likely nothing new to you but I'm doing it nevertheless because there are many voices in the software engineering space that apply a naive law of "long function bad, short function good".

While splitting a function into smaller parts may improve readability to some degree, it rarely decreases the mental capacity needed to understand it. I'd argue that it's quite often even the opposite if the code is well-structured:
Blocks can be used efficiently to mimic a function that is specific to a use case, relatively short and not reusable. A separate function would introduce overhead in form of its signature and disruption of the reader's flow because its location is elsewhere in the code. The block can easily be shoved into a function when it becomes larger or when it can be re-used.