Clean Code says to avoid protected variables

Posted by Matsemann on Programmers See other posts from Programmers or by Matsemann
Published on 2012-08-28T15:04:49Z Indexed on 2012/08/28 15:50 UTC
Read the original article Hit count: 392

Filed under:
|
|

I have a question to a statement in Clean Code. I don't fully understand the reasoning to why we should avoid protected variables.

It's from the chapter about Formatting, section about Vertical Distance:

Concepts that are closely related should be kept vertically close to each other. Clearly this rule doesn't work for concepts that belong in separate files. But then closely related concepts should not be separated into different files unless you have a very good reason. Indeed, this is one of the reasons that protected variables should be avoided.

© Programmers or respective owner

Related posts about java

Related posts about agile