Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!uflorida!novavax!twwells!bill From: bill@twwells.com (T. William Wells) Newsgroups: comp.lang.c Subject: Re: Naming conventions Message-ID: <1989Jun20.110051.3974@twwells.com> Date: 20 Jun 89 11:00:51 GMT References: <10268@watcgl.waterloo.edu> <548@corona.pb> <18137@mimsy.UUCP> <1297@garcon.cso.uiuc.edu> Organization: None, Ft. Lauderdale, FL Lines: 28 In article <1297@garcon.cso.uiuc.edu> mcdaniel@uicsrd.csrd.uiuc.edu (Tim McDaniel) writes: : Usually, I would not have "g_" prefixes on the members. Instead, I : name *pointer and structure variables* according to their types. I : would declare a pointer as : struct glumph_t * glumph_p; : (thereby confusing the hell out of any LISP programmer who stumbles : upon my code, but he deserves it) or even as : struct glumph_t * glumph; : : You see, I *really* *like* descriptive names. If they're long, c'est : la vie. If a variable represents a descriptor (in places where : there's no confusion about what kind of thing it's descripting), : I bloody well call it "descriptor"! Or at least prefix it with : "desc_". The scheme you use is only appropriate for *generic* pointers of a given type. In other words, if I have a pointer used for a general temp, I'm likely to call it struct passwd passwd_ptr. But if I use the pointer to refer to a particular structure, I use something like struct passwd users_password_entry. And in that case, the field name prefix helps clue me in as to the specific structure. No, I don't think that struct passwd users_password_entry_passwd_ptr is a good idea; the thing defeats the purpose by being unreadable. --- Bill { uunet | novavax | ankh | sunvice } !twwells!bill bill@twwells.com