[Opinion] Function length and time to answer

Kent Beck asked a question 'How long should functions be?' Obviously, the answer isn't one number but his interest is in the distribution curve of function length in your applications. Tudor Girba responded by producing a distribution curve for functions within GT, a 1.9M LoC (Lines of Code) application. It took him 3 minutes to do this.

My interest is in how quickly people can provide explainable, accurate and representative answers.

So, I asked people to report how long they took to answer Kent's question or if it would take too long to guestimate.

No-one has responded. I'll be provocative and throw down a gauntlet. I suspect that no-one has responded because it would take too long. That's ok, I would guestimate that this problem would take around 30 hours work to solve in a non moldable environment.

The concept of "time to answer" (ttA) is something I've been thinking about. In a moldable development environment, questions about your system can be answered in minutes. In most traditional environments, the same questions take hours or days. This gap is not a minor inconvenience - it's a fundamental barrier to understanding.

If you can't answer basic questions about your own system quickly, then you don't understand your system. And if you don't understand your system, you can't make good decisions about it. This is why moldable development matters - not because of any single feature, but because it dramatically reduces the time to answer.

I'd challenge any engineering team: how long would it take you to produce a distribution curve of function lengths for your largest codebase? If the answer is more than 10 minutes, ask yourself why. And then ask your managers why they're comfortable making decisions about systems they can't interrogate.

Originally published on LinkedIn.