comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Howto read line from a stream
Date: Tue, 2 Jun 2009 12:24:03 +0200
Date: 2009-06-02T12:24:03+02:00	[thread overview]
Message-ID: <5luxwer5y24d$.1jqectkfcf2fj.dlg@40tude.net> (raw)
In-Reply-To: 4a24f2ab$0$31340$9b4e6d93@newsspool4.arcor-online.net

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



  reply	other threads:[~2009-06-02 10:24 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-31 10:41 Howto read line from a stream Tomek Walkuski
2009-05-31 11:29 ` Tomek Wałkuski
2009-05-31 12:02   ` Dmitry A. Kazakov
2009-05-31 12:56     ` Tomek Wałkuski
2009-05-31 14:30       ` Tomek Wałkuski
2009-05-31 15:13       ` Dmitry A. Kazakov
2009-06-01 23:30         ` Randy Brukardt
2009-06-02  7:30           ` Dmitry A. Kazakov
2009-06-02  9:36             ` Georg Bauhaus
2009-06-02 10:24               ` Dmitry A. Kazakov [this message]
2009-06-02 21:15             ` Randy Brukardt
2009-06-01  6:34     ` Pascal Obry
2009-06-01  0:05   ` Jeffrey R. Carter
2009-06-03 15:49     ` Tomek Wałkuski
2009-06-03 18:04       ` Jeffrey R. Carter
2009-06-03 21:41         ` Maciej Sobczak
2009-06-04  8:56           ` Jean-Pierre Rosen
2009-06-04  9:05             ` Ludovic Brenta
2009-06-04 13:05             ` Maciej Sobczak
2009-06-04 14:16               ` Jean-Pierre Rosen
2009-06-04 19:48                 ` Ludovic Brenta
2009-06-04 14:24               ` Dmitry A. Kazakov
2009-06-03 19:07       ` sjw
2009-06-03 19:26         ` Dmitry A. Kazakov
2009-06-03 19:43           ` Georg Bauhaus
2009-06-03 20:11             ` Dmitry A. Kazakov
2009-06-03 22:09               ` Georg Bauhaus
2009-06-04  8:19                 ` Dmitry A. Kazakov
2009-06-04  9:41                   ` Georg Bauhaus
2009-06-04 10:23                     ` Dmitry A. Kazakov
2009-06-04 12:14                       ` Georg Bauhaus
2009-06-04 14:54                         ` Dmitry A. Kazakov
2009-06-04 16:33                           ` Georg Bauhaus
2009-06-05  9:57                             ` Dmitry A. Kazakov
2009-06-04 14:16         ` andrew
2009-06-01 19:12   ` björn lundin
2009-05-31 11:34 ` Dmitry A. Kazakov
2009-05-31 15:38   ` sjw
2009-05-31 16:07     ` Dmitry A. Kazakov
2009-05-31 20:39       ` Niklas Holsti
2009-05-31 22:00       ` sjw
2009-06-01  8:35         ` Dmitry A. Kazakov
2009-06-01 23:34     ` Randy Brukardt
2009-06-02  2:27 ` anon
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox