I was reviewing some rails code lately and I see that in some cases
they use private methods (especially in application controller
methods). I understand that it is considered a good practice since the
methods aren't used anywhere else outside of application controller,
but my question is:
What would happened if you never use private methods? Will it be some
security issue (and if yes, I'd like to see an example if it is
possible), is it just a good practice just to use methods inside the
scope of the class that it's been used or is there any gains in
resources because there is narrower scope?
It might sound pretty newbie question but I am fairly new to OOP and
I'd like some guidance in this topics (even from some book or resource
about stuff like that).
(I show a debate lately if there are any real advantages of OOP over
procedural programming and if OOP is just a myth and I am thinking
this a lot lately, so I decided to learn more about OOP and decide for
myself... I was also wondering if ruby and rails could be done with
procedural programming, instead of classes use functions and what it
couldn't be done so easily).