php vs python

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Tue Jun 3 01:05:55 EDT 2008


On Mon, 02 Jun 2008 18:21:26 -0700, Joel Koltner wrote:

> "Arnaud Delobelle" <arnodel at googlemail.com> wrote in message 
> news:m2y75oa1xp.fsf at googlemail.com...
>> This is wrong, because if you know well one language only, you tend to
>> think that the principles that underpin it are universal.  So you will
>> try to shoehorn these principles into any other language you use.
> 
> Fair point, although I guess I was assuming the language you were good in was 
> something that covers, say, 90% of contemporary programming practices, e.g., 
> something like C++ : If you're truly good at C++ (and percentage-wise of all 
> programmers, relatively few are), there are not many things that I'm aware of 
> that are tremendously different in any other programming language.  Function 
> decorators from Java and some of the function programming stuff from Lisp, 
> perhaps, but those are pretty small additions (well within the "10%").

I think you are talking about something a little different than Arnaud. 
You are talking about the 10% that's new in another language that has to
be learned additionally and Arnaud is talking about the stuff the
programmer already knows about the old language that somewhat works in the
new one but is all but optimal and thus has to be *unlearned*.  From C++
to Python or Java this is RAII and deterministic destructors for instance.
Other old habits from people coming to Python are: using indexes where they
are not needed, trivial getters and setters, putting *everything* into
classes and every class into a module, and so on.

Another difference are internal versus external iterators.  In Python you
write the loop outside the iterable and pull the items out of it.  In
other languages (Ruby, Io, …) iterables do internal iteration and you give
them a function where all item are "pushed" into one at a time.

> Perhaps I should reduce my claim to those good at programming in any "first 
> class" language like C++ are generally going to write at least above-average 
> code in any other language. :-)

What makes C++ a "first class" language?  And did you quote "first class"
for the same reason than I did?  ;-)

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list