[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: xml in Ruby or no xml it's just a question

Austin Ziegler

10/2/2003 6:18:00 PM

On Fri, 3 Oct 2003 02:36:41 +0900, paul vudmaska wrote:
> David Black:
>> That's how it works: there's a core language, and then there are
>> libraries and programs.
> ... and core languages have types - of variable complexity each
> suited for one purpose or another. I'm suggesting xml would a
> mighty fine type - the logical evolution of data -data about data.
> You can then create your own types.

Erm. Yes. And Ruby does have a single core type: an object. Sure,
there's some language syntax to help around other common types
defined in the C portion of the Ruby library (numerics, strings,
arrays, hashes), but I think you're buying into the marketing hype
about XML. Ruby *already provides* data about data. If you create
your object hierarchy for your programs correctly.

XML is best suited as a transmission data type (except its
verbosity, but that's neither here nor there). It allows for
meaningful data serialization across languages. It is not well
suited as a "native" data type -- because it's unnecessarily
verbose and doesn't really provide meaningful information to the
program. If I have:

<address>
<first></first>
<last></last>
...
</address>

I am most likely to represent that as an object in my program:

class Address
attr_accessor :first
attr_accessor :last
end

I think you're mixing up what is properly a separation of concerns
here.

-austin
--
austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.10.02
* 14.12.17