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=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME 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: "Nick Roberts" Subject: Re: renaming Interfaces.Java.Ada_To_Java_String to the + operator Date: 1998/01/15 Message-ID: <01bd21ff$7f85e3a0$95fc82c1@xhv46.dial.pipex.com>#1/1 X-Deja-AN: 316327040 Content-Transfer-Encoding: 7bit References: <01bd1e34$1632c2c0$24326489@Westley-PC.calspan.com> <01bd1ebc$3bb2cb20$20f382c1@xhv46.dial.pipex.com> <01bd1fc9$99302a00$24326489@Westley-PC.calspan.com> Content-Type: text/plain; charset=ISO-8859-1 Organization: UUNet UK server (post doesn't reflect views of UUNet UK) Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-01-15T00:00:00+00:00 List-Id: Robert's comment [below] is surely a valuable one in a topic which threatened to get too general. I have to say, however, I would still assert that something like File_Name_1_In_Java := To_Java_String(File_Name_1); is better than File_Name_1_In_Java := +File_Name_1; in the vast majority of cases. I hope this example is not felt to be unfair by those who disagree with me. My point is this: what is truly gained by the second version? Unary + as a string translator is not a generally idiomatic form, although I admit it could become one, and its use is far from obscure already. I still think that the first form should be encouraged in commercial and industrial practice, simply because it is more explicit. In how many cases is the fact that it is a little longer going to really matter? Even with a case such as File_Name_List := (To_Java_String(Comment_File_Name), To_Java_String(Keyword_File_Name), To_Java_String(Command_File_Name), To_Java_String(Function_File_Name), To_Java_String(Movename_File_Name), To_Java_String(Oldname_File_Name), To_Java_String(Dictionary_List_File_Name), To_Java_String(Thesaurus_List_File_Name), To_Java_String(Grammar_Rule_File_Name)); could this be considered so much less preferable to, say File_Name_List := (+Comment_File_Name, +Keyword_File_Name, +Command_File_Name, +Function_File_Name, +Movename_File_Name, +Oldname_File_Name, +Dictionary_List_File_Name, +Thesaurus_List_File_Name, +Grammar_Rule_File_Name); where, again, I hope this example is felt to be fair. I would suggest that the latter form, while a little 'cleaner', could still be confusing to a reader who didn't already know that unary + had been defined to convert strings, whereas such a reader would be likely to correctly surmise what is going on from the first form. I would assert that this advantage tells over the advantage of slightly cleaner or shorter code in almost all cases. Am I missing the point? -- Nick Roberts Croydon, UK Proprietor, ThoughtWing Software; Independent Software Development Consultant * Nick.Roberts@dial.pipex.com * Voicemail & Fax +44 181-405 1124 * *** Eats three shredded spams every morning for breakfast *** Robert Dewar wrote in article ... > I know people desparately want simple rules that somehow guarantee readability, > but the fact of the matter is that judgment is called for in most cases, and > having the skill to make the judgment correctly is one of the important > skills that programmers need to have or acquire. > > Yes, sets of official guidelines and rules can help, but they are not a > susbtitute for good judgment!