OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] parsing markup with Perl

Hi Ihe,

On Mon, 10 Feb 2014 13:24:37 +0000
Ihe Onwuka <ihe.onwuka@gmail.com> wrote:

> On Mon, Feb 10, 2014 at 12:48 PM, Shlomi Fish <shlomif@shlomifish.org> wrote:
> >>
> >> For example at what point does the amount of math you are doing mean
> >> you should be using R/Matlab/Mathematica or Octave. Perhaps if you are
> >> a Python Developer and/or know/believe in numpy/scipy the answer may
> >> well be never.
> >
> > Hmmmm... not sure I fully understand your point. I was told some hard-core
> > Matlab users (researchers with Ph.D./etc.) etc. use the interactive Matlab
> > REPL to manage their files because they are so used to that and are
> > familiar with it (and they didn't install or bother learning a decent
> > shell/scripting language for Windows).
> >
> The use case you cite is the reverse possibly even more annoying
> scenario  - morphing a DSL into a general purpose language.
> This is where you get statistical programmers advocating that
> everything should be done in R and making everybody pay the price of
> using what is a very irregular language whilst deriving none (through
> lack of need) of the domain specific benefits.

Yes, it can be sad. Someone who studied bio-informatics at the time and
who had to take a course doing Perl, came on #perl on Freenode the other day and
said that "Perl got nothing on ${Name of an R-based bio-info package}" to which
someone replied something like "If that's the case, why didn't I hear of it,
but I use Perl almost every day.". I didn't hear of it either and I no longer
recall what it is. I can think of many other tools that accumulated a lot of
general purpose features along the way (zsh supports FTP and has a built-in text
editor, GNU bash has support for sockets (and I don't mean using netcat), GNU
awk supports sockets too from what I recall and has many other features, and
GNU make 4.0 has embedded GNU guile, which is the GNU implementation of Scheme,
with a large standard library, Apache ant has become a Turing-complete language
written using XML syntax ).

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.

> >>
> >> > Moreover, sometimes writing "ugly"/complicated/inelegant code with some
> >> > so-called anti-patterns can go a long way in making sure your code is
> >> > kept simple (see https://en.wikipedia.org/wiki/KISS_principle ). This is
> >> > instead of using an abstraction that tries to produce the most elegant
> >> > code any time, and ends up being hard to learn, use and read (there's
> >> > some previous discussion on it in this thread of Sayeret Lambda (an
> >> > Israeli group of programming languages' enthusiasts)
> >> >
> >>
> >> People who code in Python but can't grok List Comprehensions use the
> >> exact same argument.
> >
> > It doesn't mean it's not a good argument.
> It depends whether the complainer groks them or not. I used to be (and
> still am) very critical of automated test tools but I had a
> certification in the major test tool on the market at the time.

Well, I didn't meant that the argument against Python list comprehensions was
a good argument, just that the general argument I presented may be. Sorry if
I wasn't clear enough. 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".

> A list comprehension is nothing more than codified set builder
> notation which should be familiar from high school mathematics. But
> there are those programming who believe that high school mathematics
> has  no utility beyond high school and they make these complaints
> layered with a usually baseless efficiency argument - et voila - list
> comprehensions are outlawed and their status as programmers on the
> team is assured.

I found both high school maths and the more advanced maths I learned (e.g:
linear algebra) of utility often and they are often essential for proper
understanding of what's going on in programming in general and programming
languages’s terminology in particular. I sometimes use list comprehensions in
Python (due to a lack of a more convenient way to write them), and don't find
the more simple cases hard to understand too much, but heard criticisms that
list comprehensions in Python were poorly executed, and don't scale well with
complexity, and it seemed to make some sense.

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). 

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]


	Shlomi Fish   

[Indent] - I had my share of frustration from people who pastebin-ed their code
(hopefully complete, but too often partial) with wrong, non-existent, or
inconsistent indentation, which I found hard to read and follow.

Shlomi Fish       http://www.shlomifish.org/
What Makes Software Apps High Quality -  http://shlom.in/sw-quality

Vizzini: He didn’t fall?! Inconceivable!
Inigo Montoya: You keep using that word. I do not think it means what you
think it means.
    — http://en.wikiquote.org/wiki/The_Princess_Bride_%28film%29

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]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS