2 Replies Latest reply on Oct 5, 2010 4:35 PM by __Kent__

    Adobe Developers' overuse of 'private' instead of 'protected'

    __Kent__

      I fear this will fall on deaf ears, but it has been a hurdle so many times that I'm compelled to attempt to make a difference by posting this message.

       

      Dear Adobe,

           Would you please find a way to instruct your developers that, although they've been taught in the ivory towers that anything not 'public' should be 'private', this is, in fact, nearly universally the wrong instruction.  When a developer finds a need to extend or subclass your class to make minor (or major) modifications, they will almost undoubtedly need access to some or many of the attributes which you've incorrectly assigned the label 'private' to.  Think 'protected'!   By default, anything not 'public' should be 'protected', not 'private'.  Marking all these attributes 'private' takes otherwise useful code and makes it useless so far as the object oriented design and inheritance is concerned.  'protected' is still inaccessible to *everything using the object*, with the single exception of an inherited class!  If someone is extending your class, these will still be nonpublic to everything else.  I am generally not arrogant enough to suppose that I can foresee all future uses and extensions to a class I am writing, which is a prerequisite to branding an attribute 'private'.  Unless there is an extremely good reason an attribute should be 'private', by default please make it 'protected' because you cannot foresee all the future use cases for your class that are killed with 'private'.

      Please?