LoC Is a Dumb Metric for Functions
theaxolot.wordpress.com·16w·

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...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help