Live data from Hacker News

"Clean" Code, Horrible Performance (2023)

computerenhance.com

191–192 of 192 posts

Re: "Clean" Code, Horrible Performance (2023)

#192
post #142
post #124

Earlier quoted context omitted.

I've heard this called "lasagna code". I've definitely drifted towards longer code, if nothing in that function is used elsewhere. Some tasks really are just lists of things to do (especially in something like image processing), and I think that sometimes it doesn't make sense to put lists of lists in your list of things to do.

But in many cases, you could split it up into smaller, `inline` functions.

Yes, you can redirect the reader eyes elsewhere as many times as you like. That's the beauty of lasagna. There's a happy medium though. I've seen some people say "functions shouldn't be over 10 lines", which makes code, like I'm describing, near impossible to comprehend, requiring nonsensical divisions of work.
Post reply on HN