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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3d6ef988ec3a5ef7 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: renaming Interfaces.Java.Ada_To_Java_String to the + operator Date: 1998/01/11 Message-ID: #1/1 X-Deja-AN: 315001525 References: <01bd1e34$1632c2c0$24326489@Westley-PC.calspan.com> <01bd1ebc$3bb2cb20$20f382c1@xhv46.dial.pipex.com> X-Complaints-To: usenet@news.nyu.edu X-Trace: news.nyu.edu 884545511 22583 (None) 128.122.140.58 Organization: New York University Newsgroups: comp.lang.ada Date: 1998-01-11T00:00:00+00:00 List-Id: Nick says <> Everyone agrees with this general principle, but the fact of the matter is that identifiers with associated parentheses can obfuscate code, and at some level most people agree. Witness for example, the big fuss about adding "use type", which is basically so that even people who are use- allergic can still use nice infix notation for operators, as in x * b + c instead of Pkg1."+" (Pkg1."*" (x, b), c) hands up anyone who thinks the second line will prove clearer to the maintenance programmers :-) In fact many languages are happy to have *ZERO* syntactic overhead for conversions (e.g. C++). I think the use of unary "+" for this purpose is a quite reasonable compromise. Note that of course it should only be used when conceptually there is very little abstract difference between the input and output, as for example the case of a character treated as a one character string, or an integer treated as a real. If we are talking about two string types, then this is definitely a case where there is little or no abstract difference, and I would far rather see: User_Name := +"Robert Dewar"; than User_Name := A2Jstr ("Robert Dewar"); the extra characters in the latter line add no enlightenment to the reader of significance. (and personally I find this habit of making local abbreviations very annoying, since all too often these abbreviations are totally uncontrolled, and different programmers choose different abbreviations in different places, UGH! For my taste, if an abbreviation is clear, then use it universally, and name this package by its abbreviated name in the first place. I understand and appreciate the position that abbreviations should be avoided. I understand and appreciate the position (and it is my own position) that abbreviations are often quite reasonable. I find the use of global lengthy names and local abbreviations a horrible compromise that gets the worst of both worlds. Yes, I know it is a very standard convention, and indeed no rule is absolute for me, so occaisionally it makes sense (have a look at the GNAT runtime specs to get a feel for when I feel it is OK), but I find many programs very much overuse this technique.