Re: Data table text I/O package?



On Tue, 21 Jun 2005 11:24:34 +0200, Georg Bauhaus wrote:

> Dmitry A. Kazakov wrote:
>
>> No, you just have to use different delimiters between and within the
>> fields.
>
> "You just have to... ". No, gosh, the space was _mistyped_,
> it wasn't intended. This goes for any typo irrespective of what
> delimiter you choose. Now any reasonable CSV has far less offerings for
> error correction facilities for typos like these than any reasonable
> XML. By definition. (And, yes, I know you can construct syntax errors
> in XML, too, if you think this is an argument ...)
>
> Is it the typical Ada programmer's attitude to promote self-documenting
> bracketing constructs only for program text, but never for data text?

See below. It is a table. It has bracketing: rows and columns. This form
existed for centuries before XML. Who would print tables of logarithms in
XML?

>> This is why in Ada parameters of a procedure call are separated by
>> commas rather than spaces.
>>
>> Though is it about what syntax would be the best? Or is it about how to
>> parse something in a defined syntax?
>
> HAving a "best syntax" requires a measure for syntax quality.
> If you measure what a syntax can do in a heterogenous project
> by applying your personal aesthetic preferences,
> or your reading habits, or your programming skills, I have nothing to say.
>
> If you care about robust data interchange in a "sloppy
> field", you employ standard tools to help you get the correct
> data.

That is a different problem for which I would use a well-defined binary
format instead of fancy 3.15. What is the *accuracy* of this value, huh?

>> Now consider a space between / and >:
>>
>> <Distance km='3.15'/ >
>>
>> XML adds here nothing, but a huge readability loss.
>
> Oh well... You mean
>
> Distance'(km => 3.15)
>
> can be read well, whereas
>
> Distance'( km => 3.15 )
>
> is a huger readability loss? Come on.

Distance isn't a record. At least it should not be visible as such. Neither
distance is a type. The closest Ada's equivalent would be

Distance => 3.15 km,

or

Distance := 3.15 km;

But, lack of readability is not in the ugly </> brackets. Tabulated data
are readable because they are tabulated. That is: the names, the types and
units are *factored* out to the table header, which allows the reader to
concentrate on the *values*. Thus a table looks as:

Distance [km] Temperature [°C] ...
3.15 29.0 ...
2.10 14.4 ...

This is readable.

To make difference more visible, consider bitmaps stored XML format. Would
you be able to recognize a person's face in it?

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.



Relevant Pages

  • Re: why this assembly language is not good?
    ... When did this thread become a debate about RosAsm's readability? ... So you would force someone to have a shining example of perfect syntax, ... RosAsm, of course. ... RosAsm is no more readable that this new language. ...
    (alt.lang.asm)
  • Re: What is this code doing?
    ... Using the same syntax for most statements helps make the ... add, ebx); ... Instruction composition readability is another reason ... Jim Neil's Terse language). ...
    (alt.lang.asm)
  • Re: The Advantage of Macros
    ... HLLisms improve readability. ... Source in a kind of Hyper-Text material, where the programmer ... but this has no relationship with the language syntax. ... This is not possible in assembler without ...
    (alt.lang.asm)
  • Re: Be afraid of XML
    ... whole of the JVM into XML). ... anything you do with s-expr is just XML with minor syntactic differences ... XML is a general tree syntax suitable for world-wide use. ... same syntax family as an enormously popular document markup language. ...
    (comp.lang.lisp)
  • Re: why this assembly language is not good?
    ... When did this thread become a debate about RosAsm's readability? ... When Rene started making ridiculous comments that apply equally well to ... trying to shift the focus from the OP's language to RosAsm. ... syntactical hint that differentiates them from normal label syntax. ...
    (alt.lang.asm)