Log in Sign up
2 Matching Annotations
  1. Jun 2023
  2. stackoverflow.com stackoverflow.com
    Private vs Protected - Visibility Good-Practice Concern
    2
    1. TylerRick 19 Jun 2023
      in Public
      I'm not saying never mark methods private. I'm saying the better rule of thumb is to "make methods protected unless there's a good reason not to".
      reasonable defaults rule of thumb member visibility: make it protected unless you have a good reason not to can't predict the future you can't know for sure never say never
    2. TylerRick 19 Jun 2023
      in Public
      I can't count the number of times I've been wrong about whether or not there will ever be a need to override a specific method I've written.
      can't predict the future you can't possibly know you can't know for sure
    Visit annotations in context

    Tags

    • you can't know for sure
    • rule of thumb
    • reasonable defaults
    • member visibility: make it protected unless you have a good reason not to
    • never say never
    • you can't possibly know
    • can't predict the future

    Annotators

    • TylerRick

    URL

    stackoverflow.com/questions/8353272/private-vs-protected-visibility-good-practice-concern
Share:
Group. Only group members will be able to view this annotation.
Only me. No one else will be able to view this annotation.
Hypothes.is
  • About
  • Blog
  • Bioscience
  • Education
  • Jobs
  • Help
  • Contact
  • Terms of Service
  • Privacy Policy