From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10ad19,23963231b5359f74 X-Google-Attributes: gid10ad19,public X-Google-Thread: 1073c2,23963231b5359f74 X-Google-Attributes: gid1073c2,public X-Google-Thread: 107a89,23963231b5359f74 X-Google-Attributes: gid107a89,public X-Google-Thread: 103376,23963231b5359f74 X-Google-Attributes: gid103376,public X-Google-Thread: 101deb,23963231b5359f74 X-Google-Attributes: gid101deb,public X-Google-Thread: 11440e,23963231b5359f74 X-Google-Attributes: gid11440e,public X-Google-Thread: 10a146,23963231b5359f74 X-Google-Attributes: gid10a146,public X-Google-ArrivalTime: 2001-06-05 17:12:44 PST Path: archiver1.google.com!newsfeed.google.com!sn-xit-02!sn-post-01!supernews.com!news.supernews.com!not-for-mail From: Pete Thompson Newsgroups: comp.lang.ruby,comp.lang.ada,comp.lang.awk,comp.lang.clarion,comp.lang.java.programmer,comp.lang.pl1,comp.lang.vrml Subject: Re: Long names are doom ? Date: Tue, 05 Jun 2001 17:13:18 -0700 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <3B0DD011.88FCD00E@acm.org> <83WP6.3874$yc6.728572@news.xtra.co.nz> <3B1411D0.3AAF42E7@ftw.rsc.raytheon.com> <9f2nks$ibd$0@dosa.alt.net> <3B177EF7.2A2470F4@facilnet.es> <9f8b7b$h0e$1@nh.pace.co.uk> <9f8r0i$lu3$1@nh.pace.co.uk> X-Newsreader: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ruby:10411 comp.lang.ada:8204 comp.lang.awk:2801 comp.lang.clarion:21174 comp.lang.java.programmer:73898 comp.lang.pl1:793 comp.lang.vrml:3530 Date: 2001-06-05T17:13:18-07:00 List-Id: On 05 Jun 2001 18:22:30 -0400, Chris Uzdavinis wrote: >Pete Thompson writes: > >> On Sat, 2 Jun 2001 17:29:04 +1200, "AG" wrote: > >> In most C/C++ code, I very rarely ever see anyone using an >> underscore in a variable name. When they do, they usually come from >> a Pascal background. > >Sorry, I must disagree with your generalization. Using underscores >has strong C++ roots -- their use is common in the C++ standard >itself. > >Most names in the C++ Standard library uses underscores as separators >when one is needed (random_shuffle, const_iterator, next_permutation, >type_name, etc.) Even keywords in C++ use underscores: dynamic_cast, >const_cast, static_cast, reinterpret_cast, wchar_t. > >The GNU coding standard uses underscores in identifiers. (For that >matter, The Linux kernel itself is coded using underscore notation.) >Plus, every platform-specific extension by any C++ compiler vendor is >required to have leading underscores (__declspec, __finally, __int64, >etc), and all implementations of the standard library internally use >leading underscores, since the standard explicitly reserves such names >(in global scope) for their use. > >It's common among Unix programmers to use trailing underscores on >variable names to indicate class membership. In windows, it's common >to prefix member variables with m_ to indicate class membership. Sure, underscores are used quite heavily in header files, macros, and in argument parameters. However, I'm referring to general variable names and function names, where the underscore is used as a separator between words within a variable/function name. Underscores were used heavily in the past, I'll give you that, but I suspect it was mostly because programmers had migrated to C/C++ from other languages where the underscore was quite prominent. In today's times, I rarely see people using it in their variable and function names, and even then, only to indicate a prefix/suffix like your class member example. Not as a separator of words within a variable name. I suspect if the C/C++ language was to be re-created from scratch today, the underscore would be more omitted. As it is now, we have quite an inconsistency within the language: typedef, sizeof, dynamic_cast, size_t, memset, iostream classes and methods, etc.