Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Don't name packages common nouns (brandur.org)
8 points by todsacerdoti on June 3, 2024 | hide | past | favorite | 2 comments


As an aside, I like the site author's Atoms/Fragments/Articles hierarchy for content on their website -- both in intent and the names themselves. I've been trying to come up with similar thresholds for my own work. Useful idea!


So, instead of using an import alias for the odd case where you want to name a variable the same name as the package, you will force everyone using the package to have "the java stutter": ratelimiter.Limiter, or ratelimiter.RateLimiter.

Nope. No thanks. I'll stick with aliases and keeping my variables names short depending on their "proximity of use"[1].

[1]: https://go.dev/talks/2014/names.slide#4




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: