Code smells: too many parameters, too many attributes (was: pylint -- should I just ignore it sometimes?)
- From: Ben Finney <ben+python@xxxxxxxxxxxxxxx>
- Date: Wed, 20 Oct 2010 12:09:35 +1100
Seebs <usenet-nospam@xxxxxxxxx> writes:
I'm pretty much mystified by a claim that something with seven
instance attributes is "too complicated".
It's a code smell. Many discrete attributes is a sign that the design
can be improved by combining related attributes into a complex type.
It's pretty much the same smell, with the same range of solutions, as
too many parameters for a function.
\ “Science is a way of trying not to fool yourself. The first |
`\ principle is that you must not fool yourself, and you are the |
_o__) easiest person to fool.” —Richard P. Feynman, 1964 |
- Prev by Date: Re: OO and game design questions
- Next by Date: Re: merge list of tuples with list
- Previous by thread: Re: pylint -- should I just ignore it sometimes?
- Next by thread: Re: Code smells: too many parameters, too many attributes (was: pylint -- should I just ignore it sometimes?)