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:
Pascal Obry <[log in to unmask]>
Reply To:
Pascal Obry <[log in to unmask]>
Date:
Sat, 30 Aug 2003 09:30:08 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (47 lines)
Jacob,

 > IIRC the style guide advices something like this:
 >
 > 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));

I really prefer :

 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));

You do not have to parse the whole line to see what operator is used between
lines.

Another example is:

  A_Variable_For_Whatever
    := A_Variable_For_Whatever
        + First_Constant
        + (Second_Constant * Some_Magic_Number)
        - Some_Kind_Of_Offset;

But this is really a matter of personal preferences!

Pascal.

--

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595

ATOM RSS1 RSS2