473,288 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,288 software developers and data experts.

Re: php vs python

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
7 914
"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
"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
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
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
"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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.