Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!tgr!COTTRELL@BRL.ARPA, JAMES From: COTTRELL@BRL.ARPA, JAMES Newsgroups: net.lang.c Subject: Typedef Message-ID: <532@brl-tgr.ARPA> Date: Thu, 8-Aug-85 15:46:50 EDT Article-I.D.: brl-tgr.532 Posted: Thu Aug 8 15:46:50 1985 Date-Received: Sun, 11-Aug-85 06:10:05 EDT Sender: news@brl-tgr.ARPA Lines: 39 > Typedef is my bugaboo too. When whoever invented it invented it he broke what > was uptil then a cardinal rule of C........ you could look at a indentifier > and what was immediately around it and tell exactly what it was > variable > array[] > function() > "null terminated string" > 'character' > along with the non-enforced rule that defined constants were in capitals. > CONSTANT > maybe what is needed is some such rule (as for defined constants) that lets > you know immediately that you are looking at a type name rather than a variable. > Also at Intel we used to use first letter capitalized to indicate a macro > function. I beg to differ. I typedef all my struxures. Makes casts shorter. typedef struct foo { ... ... } FOO, *FOOP; FOO foo = { ...,...}; FOOP foop = foo; FOOP barp; ... ... barp = (FOOP); /* loox better than */ barp = (struct foo *) ; /* noisy */ Besides, you've got problems with #defines anyway. #define variable function() #define field ptr->fld I suppose you disdain these as well. When used carefully & consistantly, these can be a boon to readability. jim cottrell@nbs */ ------