LoC Is a Dumb Metric for Functions
theaxolot.wordpress.com·5h·
Flag this post

What’s the quickest giveaway that someone’s an amateur developer?

When they tell you to break out a function into smaller functions, and the first reason they cite is “it’s over X lines of code.”

Yeah, you heard me.

This article is targeted at people who are so easily intimidated by long functions that they fail to see deeper issues with them.

It’s about people who take a linear function with no repetition or need for reusability, break it out into smaller functions, and think they accomplished something.

I’ve written one-liner functions (besides getters and setters). I’ve written one-hundred-liner functions. I’ve written everything in between, and I have no regrets. So let me teach you some things you should’ve been taught a long time ago.

Lesson 1: Stop using aesthetic…

Similar Posts

Loading similar posts...