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.

Better ways to name your utils module

3 pointsby the_bookmakerover 1 year ago

2 comments

andreareinaover 1 year ago
utils.py is better than the alternative of every module reimplementing some common utility, or importing an otherwise unneeded module because that's where said common utility was first implemented. The fact that there's util.py in the first place is a good thing. Now, if it gets big and disparate enough then having foo_utils.py and bar_utils.py might be even better (but maybe they should be in their own subpackages instead, i.e. foo/utils.py and bar/utils.py?), but that doesn't make utils.py bad.
ttyprintkover 1 year ago
I like to see core.py more than any of those. Things accumulate in util.py because you can’t find them in the standard library. (Right?) So don’t diminish them as misc or helpers.