Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Interplatform (interprocess, interlanguage) communication Date: Sat, 11 Feb 2012 12:06:17 -0800 (PST) Organization: http://groups.google.com Lines: 65 Message-ID: <9002427.542.1328990777214.JavaMail.geo-discussion-forums@pbcpd10> References: <4f332c6d$0$288$14726298@news.sunsite.dk> <4f345bcb$0$291$14726298@news.sunsite.dk> <4f36c5ec$0$294$14726298@news.sunsite.dk> NNTP-Posting-Host: 173.164.137.214 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1328991250 14815 127.0.0.1 (11 Feb 2012 20:14:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 11 Feb 2012 20:14:10 +0000 (UTC) In-Reply-To: <4f36c5ec$0$294$14726298@news.sunsite.dk> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.164.137.214; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true X-Received-Bytes: 4501 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:11943 Arne Vajh=F8j wrote: > BGB wrote: >> it all still basically amounts to: >> read a line; >> split the string; >> do something with the split strings. >=20 > ???? >=20 > But that not how you work with XML. >=20 > You load it into a DOM and use XPath to pull > out what you need. Or you scan it with SAX or StAX and deal with XML-parsing events, or=20 you run the schema through JAXB and let it generate all the parsing=20 classes for you, or you use one of the many other standard libraries=20 in Java (or if not Java, in your favorite platform) that are available=20 for free. >> personally, I like recursive hand-written descent parsing, as it is >> fairly straightforwards and doesn't depend on external tools. The number-theorist can never pass a calculus exam because he's only=20 just reinvented calculus by the end of the hour. > You need to depend on some tools. >=20 > If you use Java then you depend on standard Java library. >=20 > Standard Java library contains several XML parsers. >=20 > No extra dependency for Java. The thing is, BGB, that your macho programming style is impractical=20 and not very justifiable. It's wonderful that you have reinvented the=20 programming world and all, and are so clever and knowledgeable, but=20 most of us programmers work in a workaday pragmatic environment where=20 best practices really do save the day. That means use the standards,=20 and the abundant tools that support them, and give up our egos that=20 make us feel that superman heroics are the only available path. I=20 sincerely hope that readers of this thread can understand the manifest=20 shortcomings of the approaches that you've espoused here. (And that=20 they can disentangle themselves from your fetching but irrelevant=20 analogies.) To get the job done, to get it done right, and to minimize both= error and development time, use the standards. XML is just fine for just about every purpose to which it's put.=20 That's why it's popular now. People who cavil about "bandwidth" and=20 "10 Hz network messages" are tossing us red-herring sashimi. You=20 aren't going to get 10+ Hz message exchanges over the WAN. For=20 realistic message rates, XML suits beautifully. I speak from=20 experience with many, many projects that used every conceivable=20 message format from binary to CSV to custom to XML to protocol buffers=20 to JSON, and XML has distinct advantages. Its purported disadvantages=20 of bulk and bandwidth turn out to be non-issues in practice. Really.=20 That's real. So, dear future readers, stick with what's known to be true by people=20 who actually do this work, not by some armchair theorist in a darkened=20 room who thinks that he has to do everything by hand and wants the=20 rest of us to follow his suboptimal strategy. --=20 Lew