←back to thread

192 points imasl42 | 1 comments | | HN request time: 0.201s | source
Show context
shakna ◴[] No.45311422[source]
> bikeshedding function names

... Function names compose much of the API.

The API is the structure of the codebase.

This isn't some triviality you can throw aside as unimportant, it is the shape that the code has today, and limits and controls what it will have tomorrow.

It's how you make things intuitive, and it is equally how you ensure people follow a correct flow and don't trap themselves into a security bug.

replies(4): >>45311467 #>>45311534 #>>45311834 #>>45312683 #
1. jffhn ◴[] No.45312683[source]
Agreed. A program is made of names, these names are of the utmost importance. For understanding, and also for searchability.

I do a lot of code reviews, and one of the main things I ask for, after bug fixes, is renaming things for readers to understand at first read unambiguously and to match the various conventions we use throughout the codebase.

Ex: new dev wrote "updateFoo()" for a method converting a domain thing "foo" from its type in layer "a" to its type in layer "b", so I asked him to use "convertFoo_aToB()" instead.