DEV Community

Discussion on: What programming best practice do you disagree with?

Collapse
 
kl13nt profile image
Nabil Tharwat • Edited

It's not only about abstractions nor length. If a function becomes too long the engine won't be able to optimise it if the size of the bytecode generated after compiling the function exceeds 64 KiB in the case of Java on JVM, and 60 KiB in the case of JavaScript on V8, even if the function is considered "hot", invoked very often, that is. So, it's more about measuring the trade-offs of using longer functions vs breaking them up into smaller ones.

Edit: I just realised this was posted over 4 months ago.