From: Michal Suchanek Date: 2009-09-01T18:33:10+09:00 Subject: Re: Private methods’ viability (was: What is the ruby conventions to name private method?) 2009/8/31 Shot (Piotr Szotkowski) : > Ryan Davis: > >> 4) Don't have private methods if you don't need them. >> 5) You don't need them. No, really. > > I’ll bite. Note: I consider myself a beginner Rubyist and I’d love to > hear your (and others’!) reasons for the above and/or against the below. :) > I guess this depends on the size of your classes. I only write relatively small things in Ruby so I can track which methods are what without this hint. I also have methods that are "private" in a sense that is not possible to express with the private or similar keyword in any language I know - they span multiple classes and work nicely together but not necessarily by themselves - ie. inspect variant that produces HTML representing a structure involving multiple classes and which also needs to get the top-level HTML header/footer somewhere to work well. I would think that you should not get classes so large that you need private methods to make the class usable but Array mentioned in another email is a good counterexample. The other reason would be when writing a library there is no easier way to express which methods are intended for outside use and which not. The user can still get at the private ones but they should not be surprised if they disappear or work in a completely different way in next version of the library. So would suggest to decide which methods *should* be private and document that. Adding the actual keyword is optional and may be useful in some cases and get in your way at other times. Thanks Michal