From: Johan Nilsson Date: 2005-01-20T18:56:00+09:00 Subject: Re: File naming conventions "Brian Schr�der" wrote in message news:20050119151735.3b691d93@black.wg... > On Wed, 19 Jan 2005 17:51:02 +0900 [snip] >> > > I like grouping functionality into one file. There is no reason like in > java to have only one class per file. And I often create really small > classes for simple tasks, so it would be tedious to have that many files. Well, the main reason would be that user's could simple 'require' what they need to avoid loading stuff not needed. OTOH, small classes that aren't meant to be used directly by users could very well be included in the public interface classes' files. But that's my personal opinion. If there are lots of classes that are most often used together, one could use a common file that simply groups the classes by functionality (by 'requiring' their implementation files). > > On the other hand one module may stretch along various files, if those add > functionality to the module. Sure, that's pretty common for me (as I have ~1 class/file and many classes per module). > In some cases I even have multiple files per class, such that I can choose > the subset of functionality I need for the class. Interesting. So far I've only used that to extend classes that aren't "my own". > > The only advantage of one class per file is easier browsing if you have a > bad editor, but this can be overcome easily with using e.g. emacs or even > a ruby ide like arachno ruby (Never tried it, but there are lots of people > here on the list who seem to like it). Ok. And the lowercase naming convention? // Johan