comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <Nick.Roberts@dial.pipex.com>
Subject: Re: renaming Interfaces.Java.Ada_To_Java_String to the + operator
Date: 1998/01/15
Date: 1998-01-15T00:00:00+00:00	[thread overview]
Message-ID: <01bd21ff$7f85e3a0$95fc82c1@xhv46.dial.pipex.com> (raw)
In-Reply-To: dewar.884801478@merv


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 <dewar@merv.cs.nyu.edu> wrote in article
<dewar.884801478@merv>...
> 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!





  reply	other threads:[~1998-01-15  0:00 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-11  0:00 renaming Interfaces.Java.Ada_To_Java_String to the + operator Terry J. Westley
1998-01-10  0:00 ` Robert Dewar
1998-01-10  0:00   ` Matthew Heaney
1998-01-13  0:00     ` Tom Moran
1998-01-13  0:00       ` Robert Dewar
1998-01-13  0:00       ` Stephen Leake
1998-01-13  0:00         ` Nick Roberts
1998-01-13  0:00       ` Stephen Leake
     [not found]       ` <En3Cxz.7HD@world.std.com>
1998-01-20  0:00         ` Robert Dewar
1998-01-21  0:00           ` Stephen Leake
1998-01-22  0:00           ` Robert Dewar
1998-01-22  0:00             ` Anonymous
     [not found]               ` <dewar.885498969@merv>
1998-01-23  0:00                 ` Geert Bosch
1998-01-23  0:00                 ` Tom Moran
1998-01-23  0:00             ` Anonymous
1998-01-24  0:00             ` Tucker Taft
1998-01-11  0:00   ` Chris Morgan
1998-01-11  0:00     ` Robert Dewar
1998-01-11  0:00       ` Chris Morgan
1998-01-11  0:00         ` Robert Dewar
1998-01-11  0:00           ` Chris Morgan
1998-01-11  0:00             ` Robert Dewar
1998-01-11  0:00 ` Nick Roberts
1998-01-11  0:00   ` Robert Dewar
1998-01-14  0:00     ` Anonymous
1998-01-14  0:00       ` Robert Dewar
1998-01-11  0:00   ` Brian Rogoff
1998-01-13  0:00     ` Terry J. Westley
1998-01-14  0:00       ` Robert Dewar
1998-01-15  0:00         ` Nick Roberts [this message]
1998-01-15  0:00           ` Robert Dewar
1998-01-16  0:00           ` Michael F Brenner
1998-01-16  0:00             ` Nick Roberts
1998-01-16  0:00               ` Robert Dewar
1998-01-17  0:00                 ` miniscences Nick Roberts
1998-01-17  0:00                   ` miniscences Robert Dewar
1998-01-19  0:00                 ` renaming Interfaces.Java.Ada_To_Java_String to the + operator Anonymous
1998-01-25  0:00                   ` Matthew Heaney
1998-01-16  0:00             ` Robert Dewar
1998-01-12  0:00 ` Tucker Taft
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox