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,9c86eb13dd395066 X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: CRC in Ada? Date: 1997/03/06 Message-ID: <1997Mar6.114441.1@eisner>#1/1 X-Deja-AN: 223562417 X-Nntp-Posting-Host: eisner.decus.org References: <1997Mar2.220652@nova.wright.edu> <331d3cf9.1190126@news.logica.co.uk> <1997Mar5.083233.1@eisner> <1997Mar5.131846.1@eisner> <5fmo1k$adm@mulga.cs.mu.OZ.AU> X-Nntp-Posting-User: KILGALLEN X-Trace: 857666690/1425 Organization: LJK Software Newsgroups: comp.lang.ada Date: 1997-03-06T00:00:00+00:00 List-Id: In article <5fmo1k$adm@mulga.cs.mu.OZ.AU>, fjh@mundook.cs.mu.OZ.AU (Fergus Henderson) writes: > kilgallen@eisner.decus.org (Larry Kilgallen) writes: > >>bobduff@world.std.com (Robert A Duff) writes: >>> I'm not sure why reading a file character-by-character is "C-like". >>> It seems like the natural way to write lots of programs, in any >>> language. The underlying language and OS should ensure that it can be >>> done efficiently (by making the "give-me-a-char" routine read from a >>> buffer whenever appropriate). >> >>In my experience it is generally C programmers who make this mistake. > > Why is it a mistake? > > If the implementation implements it efficiently, as it should, > I don't see any reason to regard using such a mechanism as a mistake. If a programmer _assumes_ that such a construct will be efficient, when in fact it is _not_ efficient within a particular environment, it is a mistake from a performance perspective. I have run into programmers making this mistake over and over again. In recent years their immediate response has been "Gee, it runs fast on Unix", but in prior years their response was "Gee, it runs fast on MVS". Obviously it is only the recent history where the C language is involved, but the current generation seems much more surprised than their MVS-centric predecessors. An analogy would be developers who find their MS-DOS game cannot write directly to the screen under Windows NT. That is a bit rougher, as one has to start from scratch explaining the difference between an operating system and a run-time library :-) Larry Kilgallen