Live data from Hacker News

Ruby Access Control - Are Private And Protected Methods Only A Guideline?

skorks.com

1–3 of 3 posts

Re: Ruby Access Control - Are Private And Protected Methods Only A Guideline?

#3
I was just writing a bit of code in javascript (http://github.com/dsimard/jskataUndo/blob/master/jskataUndo....) when I saw this post on HN. I was wondering "should I make some functions private?" and the answer is "NO". Why would I do this? Is this because I don't trust programmers? Why should I care if someone messes up with my "private" things? It's his problem after all. If you look at the source, you'll see that I have a private section at the end but it means "you don't need to use this to make it work".

(note : there are some ways to make things private in javascript as I wrote there : http://www.javascriptkata.com/2009/09/23/how-to-create-an-ob...)