[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: parsing markup with Perl

  • From: Shlomi Fish <shlomif@shlomifish.org>
  • To: ihe.onwuka@gmail.com
  • Date: Mon, 10 Feb 2014 21:20:40 +0200

Re:  parsing markup with Perl
Hi Ihe (and all),

well, just a prescript (is that a word? I mean something like postscript)
before: it seems we agree on most stuff, and we are straying away from
discussing XML, but this is still a mostly technical discussion, so it may be
OK (not sure).

On Mon, 10 Feb 2014 14:47:36 +0000
Ihe Onwuka <ihe.onwuka@gmail.com> wrote:

> On Mon, Feb 10, 2014 at 2:22 PM, Shlomi Fish <shlomif@shlomifish.org> wrote:
> >
> > At times like that, one can really appreciate what Linus Torvalds reportedly
> > said that his main job as the kernel chief maintainer is "To say 'No'." or
> > else we get many different tools that all have everything including the
> > kitchen sink, and many of them were not designed for that.
> >
> 
> Amen.

:-). In addition, I’d like to note that Joel Spolsky had this to write about
the so-called “Architecture Astronauts” who try to solve the most general
problem possibly - http://www.joelonsoftware.com/articles/fog0000000018.html by
creating a very abstract and very generic architecture. Some of these
architectures are useful and popular, but there's often a lot of hype
and buzz surrounding them. Of course not all architectures started with that
goal and/or were more grassroots or less hyped when they started (like no one
hyped HTML and it was common by the time most people heard about it), but there
are still architectures and as such of no interest to most people including
not most developers. For all I care VLC player or the English Wikipedia could
have been written in Intercal, but I would still use them because they are
great and I can no longer imagine my life without them.

There was some criticism on a blog post I read that, on its home page, Eclipse
used to describe itself as an abstract platform instead of just an IDE for Java,
while Firefox (which is also a platform) simply described itself as a
web-browser. Show me the money!!! (i.e: Get to the point, already!).

> 
> >
> > Anyway, saying that it is used by people who are against
> > using list comprehensions does not necessarily mean it is wrong in all other
> > cases, and furthermore may be considered a "guilt by association".
> >
> 
> Indeed. Lying with dogs get you fleas.
> 

I think I understand the idiom, but I don't know what you wish to say by it
(and sorry - I have not studied
https://en.wikipedia.org/wiki/Neuro-linguistic_programming which I was told
should help with that).

> >
> > Someone once told me he didn't like lambdas/anonymous functions/closures in
> > Perl 5 (he was originally a Perl 4 programmer) and that they are hard to
> > understand and that I shouldn't use them. Shortly after Joel on Software
> > wrote this post - http://www.joelonsoftware.com/items/2006/08/01.html - most
> > competent programmers understood that closures are often a good idea and
> > most modern languages should support them natively (and the fact that in
> > Python lambdas can only have a single expressions leaves a lot to be
> > desired).
> >
> 
> So the story that I have told once before on this list when I asked my
> Scheme professor (an alumnus of yours at Technion) what a closure was
> and he said "You know what it is" (because he'd seen me code them)
> "You just don't know thats what they are called".

Heh, nice story. Anyway, I'm pretty sure the programmer in question knew what
they were and why they may be useful, and just thought they were harmful.

> 
> >
> > Furthermore, projects often find it useful to standardise on a style guide,
> > which constrains the syntax and features that one is allowed to use. Some
> > of my patches required amending due to a wrong placement of braces, or
> > because they added trailing whitespace, and I rejected patches due to
> > similar reasons. I'm not saying that completely forbidding the use of
> > Python's list comprehensions is a good idea (and using the alleged lack of
> > utility of high school math as an excuse is certainly a poor thing to do),
> > but some coding style rules are probably a good idea.[Indent]
> >
> 
> This is true. However it has an "uncanny" way of  reducing to Fortran
> 77 with objects, which is a generic way of describing the sort of code
> list comprehension abolitionist consider comprehensible.

I have not studied Fortran 77 (started studying Fortran out of general interest
from the English wikibook - https://en.wikibooks.org/wiki/Fortran but gave up
because it felt too weird. Maybe I'll fare better if I actually *need* to learn
Fortran for something.), but I think I know what you mean and can relate to it.

However, the other side of the coin is that one of the criticisms I read on the
now defunct (but still archived) Joel on Software forum was that some Perl
programmers write overly clever code, like using "||last MY_LOOP;" (last in
Perl is like "break" in C - i.e: gets out of a loop) inside an array subscript,
which can give you a lot of "WTF?" moments but will still compile. The poster
said that even if you write easy-to-understand Perl it will still be much
shorter than C. That does not entirely disqualify what you said, though, and
programming in Python is somewhat different to programming in Perl, so not
everything is applicable.

Regards,

	Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Why I Love Perl - http://shlom.in/joy-of-perl

Chuck Norris does not own a dishwasher. His dishes know better than to become
dirty.
    — http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/

Please reply to list if it's a mailing list post - http://shlom.in/reply .


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.