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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d95b511473b3a931 X-Google-Attributes: gid103376,public From: Louis Tribble Subject: Re: Language Choice and Coding style Date: 1996/06/21 Message-ID: <31CAD534.41C6@msmail4.hac.com>#1/1 X-Deja-AN: 161476963 references: content-type: text/plain; charset=us-ascii organization: Hughes Aircraft Company mime-version: 1.0 reply-to: letribble@msmail4.hac.com newsgroups: comp.lang.ada x-mailer: Mozilla 2.02 (Macintosh; I; PPC) Date: 1996-06-21T00:00:00+00:00 List-Id: Nasser Abbasi wrote: > I'd like to know why do C and C++ programmer > > pchWriteInThisStargeAndHardToReadWayLikeThis while the Ada > programmers > > Write_In_Clear_And_Nice_Way_Like_This ?? Two thoughts, for what they're worth: (1) Typing skills may be a factor for some people. I don't touch type the top row as reliably as the other rows, so underscores slow me down (nevertheless, I _do_ use them). (2) In languages like C, naming conventions are often used to simulate multiple visible name spaces (excuse the C, but the example fails in Ada): typedef struct Sequence_type Sequence; extern void sequence_create (... extern void sequence_insert (... extern void sequence_remove (... Since there is no scope separator like the . in Ada or the :: in C++, the underscore gets pressed into service. If it is also used as the word separator, an informal ambiguity is introduced: typedef struct Sequence_Partial_type Sequence_Partial; extern void sequence_partial_create (... extern void sequence_partial_insert (... extern void sequence_partial_remove (... . . Sequence_Partial* dependents; . . while (sequence_partial_length (dependents)) { node = sequence_partial_remove (dependents); node_destroy (node); } Avoiding the underscore as a word separator can help a (human) reader automatically discard the prefix and focus on the "meaningful" part of the name when the name appears in a context where the prefix is obvious: typedef struct SequencePartial_type SequencePartial; extern void sequencepartial_create (... extern void sequencepartial_insert (... extern void sequencepartial_remove (... . . SequencePartial* dependents; . . while (sequencepartial_length (dependents)) { node = sequencepartial_remove (dependents); node_destroy (node); } Louis Tribble letribble@msmail4.hac.com (until the mail scheme changes yet again...)