Software Engineer @SciFY.
Live to learn something new -and write cleaner and more sustainable code- every day.
Passionate with learning and discovering new technologies, history, and psychology.
Hey Janne, thaks for your fruitful comment. You are right, I also tend to use protected instead of private in my code, so that I can be able to extend the class and create sub-classes.
However, the point of the code snippets in this article is to provide a view of a layered MVC architecture and modularized classes.
In a more realistic scenario one would have preferred to use protected, for all the reasons you referenced.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey Janne, thaks for your fruitful comment. You are right, I also tend to use
protected
instead ofprivate
in my code, so that I can be able to extend the class and create sub-classes.However, the point of the code snippets in this article is to provide a view of a layered MVC architecture and modularized classes.
In a more realistic scenario one would have preferred to use
protected
, for all the reasons you referenced.