Namespaces, file names,...

Derek Atkins warlord at MIT.EDU
Tue Sep 9 10:15:58 EDT 2014

John Ralls <jralls at> writes:

> I agree that filenames should reflect the class that they implement,
> when they do so, and I’ll add that in general a file should implement
> only one class. Capitalization is OK as long as one keeps in mind that
> the Mac file system is normally case-preserving but case-insensitive,
> so e.g. Account.h and account.h will map to the same file.
> I don’t think we want to give each directory its own namespace. I’m
> not even sure that we want any namespaces inside ‘gnucash’.

I kind of like the Ruby on Rails method, where the file name is the
lower-case snake form of the class name.  E.g., a class Account would be
in a source file account.[ch], a class ScheduledTransaction would be in
a file scheduled_transaction.[ch], etc.

I agree that we don't need to have a directory for the namespace, and I
also don't think we need to have namespaces for each "module/library".
E.g., I don't think we need GnuCash::Engine::Account.  I suspect doing
so would just add complexity where it might not be warranted.


       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL:    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available

More information about the gnucash-devel mailing list