News for hackers. Stuff that matters.
Re:Greppability is an underrated code metric by gugagore on Tuesday September 03, 2024 @02:16AM (#41431822)
I am familiar with the situation you describe, and it's a good point.

However, it does suggest that there is an opportunity for factoring "Dog" out in the code, at least by name spacing (e.g. Dog.Model).

Re:Greppability is an underrated code metric by zarzavat on Tuesday September 03, 2024 @04:11AM (#41432509)
That gets to the core of the issue doesn’t it? There are two cultures: Do you prefer to refactor DogView into Dog.View, or do you prefer to refactor Dog.View into DogView.

Personally I value uniqueness/canonicalness over conciseness. I would rather have DogView because then there is one name for the symbol regardless of where I am in the codebase. If the same symbol is used with differently qualified names it is confusing - I want the least qualified name to be more descriptive than “View”.

The other culture is to lean heavily on namespaces and to not worry about uniqueness. In this case you have View and Dog.View that may be used interchangeably in different files. This is the dominant culture in Java and C#.

Re:Greppability is an underrated code metric by kccqzy on Tuesday September 03, 2024 @09:11AM (#41434632)
The second culture that you describe happens also to be how OCaml structures things in modules. It's quite a turnoff for me.
Re:Greppability is an underrated code metric by f1shy on Tuesday September 03, 2024 @02:27AM (#41431877)
That really depends on the context, and specific situation.