Article View: gnu.misc.discuss
Article #2184Re: A New Feature for GCC. Part II (again long)(much shortened)
From: Christopher Key
Date: Tue, 18 Jan 1994 04:54
Date: Tue, 18 Jan 1994 04:54
45 lines
2883 bytes
2883 bytes
Please note, this is not a flame, but the problems I have with any naming schema such as you are describing is that it places emphasis on the _type_ of an item instead of the _use_. Unfortuneately, this is a religious subject among programmers, so you aren't very likely to get much intelligent discussion on the topic. As an example of what I am talking about, the most common area of programming that I am familiar with that uses a schema like you are describing is programming for microsoft windows, and IMHO the naming conventions used are awful. Most of the example programs you see have variables with names like: HWND hwnd; char *lpszString; HDC hDC; These names are terrible (and yet names like these seem to be the norm). The people who write code with names like this think they have done the people to come a service, but in reality I think that they have done a great disservice. I mean, I _know_ from the declaration that hwnd is a window handle, but I have no clue what window it is a handle to. Without a naming schema like you are proposing I suggest that the names would have looked more like: HWND MainWindowHandle; char *InputString; HDC OutputDeviceContext; Which to me would have been far more maintainable. In a well-designed, encapsulated application the type information in the name seems really redundant, and no amount of name-massaging is going to help a poorly-defined application. To me, a tool such as you are describing isn't going to be very useful simply because it cannot control the important part of a variable name, which is the mapping between the name and the usage. With a modern compiler, the type is usually unimportant, because the compiler should catch the stupid mistakes that the visual type-checking provided by such a schema provides. Skip ----------------------------------------- life is a zero-sum game... | -----------------------------------------
Technical Details
Message-ID:
<CJt6zI.45J@metronet.com>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!darwin.sura.net!news-feed-1.peachnet.edu!concert!corpgate!news.utdallas.edu!feenix.metronet.com!skipReferences:
<RJH.94Jan17231801@lk-hp-9.hut.fi>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f97d0,49a90e79e095ed48 X-Google-Attributes: gidf97d0,public X-Google-Thread: f65d0,49a90e79e095ed48 X-Google-Attributes: gidf65d0,public X-Google-Thread: 1025b4,49a90e79e095ed48 X-Google-Attributes: gid1025b4,public X-Google-ArrivalTime: 1994-01-18 00:07:39 PST Newsgroups: gnu.misc.discuss,gnu.g++,gnu.gcc Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!darwin.sura.net!news-feed-1.peachnet.edu!concert!corpgate!news.utdallas.edu!feenix.metronet.com!skip From: skip@metronet.com (Christopher Key) Subject: Re: A New Feature for GCC. Part II (again long)(much shortened) References: <RJH.94Jan17231801@lk-hp-9.hut.fi> Sender: skip@metronet.com Organization: Texas Metronet, Internet for the Individual 214-705-2917 (info) Date: Tue, 18 Jan 1994 04:54:54 GMT Message-ID: <CJt6zI.45J@metronet.com> Distribution: gnu Lines: 45