By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,550 Members | 1,189 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,550 IT Pros & Developers. It's quick & easy.

Re: php vs python

P: n/a
Jerry Stuckle wrote:
>
As I've said before - good programmers can write good code in any
language.
So... an eloquent speaker of English is also an eloquent speaker of
Spanish/French/German?

I think your statement would be correct if worded: some programmers can
write good code in any language. There's a reason why computer coding
paradigms are called 'languages' -- because they are, and as such they
require different ways of thinking. Just because someone is good at
playing pianos doesn't mean they are also good at wood carving. Just
because someone is good (i.e. writes good code) in C / PHP / Python /
Perl / Assembly / whatever does not inherently mean that that same
person will be able to write good code in any other language. That's
one reason why there are so many to choose from: different people think
differently and most are only optimal in certain areas.

Or perhaps your definition of a good programmer means somebody who can
write good code in any language? What then is a programmer who can only
write good code in a handful of languages? Or maybe only two languages?
Or even only one?

My definition of a good programmer is someone who can write good code in
a computer language. I would use the word 'versatile' or even
'multi-lingual' to broaden the scope to more than one language.
--
Ethan

P.S.
My apologies, Jerry, for writing back to you directly -- I haven't yet
discovered how to post to newsgroups, and I do not know the php mailing
list address. I guess by both our definitions I am not a 'good
newsgroup poster.' ;-)

Jun 27 '08 #1
Share this Question
Share on Google+
7 Replies


P: n/a
"Ethan Furman" <et***@stoneleaf.uswrote in message
news:ma***************************************@pyt hon.org...
Jerry Stuckle wrote:
As I've said before - good programmers can write good code in any
language.
So... an eloquent speaker of English is also an eloquent speaker of
Spanish/French/German?
There's potentially a large difference between a "good" speaker of
English/German/etc. vs. "eloquent."

I'd tend to agree with Jerry that if you can write "good" code in one
language, you can in pretty much any other as well... but that doesn't imply
you're necessarily "eloquent" in any languages. :-) Eloquence is nice, but
eradicating "bad" code in this world is about a million times more important
than attempting to move people from "good" code to "eloquent" code.

To be Pythonic here, "eloquent" code would perhaps often have clear, clean
list comprehensions used when "good" code would use a "for" loop but still be
easy to follow as well and perfectly acceptable in the vast majority of cases.

Jun 27 '08 #2

P: n/a
"Joel Koltner" <za***************@yahoo.comwrites:
There's potentially a large difference between a "good" speaker of
English/German/etc. vs. "eloquent."

I'd tend to agree with Jerry that if you can write "good" code in
one language, you can in pretty much any other as well... but that
doesn't imply you're necessarily "eloquent" in any languages. :-)
Eloquence is nice, but eradicating "bad" code in this world is about
a million times more important than attempting to move people from
"good" code to "eloquent" code.
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.

It's only when you have become reasonably proficient in a number of
conceptually different languages that you start to build a picture of
what "a programming language" is.

I understand that there are some sane practices that are useful to
know when programming in any language, but it is wrong to say that the
skill of programming can be reduced to that, the rest being syntax.
There is (hopefully!) a design behind the syntax, you have to
understand it to use the language well.

You may be great at building Turing machines. That doesn't make you a
master of crafting lambda-expressions.
To be Pythonic here, "eloquent" code would perhaps often have clear,
clean list comprehensions used when "good" code would use a "for"
loop but still be easy to follow as well and perfectly acceptable in
the vast majority of cases.
I find that eloquent Python speakers often tend to write a for loop
when mere good ones will try to stick a list comprehension in!

Regards

--
Arnaud
Jun 27 '08 #3

P: n/a
Arnaud Delobelle <ar*****@googlemail.comwrote:
I find that eloquent Python speakers often tend to write a for loop
when mere good ones will try to stick a list comprehension in!
+1 QOTW

--
Duncan Booth http://kupuguy.blogspot.com
Jun 27 '08 #4

P: n/a
In article <ma***************************************@python. org>,
Ethan Furman <et***@stoneleaf.uswrote:
Jerry Stuckle wrote:
>
As I've said before - good programmers can write good code in any
language.
>

So... an eloquent speaker of English is also an eloquent speaker of
Spanish/French/German?
Oh, Bull. Computer languages are so narrow they are more like dialects
of a single language. If you know English you can learn to speak to a
Brit, Scot, or Aussie. That's more like it...if you really want to
stretch the definition of a language. And it is a stretch. Anyone
speak C?

Sheeze.

--
-- Lou Pecora
Jun 27 '08 #5

P: n/a
"Arnaud Delobelle" <ar*****@googlemail.comwrote in message
news:m2************@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%").

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. :-)
You may be great at building Turing machines. That doesn't make you a
master of crafting lambda-expressions.
Certainly the most important thing for any programmer to know is where his
skills lie and where he should purposely keep things "braindead simple"
because he's more likely to introduce bugs by trying to be "eloquent."
I find that eloquent Python speakers often tend to write a for loop
when mere good ones will try to stick a list comprehension in!
This is the trap I refer to above -- beginning programmers are far more likely
to mis-use more sophisticated language features than experienced programmers
are. Heck, you see entire languages like Java built around such premises,
that it's better to have a simpler language that's harder to mis-use than a
more sophisticated one that could be readily abused. C++ is perhaps the
ultimate "anything goes" langauge -- tons of power and sophistication, very
little nannying. Python has its own philosophy, of course, although at times
it's somewhat arbitrary, e.g., for "explicit is better than implicit" -- sure,
fine, but "of course" only applied to things that we haven't already decided
"should be" implicit! Something like Python iterators are not at all
explicit/obvious, for instance, to someone coming from, say, a Visual BASIC
background... although I suppose they're still a lot simpler than, e.g., C++
scoping rules for name resolution.

---Joel
Jun 27 '08 #6

P: n/a
On Mon, 02 Jun 2008 18:21:26 -0700, Joel Koltner wrote:
"Arnaud Delobelle" <ar*****@googlemail.comwrote in message
news:m2************@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
Jun 27 '08 #7

P: n/a
"Marc 'BlackJack' Rintsch" <bj****@gmx.netwrote in message
news:6a*************@mid.uni-berlin.de...
I think you are talking about something a little different than Arnaud.
Ah, OK.
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.
Some of that is more political/policy than anything having to do with the
language. Python likes to make it blatantly obvious that a lot of it is
unnecessary, so it puts the "control freak" type of programmers on the
defensive when, e.g., class variables and methods aren't private by default.
(Guido's "we're all conesenting adults here" is of course a good response to
this!)
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.
The Python method is -- IMO -- rather more powerful here, even if the whole
protocol is somewhat less explciti than the Ruby/Io/etc. approach.
What makes C++ a "first class" language?
My somewhat arbitrary definition is something along the lines of a language
with most all of the "contemporary" features expected of languages (e.g., "old
school" procedural languages like C/Pascal/Fortran 77 don't count) that are
targeting at writing everything from small utilities to programs of various
sizes to full-blown operating systems.
And did you quote "first class"
for the same reason than I did? ;-)
Probably... C++ is kinda like the McMaster-Carr catalog, whereas Python is a
well-stocked hardware store with knowledgable salespeople.

---Joel
Jun 27 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.