Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!217.73.144.45.MISMATCH!feeder2.ecngs.de!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 18 Dec 2012 07:42:59 -0600 From: "Chris Uppal" Newsgroups: comp.lang.java.programmer References: <7f36342c-2331-4484-874b-4a0f8953f160@googlegroups.com> <50c61150$0$293$14726298@news.sunsite.dk> <50c6413a$0$293$14726298@news.sunsite.dk> <50c6598d$0$290$14726298@news.sunsite.dk> <50c69625$0$293$14726298@news.sunsite.dk> <50cbeec3$0$291$14726298@news.sunsite.dk> Subject: Re: multi-line Strings Date: Tue, 18 Dec 2012 13:38:46 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Message-ID: Lines: 51 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-tFf03P0NmktGGDUAOVh+C1Wvs46D1iOgOX2iWicMb/k6u7YgvIQCvvsfpenpcgyez9IYWA+MmPYkw4d!InuUiq3MQ8ekPM9JW898RdPL1pUKbs0H8vEJoCRfbMsMy4HhQebrMz7zcNrn7+odPtWku6Wghtkw X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 3774 Xref: csiph.com comp.lang.java.programmer:20441 Arved Sandstrom wrote: > No offense, Chris, None taken > but personally I find your syntax about as hard to > follow as the JPA Criteria API. Which latter I refuse to use, even > though I seriously dislike silent JPA provider failures when a JPQL > string is wrong. I think the point that I was trying to get across is not about a "better syntax" for regular expressions, but about moving that kind of logic out of syntax altogether and into programmer-domian objects and code. So -- for me -- I don't /care/ whether it is less readable than the traditional ex/awk/sed-style regexp syntax. Naturally, I'd prefer the code to be reasonably readable, and I'll certaily concede that the example code I came up with is none too expressive. But I'm willing to put up with that given the limitations of Java. (Though maybe the sort of approach to designing DSLs in terms of "plain Java" shown in jMock, in particular the paper: Evolving an Embedded Domain-Specific Language in Java Steve Freeman, Nat Pryce http://jmock.org/articles.html could be adapted to improve the feel of the objects-only approach that I'm advocating. Hmm...) > I think verbose is *bad*. Anything that adds to it is bad. My opinion, > others may certainly (vociferously) disagree. OO can already suffer from > fragmentation, where logic that solves an immediate problem is found in > many different spots; that problem is exacerbated when any given chunk > of code is appreciably larger than it needs to be because of extra > verbosity. Java is already bad enough in this regard - let's not make it > worse. Largely agreed. (Actually agreed entirely with the exception of the "fragmentation" thing.) > Regular expressions are *not* Java, and IMHO they are about as readable My contrasting view is that regular language grammars and parsers can be expressed directly in object language, which gives all sorts of advantages. So they /ought/ to be Java (but in the current state of affairs) are not. Oh well... -- chirs