• 12 Posts
  • 1.28K Comments
Joined 3 years ago
cake
Cake day: July 2nd, 2023

help-circle












  • This is a bit reductive. Scope and visibility matter. A private function called by precisely two implementers within the same package doesn’t need to do heavy lifting on naming. It can be short; in fact I’d argue that it should be. Contributors working on the package can scan the code more quickly and will already know what is happening in that scope. Same for variable names.

    On the contrary, publicly consumed functions called across maybe hundreds of scopes should be crystal clear in the name, maybe even largely implying the contract.

    But even those probably have exceptions. So while I agree that names should be thoughtfully considered, one shouldn’t take the “name and parameters should tell all” axiomatically. It’s not so simple.