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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cec65b0a3ccd802d X-Google-Attributes: gid103376,public From: "Samuel T. Harris" Subject: Re: Big-endian vs little-endian Date: 1999/02/06 Message-ID: <36BD02DB.737849EE@hso.link.com>#1/1 X-Deja-AN: 441544847 Content-Transfer-Encoding: 7bit References: <36B155D2.2E8573BB@wvu.edu> <7982p9$nll$3@plug.news.pipex.net> <36B89411.7A6CFA14@lmco.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Raytheon Training Inc. Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-02-06T00:00:00+00:00 List-Id: Mark A Biggar wrote: > > Nick Roberts wrote: > > > (b) use Text_IO instead of Sequential_IO, and input and output the data in > > the form of text. > > > > The advantage of (b) is that text is the most universal data format: non-Ada > > programs will (almost always) be able to use the data (if that's what you > > might ever require). The disadvantage is that the text uses up more storage > > than its equivalent binary form. How much data do you have? > > umm.. How many times have you actually coded this up both ways and compared. > Almost every time I have tried this the text version of the data was smaller > then the binary version, especially if you have variable sized data. The > only cases where the text was bigger envolved data that consisted of large > amounts of high percession floats and even then the text was only about twice > as big. Even then, usually the advantages of portablility and human readablity > of the text format outweigh the small space savings of binary data formats. > > -- > Mark Biggar > mark.a.biggar@lmco.com As Technical Lead on a Air Force major command and control system, our initial implementation used textual representations for all the messaging between the distributed workstations and the central server. This got us a working product much faster than dealing with binary representations since the workstation and the central server hardware were so contrary to each other. This also provided easy network debugging with a simple sniffer/snopper (which was also a security concern). Since then, I have always advocated producing width, image, and value functions for all important data types. In fact, I have generics which produce these functions for arrays (trivial) and records (almost trivial) so the overhead for developing these functions is insignificant. An they do come in handy when a little text_io based debugging instrumentation is needed. A simple put_line(image(whatever)); is always available. -- Samuel T. Harris, Principal Engineer Raytheon, Scientific and Technical Systems "If you can make it, We can fake it!"