2 ms·
If we're debating style anyway I'd argue using agent nouns as a class name is a worse offence. Compare index = RepositoryIndex(args.architecture) stati
by contravariant 3y ago
If we're debating style anyway I'd argue using agent nouns as a class name is a worse offence. Compare
index = RepositoryIndex(args.architecture)
statistics = RepositoryStatistics()
for repository in index.retrieve_repositories():
for repository_file in repository.files:
statistics.increment_file_count(repository_file.name)
This is still mostly equivalent to the original, but a lot easier to read and pretty much every word removed from the name can be inferred from the type.
It can be made even less verbose but at this point there's no real need.
- jimmaswell 3y agoNo one was ever hurt by a noun in a variable. Longer and more descriptive is fine.