TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Rick Duley <[log in to unmask]>
Reply To:
Rick Duley <[log in to unmask]>
Date:
Thu, 28 Aug 2003 13:54:58 +0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (49 lines)
Hi all

Is there any move afoot to review the Ada Style Book?

I have come to the conclusion that (when writing code in verbose style as I
encourage students to do) we need to standardise indenting to avoid
word-wrap when printing list files.  Take this for example:

Ada.Text_Io.Put_Line(File => Log_File, Item => Event &
Ada.Calendar.Day_Duration'Image(The_Seconds) & " - " &
Ada.Calendar.Day_Number'Image(The_Day) &
Ada.Calendar.Month_Number'Image(The_Month) &
Ada.Calendar.Year_Number'Image(The_Year));

As you can see, it gets a bit unwieldy :)  Much better, in my opinion, to
realign it thus:

Ada.Text_Io.Put_Line
    (File => Log_File,
     Item => Event
             & Ada.Calendar.Day_Duration'Image(The_Seconds)
             & " - "
             & Ada.Calendar.Day_Number'Image(The_Day)
             & Ada.Calendar.Month_Number'Image(The_Month)
             & Ada.Calendar.Year_Number'Image(The_Year));

which gives you a fair chance of getting it all on a page without
word-wrap.  I can't see that this sort of thing is covered by the standard
and it would be nice if the people who devise the "reformat" routines for
IDEs had something standard to work to.

Comments, anyone?


--------------------------------------------
Rick Duley
School of Engineering Science
Murdoch University, Perth, Western Australia
aussie :    0409 106 049
o'seas : +61 409 106 049
                                      .-_|\
                                     /     \
                               perth *_.-._/
                                          v
           "It is not enough to do your best:
                    you must know what to do,
                      and THEN do your best."
                           (W Edwards Deming)

ATOM RSS1 RSS2