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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Howto read line from a stream Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <83317a97-dae5-4c84-a1ac-88a87833cf3f@q14g2000vbn.googlegroups.com> <1a90e055-44a3-4d00-b4cd-64798c731a55@e24g2000vbe.googlegroups.com> <16949835-6528-4a7a-a653-fd466b37bb45@s21g2000vbb.googlegroups.com> <18nn8atp3gdq1$.6g5cqv5h6u1c.dlg@40tude.net> <1dlvlys7r0tyh$.zyytlf2vt5zm.dlg@40tude.net> <4a24f2ab$0$31340$9b4e6d93@newsspool4.arcor-online.net> Date: Tue, 2 Jun 2009 12:24:03 +0200 Message-ID: <5luxwer5y24d$.1jqectkfcf2fj.dlg@40tude.net> NNTP-Posting-Date: 02 Jun 2009 12:24:03 CEST NNTP-Posting-Host: 331e772e.newsspool3.arcor-online.net X-Trace: DXC=lCSR=3NNeAgPKPPVf;4hUjMcF=Q^Z^V3h4Fo<]lROoRa^YC2XCjHcbiN8@>nj\>j@iDNcfSJ;bb[eFCTGGVUmh?dLK[5LiR>kgbC_aGfE_;EVj X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:6175 Date: 2009-06-02T12:24:03+02:00 List-Id: On Tue, 02 Jun 2009 11:36:43 +0200, Georg Bauhaus wrote: > Dmitry A. Kazakov schrieb: > >> P.P.S. There are lots of text-oriented protocols used in automotive. The >> device vendors just do not care to handle LFs and CRs as specified (if >> specified! (:-)). You buy a $10**5+ device and have to communicate with it. >> Guess which side has to be fixed? > > The trouble is that '\n' in C source does not necessarily > mean '\n' in the data, same for New_Line. > How early in a programmer's life does she learn to assume > that '\n' means '\n', 'A' means 65 and CHAR_BIT is 8 ? > The earlier this damage is done, the more difficult it > is to mend. > > I understand they still use ASCII tables at universities > when they explain character data. They do not explain the > concept of a data type with possible representations of > values, as should be. Let alone representations > of ends of lines. This bit of teaching, eternalized as > a tradition, undermines the fundamental (and early) > understanding of types. Right. It is utmost damaging. Students simply do not understand the difference between value and a machine representation of. I have frequent brain-dead discussions about "binary strings", "adding color pixels" (as integers of course) and similar rubbish. The problem is that C++ language family when taught as the first language inflicts a persistent damaging effect on young programmers, because it does not promote the notion of abstract data type. On the contrary it makes them believe in existence of some magic chars and ints (existing in the real world), and at the same time in some "classes" which are totally different (non-existent, composed of ints, additive because, composed of ints, etc). (Even some Ada programmers believe that tagged types are somewhat less or more types than others.) > So having protocols depend on an understanding of line > termination is at odds with common knowledge; when > common knowledge is used to implement protocols, some > effects become predictable consequences. I would rather say common ignorance than knowledge. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de