Tag Info

New answers tagged

7

Use the entire method signature to specify your intent, not just its name. Method names should represent verbs not phrases. Your method signatures can be written as: Get(object id) Get(Date day) Update(object id) Get(string name, string surname) Get(Filter filter) Get(string name, string surname, Date day, string country) Get(Date greaterThan); Get(Date ...


0

Visitor classes should strictly follow SRP (Single Responsibility Principle) so using visit as common naming convention would be the most appropriate. As far as entity classes are concerned, they will usually do more than allow visitor classes to visit them, so name accept can introduce naming conflict if entity class would have accept method that serves ...


4

Naming things is hard. But in my experience, ambiguity like this can almost always be solved by using a slightly more verbose name in the right place. The alternative method names you suggested are indeed ugly; in this example my first choice would be to rename the parameters: public interface Component { int Read(int portID, byte[] outputBuffer); ...


3

What's worse than dealing with this is dealing with projects that have dealt with it in a cute way. If I know something is supposed to be in a namespace, then at least I know that. I know it in all projects whenever I work with it. It might work great for you but anyone else who has used that library will be unnecessarily confused. And probably really ...


9

Accept and use each library's preferred naming preferences. To do anything else would add a layer of abstraction between the true names and the ones you've picked to enforce your preferred style. That makes it somewhat of a nightmare to look up anything (including the library documentation for a method or function), unless the only real difference is ...



Top 50 recent answers are included