TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

On Importance of Naming in Programming

3 pointsby Martinsosover 1 year ago

1 comment

hikarikuenover 1 year ago
Example #2 suggests that the underlying issue is the function having too many responsibilities. I can&#x27;t disagree, but the solution conveniently glosses over the fact that the 3 new functions still need to be called from another function, and that function needs a name too!<p>This can be a useful tension in my experience, since it can indicate when there are too many layers between a program&#x27;s entry point&#x2F;composition root and its functionality.<p>For example, if the three operations in the example are the program&#x27;s only responsibility, I think the proposed solution makes a lot of sense. But if this is only one step in a program, and especially if that step happens multiple times, having the operations wrapped up in a single function might start to make sense again. I don&#x27;t quite agree that it&#x27;s inherently bad code; at some level of abstraction, starting a new worker on a machine starts to look like a single responsibility.