0
我想知道如何才能更好地命名。过滤器类的命名约定?
我已经有类Filter
(它正好是在Ruby中,但语言不是那么重要),其过滤对象就像这样:
class Filter
def initialize(items)
@items = items
end
def filter
#returns filtered items
end
end
在使用中,它看起来是这样的:
items = Filter.filter
我不喜欢它。有没有人有更好的这个建筑?
它是'Filter.filter',如果这没有关闭他们,我对答案感兴趣...命名事物始终是编码中最困难的部分。 – Ben 2012-01-31 20:43:14
是的,这是什么语言? – kindall 2012-01-31 20:49:11
这是Ruby,而不是Python ... – rubik 2012-01-31 20:54:45