Python vs. PHP (& Java?)

Alex Martelli aleaxit at yahoo.com
Thu Dec 28 10:50:00 EST 2000


"Kemp Randy-W18971" <Randy.L.Kemp at motorola.com> writes:


> Can we nip language comparisons in the bud?

Maybe with Guido's time machine -- see if you can convince
him to travel to around 1954, when that 'bud' started
blooming.  If you're limited to operating almost half a
century later, well, that's a bit too late then -- the 'bud'
is a flowering, luscious tropical forest by now.


> In reality, if someone claims one language is better then
> another, I would ask to see the studies to back the claim.

And if somebody (as I just recently did on this group) claims
Whitman's poetry is far superior to Thoreau's, and that the
latter was mainly an essayist rather than a versifier, do you
need 'the studies' for this, too -- in other words, isn't this
just your favourite euphemism for "shut up!"...?-)

I _opine_, as a practitioner and critical thinker about poetry,
that "Great God, I ask for no meaner pelf//Than that I may not
disappoint myself" looks to me like a great thought struggling
to get out of miserably doggerelly verses; while "Has any one
supposed it lucky to be born?//I hasten to inform him or her it
is just as lucky to die, and I know it", while, no doubt,
stylistically an acquired-taste, is still a pretty good couplet
(I'll take ""If thought is life//And strength & breath,//And the
want//Of thought is death,//Then am I//A happy fly,//If I live//
Or if I die." over either, but then, my Blakeian bias is well
known).

I harbor similarly-strong opinions on the aesthetics of various
programming languages (and idiomatic uses thereof), as I do about
various poets' productions.

In each case, there are some _facts_ that can be pointed out,
besides the mass of _opinion_.  If somebody appears to believe
that "Oh Captain, My Captain" is by Thoreau, one can legitimately
point out that a more widespread belief is that Whitman authored
it.  If somebody states that Python can, or cannot, "be a good
replacement for Perl", indicating my own personal experiences
regarding using it for _exactly_ such replacement purposes seems
to be perfectly appropriate.


> programming problems.  While I do have my own biases (Java and Python), I
recognize
> and salute the benefits of Perl, PHP, JavaScript, etc.  Suppose we take
the arguments

But _I_ don't, except for the possible existence of very specific
pragmatic constraints -- "I *have* to do this in JavaScript because
it *must* run within browsers whose only installed-language will
be that one", for example.  I wouldn't call it a "benefit", but I
can see another might frame it this way -- if language A can meet
an unavoidable pragmatic constraint on my deployment, and languages
B, C and D can't, then A's pragmatics can be seen as "a benefit".

To me, these are, rather, situations where *I _don't_ really have a
choice*, and thus situations in which speaking of how to choose might
only be of interest to Thomas Hobson's customers; I wouldn't say
"the benefit of this old hag of a horse is that it is the only
one that Master Hobson will rent to me now, therefore I will choose
it", but rather that I have to either take it, or do without.

> for computer languages and extended them to human languages.

Sure, why not.

> 1.  Could we argue that English is a better language to use around
> the world then French or Spanish?

This is a crucial issue for people whose mother-tongues are
others than these, and who therefore must choose one or the
other to study as a foreign language in schools (some schools
offer more than one foreign language, but often there is a
"main" one, to which more course-time is allotted, so, a
choice must still be made).

So, *of course* we could (and do!) debate this issue -- here
in Italy, for example.  Spanish, particularly, and French to
a lesser extent, are widely considered to be easier to acquire
as foreign languages to an Italian mother-tongue speaker,
because of close-similarities; while German, and particularly
English, are just as widely considered more difficult.  These
widespread opinions can be well-founded or not, and the debate
is heated, because of the enormous practical importance that
attaches to such choices; what foreign languages you know, and
how good is your command of them, can make a crucial difference
to your career prospects.

Besides difficulty of mastery (obviously dependent, in this
case, on one's mother-tongue), there is, for natural languages
just as for programming ones, the issue of pragmatics -- indeed,
this issue may be even more crucial for _natural_ languages,
as the "choice of deployment strategies" is more likely to be
highly restricted.  E.g., if my only foreign language was
English, and I wished to consider emigration, my choices would
be Britain, Canada, the US, New Zealand, Australia (perhaps
Scandinavia, the Netherlands, India, or Hong Kong, if I was
willing to move to a land where English is not natively spoken
but still widespread among the educated classes); if my only
foreign language was Spanish, then my choices would be Spain,
Latin America (excepting Brazil), the Philippines.  Therefore,
assuming the ability to emigrate ("choice of deployment
strategy") may become relevant to me at some future time, I
shall need to estimate how likely it is that I may wish to
(and be allowed to) move to, say, Canada, compared to, say,
Venezuela.

This part, just as for programming languages, has nothing to
do with _intrinsics_ of the language itself, and everything to
do with historical accidents -- ones, however, likely to
endure far longer than those affecting programming languages.

Around a hundred years ago, a great many Italians emigrated
to the United States, and even more went to Latin America
(especially Argentina, then among the countries in the world
with the highest per-capita GNP, quite close to the US's);
language played a part in this choice (many Italian emigrants
believed they could pick up the needed amount of Spanish with
far less effort than an equivalent amount of English -- and I
suspect they were right on this specific point).

100 years later, the average per-capita income of the
descendants of those Italians who chose to brave the perils
and difficulties of English (and went to the US) is several
times larger than that of the descendants of their Spanish
preferring contemporaries.

Such historical experiences may have long-term influence
on such debates.  In practice, there's a huge demand here,
now, for instruction in English, preciously little for French,
close to nothing for Spanish (or, less understandably, for
German, Japanese, etc).  The long-running electoral campaign
of the main right-wing party (next elections will be in the
spring, but they've been putting up billboards all over
the country for more than a year already) focuses on *piu`
inglese nelle scuole!* ("more English in schools") as one of
its key electoral promises, side by side with lower taxes,
more jobs, better pensions, etc etc -- not that the center-left
governments have short-changed English over the last few
years, mind you.


> 2.  Could we argue that an artificial language, such as Esperanto, is
better to use around the world then a natural language, like English?

Please go right ahead (it's been done at great length, and
very recently, in this very newsgroup, but don't let that
deter you).  The pragmatics-vs-ease-of-use issue looms
even larger here, of course.

>   Isn't there an axiom in physics that an experimenter influences the
outcome of his experiment (physicists, help me out here)?

Is it Heisenberg's principle, that you have in mind?  Though
I would focus on "the act of observation" rather than "the
observer" (the probable-equivalent in the softer sciences
is what's often called "the Hawthorne Effect" -- the very
_fact_ of being studied [as perceived by the study subjects]
altering the subjects' behaviour).  In medicine and related
subjects, the "double-blind, placebo-controlled experiment"
has long emerged as 'the' right way to diminish these issues,
but it's hard to apply even in some areas of medicine, let
alone other 'softer-sciences' studies.

If you were doing a controlled-experiment of comparative
programming language, in particular, I think it _would_ be
rather hard to figure out a way to hide from the subjects
themselves whether they were programming in Python or in
Perl...!-)  Let alone the very fact that their behaviour is
being studied (as would be needed to avoid Hawthorne Effects).

"Unbiased sampling" is also hard to ensure in such studies.

Suppose you took 100 programmers at random, for each language
under study, and had them "compete", writing programs to
perform the same task, for a small amount of prize money,
to be awarded under pre-specified criteria (how well does
it meet the specs, first; followed by, how maintainable it
is [to be tested by a typical last-minute specs-change];
followed by, execution speed; only programs completed under
a pre-specified deadline being allowed to compete).

Say that, under such conditions, programmers using language
A performed much better than ones using language B.  Could
the study afford decisive inference that "A is better than
B" for the given specs?  Not necessarily -- one would have
to somehow take into account possible correlations between
languages and other determinants of programmers' skills!
And this, even quite apart from the pragmatics of the
languages' implementations (IDE's, optimizers, etc).

If B is a language typically taught to beginners, while A
is a research-language normally only learned in the last
year of a doctorate degree, for example, it would hardly be
surprising to find that the typical A-programmer is much
more skilled than the typical B-programmer, without this
necessarily meaning much _about the languages themselves_.


Alex






More information about the Python-list mailing list