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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,967ae26df92535de X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-18 10:46:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: Ingo Marks Newsgroups: comp.lang.ada Subject: Re: New Software Forum Date: Wed, 18 Sep 2002 19:46:01 +0200 Organization: T-Online Message-ID: References: <3D8356A7.9010208@worldnet.att.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1032371096 05 26806 LT3Kb2iGSzAEEd 020918 17:44:56 X-Complaints-To: abuse@t-online.com X-Sender: 340020534592-0001@t-dialin.net User-Agent: KNode/0.6.1 Xref: archiver1.google.com comp.lang.ada:29121 Date: 2002-09-18T19:46:01+02:00 List-Id: Kevin Cline wrote: > Preben Randhol wrote in message > news:... >> On Tue, 17 Sep 2002 18:41:43 +0200, Ingo Marks wrote: >> > Ingo Marks wrote: >> > >> > or even this way :-) >> > >> > Put_Line ("Iteration" & Num & >> > " Result:" & Result & >> > " Time:" & Elapsed_Time); >> >> Well now we are borderlining the poor readability. In the previous >> version I could at least know that Elapsed_Time was a Duration here it >> can be anything. This is one of the great features of Ada that it is so >> self-documenting. > > This version is easier to read and easier to maintain. I don't need to > know the type of Elapsed_Time to understand this statement, and the > compiler already knows the type and shouldn't need to be told again. > Repeating the type here reduces readability and makes the code more > sensitive to a change in the type of Elapsed_Time. The compiler doesn't need extra specification but an unbiased reader of your source would appreciate it. For myself I always use the short form for integer (or ranges of it) only. So I would prefer Put_Line ("Iteration" & Num & " Result:" & Result & " Time:" & Duration'Image(Elapsed_Time)); If it is inevitable that the type of Elapsed_Time may change in future then it could be good idea to define a subtype: subtype My_Duration is Duration; Put_Line ("Iteration" & Num & " Result:" & Result & " Time:" & My_Duration'Image(Elapsed_Time)); If you have to change the type you just need to change one line (hopefully). Regards, Ingo