Why and how there is only one way to do something?

2005-12-15 Thread Tolga
As far as I know, Perl is known as there are many ways to do something and Python is known as there is only one way. Could you please explain this? How is this possible and is it *really* a good concept? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why and how there is only one way to do something?

2005-12-15 Thread jmdeschamps
Tolga wrote: As far as I know, Perl is known as there are many ways to do something and Python is known as there is only one way. Could you please explain this? How is this possible and is it *really* a good concept? if you 'import this', you get a bit of Python Zen... from which I have

Re: Why and how there is only one way to do something?

2005-12-15 Thread bonono
[EMAIL PROTECTED] wrote: Tolga wrote: As far as I know, Perl is known as there are many ways to do something and Python is known as there is only one way. Could you please explain this? How is this possible and is it *really* a good concept? if you 'import this', you get a bit of

Re: Why and how there is only one way to do something?

2005-12-15 Thread Steve Holden
Tolga wrote: As far as I know, Perl is known as there are many ways to do something and Python is known as there is only one way. Could you please explain this? How is this possible and is it *really* a good concept? Perl's credo is actually There's more than one way to do it, often

Re: Why and how there is only one way to do something?

2005-12-15 Thread Chris Mellon
On 15 Dec 2005 04:32:39 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Tolga wrote: As far as I know, Perl is known as there are many ways to do something and Python is known as there is only one way. Could you please explain this? How is this possible and

Re: Why and how there is only one way to do something?

2005-12-15 Thread bonono
Chris Mellon wrote: On 15 Dec 2005 04:32:39 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Tolga wrote: As far as I know, Perl is known as there are many ways to do something and Python is known as there is only one way. Could you please explain

Re: Why and how there is only one way to do something?

2005-12-15 Thread Chris Mellon
On 15 Dec 2005 05:08:02 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Chris Mellon wrote: On 15 Dec 2005 04:32:39 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Tolga wrote: As far as I know, Perl is known as there are many ways to do

Re: Why and how there is only one way to do something?

2005-12-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: [...] It is perfectly ok to define coding policy within an organisation, for a project that have more than one developer and things like that. But if the language allows more than one way to do it, people would try if that is what they want and they can. I would say

Re: Why and how there is only one way to do something?

2005-12-15 Thread Terry Hancock
On 15 Dec 2005 05:08:02 -0800 [EMAIL PROTECTED] wrote: I would say that if only one way to do it is the intend, make it into the language and any other way is simply error. Say if ternary operator is not the preferred way, don't have it in the language. If someone find a way to work around

Re: Why and how there is only one way to do something?

2005-12-15 Thread bonono
Chris Mellon wrote: You seem very, very interested in portraying anyone who wants to encourage good style and readability as a language Nazi. I don't appreciate that. You'll notice that I haven't taken the easy way out and told you to go away and play with Perl, right? Noop. My stand is that

Re: Why and how there is only one way to do something?

2005-12-15 Thread bonono
Steve Holden wrote: This would have the unfortunate side effect of only allowing changes to Python that allowed users to do things which are currently impossible. Since Python is Turing-complete, this would effectively inhibit all further changes to the language. I don't quote understand the

Re: Why and how there is only one way to do something?

2005-12-15 Thread bonono
Terry Hancock wrote: But that is precisely what it does mean -- Python's language design tries to be reasonably minimal: there's usually one fairly easy way to do a task. Unintentionally, there may well be a half-dozen really hard ways to do it. The point of telling this to the potential

Re: Why and how there is only one way to do something?

2005-12-15 Thread Ben Sizer
Steve Holden wrote: Would you, say, remove for loops because they could be written as while loops. Don't forget the word obvious that appears in that catchphrase ... Interestingly - and somewhat related to this - the other day I was looking for a do..while or do..until loop in the Python

Re: Why and how there is only one way to do something?

2005-12-15 Thread Steve Holden
Chris Mellon wrote: [...] (Am I dating myself? ...) Do we need to know about your love life here? Are you hermaphroditic? If not the relationship will never go anywhere. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC

Re: Why and how there is only one way to do something?

2005-12-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: Steve Holden wrote: This would have the unfortunate side effect of only allowing changes to Python that allowed users to do things which are currently impossible. Since Python is Turing-complete, this would effectively inhibit all further changes to the language. I

Re: Why and how there is only one way to do something?

2005-12-15 Thread jmdeschamps
Yes, a shared preferred way. And the same is true of many... Think Haskell, OCaml, Lua, Ruby, Lisp, Smalltalk, Java, C... They all have qualities of some sort, that appeal to some of us. Not all the same, nor to all of us. It's really a question of perspective. In this Python community, one

Re: Why and how there is only one way to do something?

2005-12-15 Thread Gerard Flanagan
Tolga wrote: As far as I know, Perl is known as there are many ways to do something and Python is known as there is only one way. Could you please explain this? How is this possible and is it *really* a good concept? Yes it is a good concept because you can concentrate on Strategy rather

Re: Why and how there is only one way to do something?

2005-12-15 Thread bonono
Steve Holden wrote: This would have the unfortunate side effect of only allowing changes to Python that allowed users to do things which are currently impossible. Since Python is Turing-complete, this would effectively inhibit all further changes to the language. I don't quote understand the

Re: Why and how there is only one way to do something?

2005-12-15 Thread bonono
Steve Holden wrote: It says that Python is already adequately expressive to allow it to solve all solvable problems: more briefly, Python can already do everything. Hence there is no need to change the language. Of course I use this as a /reductio ad absurdum/ to try to show you the

Re: Why and how there is only one way to do something?

2005-12-15 Thread Steve Holden
Ben Sizer wrote: Steve Holden wrote: Would you, say, remove for loops because they could be written as while loops. Don't forget the word obvious that appears in that catchphrase ... Interestingly - and somewhat related to this - the other day I was looking for a do..while or do..until

Re: Why and how there is only one way to do something?

2005-12-15 Thread Carl J. Van Arsdall
[EMAIL PROTECTED] wrote: Would you, say, remove for loops because they could be written as while loops. Don't forget the word obvious that appears in that catchphrase ... If every for usage can be done with while and that while is the preferred way, why not ? As I said, the

Re: Why and how there is only one way to do something?

2005-12-15 Thread Aahz
In article [EMAIL PROTECTED], Steve Holden [EMAIL PROTECTED] wrote: (Part of) Python's credo (which you can read in context by typing import this at an interactive command prompt) is There should be one (and preferably only one) way to do it. Actually, I've gotten used to doing

Re: Why and how there is only one way to do something?

2005-12-15 Thread Richie Hindle
[Steve] Since Python is Turing-complete Is there some equivalent of Godwin's Law that we can invoke at this point? 8-) -- Richie Hindle [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Why and how there is only one way to do something?

2005-12-15 Thread Xavier Morel
Aahz wrote: In article [EMAIL PROTECTED], Steve Holden [EMAIL PROTECTED] wrote: (Part of) Python's credo (which you can read in context by typing import this at an interactive command prompt) is There should be one (and preferably only one) way to do it. Actually, I've gotten used

Re: Why and how there is only one way to do something?

2005-12-15 Thread bonono
Carl J. Van Arsdall wrote: Although, obvious to whom is a good question. If you don't know the language very little will be obvious to you, however one who is familiar with python (rtfm) would know which cases should obviously use while and which cases should obviously use for So far, I

Re: Why and how there is only one way to do something?

2005-12-15 Thread Steve Holden
Aahz wrote: In article [EMAIL PROTECTED], Steve Holden [EMAIL PROTECTED] wrote: (Part of) Python's credo (which you can read in context by typing import this at an interactive command prompt) is There should be one (and preferably only one) way to do it. Actually, I've gotten used

Re: Why and how there is only one way to do something?

2005-12-15 Thread bonono
Steve Holden wrote: This would have the unfortunate side effect of only allowing changes to Python that allowed users to do things which are currently impossible. Since Python is Turing-complete, this would effectively inhibit all further changes to the language. I don't quite understand the

Re: Why and how there is only one way to do something?

2005-12-15 Thread Simon Brunning
On 12/15/05, Steve Holden [EMAIL PROTECTED] wrote: Aahz wrote: python -c 'import this' Faster: python -m this So, there's two ways to do it. ;-) -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Why and how there is only one way to do something?

2005-12-15 Thread Rocco Moretti
[EMAIL PROTECTED] wrote: Chris Mellon wrote: Any time you want to write something in any way other than the obvious way, ask yourself why? Is it more obvious *to you*, which is a good reason as long as you're only writing code for yourself? Or is it just to be different, or because you think

Re: Why and how there is only one way to do something?

2005-12-15 Thread Brian Cully
[EMAIL PROTECTED] wrote: C-programmer learning python : Hi, where is condition ? true : false someone prefer the if/else statement type: Can't you see that the following is much more readable, stupid(well not the exact word but tone in such a way like words of messy or elegant etc.) if

Re: Why and how there is only one way to do something?

2005-12-15 Thread Tim Peters
[Steve Holden, to bonono] ... I believe I have also suggested that the phrases of the Zen aren't to be taken too literally. Heretic. You seem to distinguish between obvious meaning obvious to Steve but not necessarily to me and really obvious meaning obvious to both Steve and me. So where

Re: Why and how there is only one way to do something?

2005-12-15 Thread Aahz
In article [EMAIL PROTECTED], Steve Holden [EMAIL PROTECTED] wrote: Aahz wrote: In article [EMAIL PROTECTED], Steve Holden [EMAIL PROTECTED] wrote: (Part of) Python's credo (which you can read in context by typing import this at an interactive command prompt) is There should be one

Re: Why and how there is only one way to do something?

2005-12-15 Thread Steve Holden
Simon Brunning wrote: On 12/15/05, Steve Holden [EMAIL PROTECTED] wrote: Aahz wrote: python -c 'import this' Faster: python -m this So, there's two ways to do it. ;-) You want a clip round the ear? regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden

Re: Why and how there is only one way to do something?

2005-12-15 Thread Dave Hansen
On Thu, 15 Dec 2005 14:57:18 + in comp.lang.python, Steve Holden [EMAIL PROTECTED] wrote: [...] Would you say do: suite while condition or what? Basically do ... while and do ... until most naturally put the Works for me, though I wouldn't cry if the while was changed

Re: Why and how there is only one way to do something?

2005-12-15 Thread Dan Sommers
On Thu, 15 Dec 2005 16:28:30 +0100, Xavier Morel [EMAIL PROTECTED] wrote: $ python -m this (no quotes needed btw) *Three*. *Three* ways to do it: import, -c, -m, and an almost fanatical devotion to the Pope. It's usually useful to pipe it through grep too, in order to get only the piece

Re: Why and how there is only one way to do something?

2005-12-15 Thread Steve Holden
Aahz wrote: In article [EMAIL PROTECTED], Steve Holden [EMAIL PROTECTED] wrote: Aahz wrote: In article [EMAIL PROTECTED], Steve Holden [EMAIL PROTECTED] wrote: (Part of) Python's credo (which you can read in context by typing import this at an interactive command prompt) is There

Re: Why and how there is only one way to do something?

2005-12-15 Thread Chris Smith
bonono == bonono [EMAIL PROTECTED] writes: bonono What I don't quite understand is, if it is obvious, bonono whether there is a Zen, people would still code it that bonono way(unless of course they want to hide it from others or bonono make it difficult to understand on

Re: Why and how there is only one way to do something?

2005-12-15 Thread Tolga
OhmiGod! I posted this message this morning and when I came home, I said myself umm, lemme check it and I cannot believe what I see... 37 threads! As long as Python is supported by such a hardworking and enthusiastic community, I'm sure that he (=Python) will become the nightmare of many other

RE: Why and how there is only one way to do something?

2005-12-15 Thread Delaney, Timothy (Tim)
Simon Brunning wrote: On 12/15/05, Steve Holden [EMAIL PROTECTED] wrote: Aahz wrote: python -c 'import this' Faster: python -m this So, there's two ways to do it. ;-) It's actually a perfect example of an new one-obvious-way replacing an old way (or rather, couple of ways).

Re: Why and how there is only one way to do something?

2005-12-15 Thread Mike Meyer
[EMAIL PROTECTED] writes: The point is again, obvious is not so obvious sometimes. You keep leaving out the context. We're writing *python*. What's obvious when you're writing python won't be when you're writing FORTRAN, or Scheme, or O'Caml, or Eiffel, or Generally (not always, I'll

Re: Why and how there is only one way to do something?

2005-12-15 Thread Dave Benjamin
On Thu, 15 Dec 2005, Richie Hindle wrote: [Steve] Since Python is Turing-complete Is there some equivalent of Godwin's Law that we can invoke at this point? 8-) None that I know of, but perhaps there should be. =) Note that in this particular thread, we could have invoked the real

Re: Why and how there is only one way to do something?

2005-12-15 Thread Dave Benjamin
On Thu, 15 Dec 2005, Simon Brunning wrote: On 12/15/05, Steve Holden [EMAIL PROTECTED] wrote: Aahz wrote: python -c 'import this' Faster: python -m this So, there's two ways to do it. ;-) Yes, but which way do you do it if you're Dutch? --

Re: Why and how there is only one way to do something?

2005-12-15 Thread John Hazen
* Chris Mellon [EMAIL PROTECTED] [2005-12-15 06:09]: (Am I dating myself? Do teenagers still put studs on their jackets?) No. They put studs in their lips, tongues, eyebrows, navels, and sexual organs. Oh, and ears. (How quaint.) -- http://mail.python.org/mailman/listinfo/python-list

Re: Why and how there is only one way to do something?

2005-12-15 Thread Roy Smith
In article [EMAIL PROTECTED], John Hazen [EMAIL PROTECTED] wrote: * Chris Mellon [EMAIL PROTECTED] [2005-12-15 06:09]: (Am I dating myself? Do teenagers still put studs on their jackets?) No. They put studs in their lips, tongues, eyebrows, navels, and sexual organs. Oh, and ears.

Re: Why and how there is only one way to do something?

2005-12-15 Thread Kay Schluehr
Tolga wrote: As far as I know, Perl is known as there are many ways to do something and Python is known as there is only one way. Could you please explain this? How is this possible and is it *really* a good concept? Do you know about the existence of god, just or scientific truth? Of course

Re: Why and how there is only one way to do something?

2005-12-15 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-12-15 07:50: obvious). It is just like there are language on this planet that reads from right to left horizontally, as well as top to bottom, then right to left. And you are trying to tell them that English way is the right way or the obvious