Comments are useful when they provide information that is not in the code (e.g. rationale for the choice of an algorithm, source of a regular expression that parses an URL). Your example HTML encoding function can be coded as:
def clean(foo)
return [foo, foo.apply_html_encoding]
end
The encoding logic should be contained in apply_html_encoding. The point is that most of the functions/methods that are 65 lines long are badly coded.
Comments
Comments are useful when they provide information that is not in the code (e.g. rationale for the choice of an algorithm, source of a regular expression that parses an URL). Your example HTML encoding function can be coded as:
The encoding logic should be contained in apply_html_encoding. The point is that most of the functions/methods that are 65 lines long are badly coded.