Re: Teaching Programming

2010-05-07 Thread Gregory Ewing
alex23 wrote: This is my biggest issue with Knuth's view of literate programming. If the generated source isn't readable, am I just supposed to trust it? How can I tell if an error lies in my expression of the algorithm or in the code generation itself? Knuth would say that the code generator

Re: Teaching Programming

2010-05-05 Thread Dave Angel
alex23 wrote: Ed Keith e_...@yahoo.com wrote: Knuth wanted the generated source to be unreadable, so people would not be tempted to edit the generated code. This is my biggest issue with Knuth's view of literate programming. If the generated source isn't readable, am I just supposed

Re: Teaching Programming

2010-05-05 Thread Ed Keith
--- On Tue, 5/4/10, alex23 wuwe...@gmail.com wrote: From: alex23 wuwe...@gmail.com Subject: Re: Teaching Programming To: python-list@python.org Date: Tuesday, May 4, 2010, 8:47 PM Ed Keith e_...@yahoo.com wrote: Knuth wanted the generated source to be unreadable, so people would

Re: Teaching Programming

2010-05-05 Thread Terry Reedy
On 5/5/2010 4:50 AM, Dave Angel wrote: alex23 wrote: Ed Keith e_...@yahoo.com wrote: Knuth wanted the generated source to be unreadable, so people would not be tempted to edit the generated code. This is my biggest issue with Knuth's view of literate programming. If the generated source

Re: Teaching Programming

2010-05-05 Thread Martin P. Hellwig
On 05/04/10 12:59, superpollo wrote: Martin P. Hellwig ha scritto: cut For the corner cases (I can think of a couple) it is good to know you can use ';' most of the time. most but not always as i noted (think about loops or function definition) Well through in some exec magic then, for

Re: Teaching Programming

2010-05-05 Thread superpollo
Martin P. Hellwig ha scritto: On 05/04/10 12:59, superpollo wrote: Martin P. Hellwig ha scritto: cut For the corner cases (I can think of a couple) it is good to know you can use ';' most of the time. most but not always as i noted (think about loops or function definition) Well through

Re: Teaching Programming

2010-05-04 Thread Jean-Michel Pichavant
André wrote: To Samuel Williams:(and other interested ;-) If you want to consider Python in education, I would encourage you have a look at http://www.python.org/community/sigs/current/edu-sig/ I think you will find that there are quite a few resources available - perhaps more than you are

Re: Teaching Programming

2010-05-04 Thread Samuel Williams
I personally like indentation. I just wonder whether it is an issue that some people will dislike. But anyway, I updated the language comparison to remove this critique. Kind regards, Samuel On 4/05/2010, at 9:22 PM, Jean-Michel Pichavant wrote: André wrote: To Samuel Williams:(and

Re: Teaching Programming

2010-05-04 Thread superpollo
Samuel Williams ha scritto: I personally like indentation. I just wonder whether it is an issue that some people will dislike. i think there is an issue if you -- say -- produce python code, from within another programming environment, to be executed on the fly, at least in some instances.

Re: Teaching Programming

2010-05-04 Thread Stefan Behnel
superpollo, 04.05.2010 12:28: i think there is an issue if you -- say -- produce python code, from within another programming environment, to be executed on the fly, at least in some instances. there might be problems if for example you generate code from a one-line template. There are a

Re: Teaching Programming

2010-05-04 Thread superpollo
Stefan Behnel ha scritto: superpollo, 04.05.2010 12:28: i think there is an issue if you -- say -- produce python code, from within another programming environment, to be executed on the fly, at least in some instances. there might be problems if for example you generate code from a one-line

Re: Teaching Programming

2010-05-04 Thread Martin P. Hellwig
On 05/04/10 11:28, superpollo wrote: Samuel Williams ha scritto: I personally like indentation. I just wonder whether it is an issue that some people will dislike. cut there might be problems if for example you generate code from a one-line template. cut Well a one-line template code

Re: Teaching Programming

2010-05-04 Thread Stefan Behnel
superpollo, 04.05.2010 13:23: Stefan Behnel ha scritto: the main reason why this problem doesn't hurt much in Python is that Python is a dynamic language that can get you extremely far without generating code. It's simply not necessary in most cases, so people don't run into problems with it.

Re: Teaching Programming

2010-05-04 Thread superpollo
Stefan Behnel ha scritto: superpollo, 04.05.2010 13:23: Stefan Behnel ha scritto: the main reason why this problem doesn't hurt much in Python is that Python is a dynamic language that can get you extremely far without generating code. It's simply not necessary in most cases, so people don't

Re: Teaching Programming

2010-05-04 Thread superpollo
Martin P. Hellwig ha scritto: On 05/04/10 11:28, superpollo wrote: Samuel Williams ha scritto: I personally like indentation. I just wonder whether it is an issue that some people will dislike. cut there might be problems if for example you generate code from a one-line template. cut Well

Re: Teaching Programming

2010-05-04 Thread James Mills
On Tue, May 4, 2010 at 9:43 PM, Stefan Behnel stefan...@behnel.de wrote: Python 2.5.4 (r254:67916, Feb 17 2009, 20:16:45) [GCC 4.3.3] on linux2 Type help, copyright, credits or license for more information.   A,B=2,3   if AB: ... print A+B ... else: ... print A**B-B**2 ... -1   A,B=3,2

Re: Teaching Programming

2010-05-04 Thread James Mills
On Tue, May 4, 2010 at 9:56 PM, superpollo ute...@esempio.net wrote: of course! *but* if i must generate on-the-fly python code that defines a function i am back again to the problem: One-liner: $ python Python 2.6.5 (r265:79063, Apr 27 2010, 18:26:49) [GCC 4.4.1 (CRUX)] on linux2 Type help,

Re: Teaching Programming

2010-05-04 Thread Ed Keith
--- On Tue, 5/4/10, Stefan Behnel stefan...@behnel.de wrote: From: Stefan Behnel stefan...@behnel.de Subject: Re: Teaching Programming To: python-list@python.org Date: Tuesday, May 4, 2010, 7:43 AM superpollo, 04.05.2010 13:23: Stefan Behnel ha scritto: the main reason why this problem

Re: Teaching Programming

2010-05-04 Thread Benjamin Kaplan
On Tue, May 4, 2010 at 7:23 AM, superpollo ute...@esempio.net wrote: Stefan Behnel ha scritto: superpollo, 04.05.2010 12:28: i think there is an issue if you -- say -- produce python code, from within another programming environment, to be executed on the fly, at least in some instances.

Re: Teaching Programming

2010-05-04 Thread superpollo
James Mills ha scritto: On Tue, May 4, 2010 at 9:56 PM, superpollo ute...@esempio.net wrote: of course! *but* if i must generate on-the-fly python code that defines a function i am back again to the problem: One-liner: $ python Python 2.6.5 (r265:79063, Apr 27 2010, 18:26:49) [GCC 4.4.1

Re: Teaching Programming

2010-05-04 Thread Stefan Behnel
superpollo, 04.05.2010 13:56: Stefan Behnel ha scritto: The question is: why do you have to generate the above code in the first place? Isn't a function enough that does the above? of course! *but* if i must generate on-the-fly python code that defines a function [...] Well, could you

Re: Teaching Programming

2010-05-04 Thread Stefan Behnel
Ed Keith, 04.05.2010 14:15: I wrote AsciiLitProg (http://asciilitprog.berlios.de/) in Python. It is a literate programming tool. It generates code from a document. It can generate code in any language the author wants. It would have been a LOT easier to write if it did not generate Python code.

Re: Teaching Programming

2010-05-04 Thread superpollo
Stefan Behnel ha scritto: superpollo, 04.05.2010 13:56: Stefan Behnel ha scritto: The question is: why do you have to generate the above code in the first place? Isn't a function enough that does the above? of course! *but* if i must generate on-the-fly python code that defines a function

Re: Teaching Programming

2010-05-04 Thread Stefan Behnel
superpollo, 04.05.2010 14:46: my template system wants the input to generate the code to stay on a single line ( don't ask :-( ) I hope you don't mind if I still ask. What are you generating and for what templating system? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Teaching Programming

2010-05-04 Thread Ed Keith
--- On Tue, 5/4/10, Stefan Behnel stefan...@behnel.de wrote: From: Stefan Behnel stefan...@behnel.de Subject: Re: Teaching Programming To: python-list@python.org Date: Tuesday, May 4, 2010, 8:40 AM Ed Keith, 04.05.2010 14:15: I wrote AsciiLitProg (http://asciilitprog.berlios.de/) in Python

Re: Teaching Programming

2010-05-04 Thread superpollo
Stefan Behnel ha scritto: superpollo, 04.05.2010 14:46: my template system wants the input to generate the code to stay on a single line ( don't ask :-( ) I hope you don't mind if I still ask. What are you generating and for what templating system? ok, since you asked for it, prepare

Re: Teaching Programming

2010-05-04 Thread alex23
Ed Keith e_...@yahoo.com wrote: For more information on Literate Programming in general see the following links. None of which address the question of what you found problematic about generating Python code. Was it issues with indentation? --

Re: Teaching Programming

2010-05-04 Thread Ed Keith
--- On Tue, 5/4/10, alex23 wuwe...@gmail.com wrote: From: alex23 wuwe...@gmail.com Subject: Re: Teaching Programming To: python-list@python.org Date: Tuesday, May 4, 2010, 10:06 AM Ed Keith e_...@yahoo.com wrote: For more information on Literate Programming in general see the following

Re: Teaching Programming

2010-05-04 Thread James Mills
On Wed, May 5, 2010 at 12:21 AM, Ed Keith e_...@yahoo.com wrote: To deal with indentation I had to   1) keep track of indentation of all chunks of code embedded in the      document and indent inserted chunks to the sum of all the      indentation of the enclosing chunks. In my experience of

Re: Teaching Programming

2010-05-04 Thread Andre Engels
On Tue, May 4, 2010 at 4:35 PM, James Mills prolo...@shortcircuit.net.au wrote: On Wed, May 5, 2010 at 12:21 AM, Ed Keith e_...@yahoo.com wrote: To deal with indentation I had to   1) keep track of indentation of all chunks of code embedded in the      document and indent inserted chunks to

Re: Teaching Programming

2010-05-04 Thread Ed Keith
--- On Tue, 5/4/10, James Mills prolo...@shortcircuit.net.au wrote: From: James Mills prolo...@shortcircuit.net.au Subject: Re: Teaching Programming To: python list python-list@python.org Date: Tuesday, May 4, 2010, 10:35 AM On Wed, May 5, 2010 at 12:21 AM, Ed Keith e_...@yahoo.com wrote

Re: Teaching Programming

2010-05-04 Thread Ed Keith
--- On Tue, 5/4/10, Andre Engels andreeng...@gmail.com wrote: From: Andre Engels andreeng...@gmail.com Subject: Re: Teaching Programming To: James Mills prolo...@shortcircuit.net.au Cc: python list python-list@python.org Date: Tuesday, May 4, 2010, 11:00 AM On Tue, May 4, 2010 at 4:35 PM

Re: Teaching Programming

2010-05-04 Thread Ethan Furman
Andre Engels wrote: On Tue, May 4, 2010 at 4:35 PM, James Mills prolo...@shortcircuit.net.au wrote: On Wed, May 5, 2010 at 12:21 AM, Ed Keith e_...@yahoo.com wrote: To deal with indentation I had to 1) keep track of indentation of all chunks of code embedded in the document and indent

Re: Teaching Programming

2010-05-04 Thread Stefan Behnel
Ed Keith, 04.05.2010 15:19: --- On Tue, 5/4/10, Stefan Behnel wrote: Ed Keith, 04.05.2010 14:15: Python is a great language to write in (although I do wish it did a better job with closures). But it is a PITA to generate code for! Interesting. Could you elaborate a bit? Could you give a

Re: Teaching Programming

2010-05-04 Thread Ed Keith
--- On Tue, 5/4/10, Stefan Behnel stefan...@behnel.de wrote: From: Stefan Behnel stefan...@behnel.de Subject: Re: Teaching Programming To: python-list@python.org Date: Tuesday, May 4, 2010, 11:33 AM Ed Keith, 04.05.2010 15:19: --- On Tue, 5/4/10, Stefan Behnel wrote: Ed Keith, 04.05.2010

Re: Teaching Programming

2010-05-04 Thread D'Arcy J.M. Cain
On Wed, 5 May 2010 00:35:18 +1000 James Mills prolo...@shortcircuit.net.au wrote: In my experience of non-indentation sensitive languages such as C-class (curly braces) it's just as hard to keep track of opening and closing braces. Harder. That was the big Aha! for me with Python. My first

Re: Teaching Programming

2010-05-04 Thread alex23
Ed Keith e_...@yahoo.com wrote: Tabs are always a problem when writing Python. I get around this problem by setting my text editor to expand all tabs with spaces when editing Python, but I have had problems when coworkers have not done this. It's best not to trust others to do the right

Re: Teaching Programming

2010-05-04 Thread Stefan Behnel
Ed Keith, 04.05.2010 17:43: The PITA is having to keep track of the indentation of each embedded chunk and summing it for each level of indentation. This requires a fair amount of bookkeeping that would not otherwise be necessary. The original prototype simply replaced each embedded chunk with

Re: Teaching Programming

2010-05-04 Thread superpollo
superpollo ha scritto: Stefan Behnel ha scritto: superpollo, 04.05.2010 14:46: my template system wants the input to generate the code to stay on a single line ( don't ask :-( ) I hope you don't mind if I still ask. What are you generating and for what templating system? ok, since you

Re: Teaching Programming

2010-05-04 Thread Terry Reedy
On 5/3/2010 7:46 PM, cjw wrote: Nobody likes indentation at first, Speak for yourself, please. For two decades before I met Python, I indented code nicely whenever it was allowed. That option was one of the great advancements of Fortran77 over FortranIV. Coming from C, I was immediately

Re: Teaching Programming

2010-05-04 Thread D'Arcy J.M. Cain
On Tue, 4 May 2010 17:00:11 +0200 Andre Engels andreeng...@gmail.com wrote: Although I have little or no experience with this, I still dare to say that I don't agree. The difference is that in C you do not _need_ to know where in the braces-defined hierarchy you are. You just embed or change a

Re: Teaching Programming

2010-05-04 Thread Chris Rebert
On Tue, May 4, 2010 at 8:49 AM, D'Arcy J.M. Cain da...@druid.net wrote: On Wed, 5 May 2010 00:35:18 +1000 James Mills prolo...@shortcircuit.net.au wrote: In my experience of non-indentation sensitive languages such as C-class (curly braces) it's just as hard to keep track of opening and

Re: Teaching Programming

2010-05-04 Thread Chris Rebert
On Tue, May 4, 2010 at 8:52 AM, Stefan Behnel stefan...@behnel.de wrote: Ed Keith, 04.05.2010 17:43: The PITA is having to keep track of the indentation of each embedded chunk and summing it for each level of indentation. This requires a fair amount of bookkeeping that would not otherwise be

Re: Teaching Programming

2010-05-04 Thread Terry Reedy
On 5/4/2010 8:46 AM, superpollo wrote: but i do not think i can use it myself, since my template system wants the input to generate the code to stay on a single line ( don't ask :-( ) I think we can agree that Python (unlike C, for instance) is not good for writing non-humanly-readable

Re: Teaching Programming

2010-05-04 Thread Dave Angel
Ethan Furman wrote: div class=moz-text-flowed style=font-family: -moz-fixedAndre Engels wrote: On Tue, May 4, 2010 at 4:35 PM, James Mills prolo...@shortcircuit.net.au wrote: On Wed, May 5, 2010 at 12:21 AM, Ed Keith e_...@yahoo.com wrote: To deal with indentation I had to 1) keep track of

Re: Teaching Programming

2010-05-04 Thread Gary Herron
Terry Reedy wrote: On 5/3/2010 7:46 PM, cjw wrote: Nobody likes indentation at first, Speak for yourself, please. For two decades before I met Python, I indented code nicely whenever it was allowed. That option was one of the great advancements of Fortran77 over FortranIV. Coming from C, I

Re: Teaching Programming

2010-05-04 Thread Stefan Behnel
superpollo, 04.05.2010 17:55: since i have some kind of computer literacy (as opposed to most of my colleagues), some years ago i was kindly asked to try and solve a simple particular problem, that is to write a program that generates math exercises (q+a) from an example taken from the textbook.

Re: Teaching Programming

2010-05-04 Thread superpollo
James Mills ha scritto: On Tue, May 4, 2010 at 9:56 PM, superpollo ute...@esempio.net wrote: of course! *but* if i must generate on-the-fly python code that defines a function i am back again to the problem: One-liner: $ python Python 2.6.5 (r265:79063, Apr 27 2010, 18:26:49) [GCC 4.4.1

Re: Teaching Programming

2010-05-04 Thread superpollo
superpollo ha scritto: James Mills ha scritto: On Tue, May 4, 2010 at 9:56 PM, superpollo ute...@esempio.net wrote: of course! *but* if i must generate on-the-fly python code that defines a function i am back again to the problem: One-liner: $ python Python 2.6.5 (r265:79063, Apr 27 2010,

Re: Teaching Programming

2010-05-04 Thread Terry Reedy
On 5/4/2010 1:44 PM, Dennis Lee Bieber wrote: On Tue, 04 May 2010 12:06:10 -0400, Terry Reedytjre...@udel.edu declaimed the following in gmane.comp.python.general: Speak for yourself, please. For two decades before I met Python, I indented code nicely whenever it was allowed. That option was

Re: Teaching Programming

2010-05-04 Thread superpollo
superpollo ha scritto: superpollo ha scritto: James Mills ha scritto: On Tue, May 4, 2010 at 9:56 PM, superpollo ute...@esempio.net wrote: of course! *but* if i must generate on-the-fly python code that defines a function i am back again to the problem: One-liner: $ python Python 2.6.5

Re: Teaching Programming

2010-05-04 Thread Benjamin Kaplan
On Tue, May 4, 2010 at 2:16 PM, superpollo ute...@esempio.net wrote: superpollo ha scritto: James Mills ha scritto: On Tue, May 4, 2010 at 9:56 PM, superpollo ute...@esempio.net wrote: of course! *but* if i must generate on-the-fly python code that defines a function i am back again to

Re: Teaching Programming

2010-05-04 Thread Ed Keith
--- On Tue, 5/4/10, Stefan Behnel stefan...@behnel.de wrote: From: Stefan Behnel stefan...@behnel.de Subject: Re: Teaching Programming To: python-list@python.org Date: Tuesday, May 4, 2010, 11:52 AM Ed Keith, 04.05.2010 17:43: The PITA is having to keep track of the indentation of each

Re: Teaching Programming

2010-05-04 Thread alex23
Ed Keith e_...@yahoo.com wrote: Knuth wanted the generated source to be unreadable, so people would not be tempted to edit the generated code. This is my biggest issue with Knuth's view of literate programming. If the generated source isn't readable, am I just supposed to trust it? How can I

Teaching Programming

2010-05-03 Thread Samuel Williams
Dear Friends, I'm looking for some help from the Python community. I hope this is the right place to ask for information. I'm putting together a website aimed at high school students and teachers, and would like to make sure the following page is as good as possible:

Re: Teaching Programming

2010-05-03 Thread Chris Rebert
On Mon, May 3, 2010 at 5:05 AM, Samuel Williams space.ship.travel...@gmail.com wrote: Dear Friends, I'm looking for some help from the Python community. I hope this is the right place to ask for information. I'm putting together a website aimed at high school students and teachers, and

Re: Teaching Programming

2010-05-03 Thread Chris Rebert
On Mon, May 3, 2010 at 5:29 AM, Chris Rebert c...@rebertia.com wrote: On Mon, May 3, 2010 at 5:05 AM, Samuel Williams space.ship.travel...@gmail.com wrote: Dear Friends, I'm looking for some help from the Python community. I hope this is the right place to ask for information. I'm putting

Re: Teaching Programming

2010-05-03 Thread Samuel Williams
Dear Chris, Thanks for reading further into the site. Yes, it is complicated to provide a good comparison. It isn't always accurate and I welcome feedback. Please be aware that orange does not mean problem - it simply means take note that there may be potential issues that you need to

Re: Teaching Programming

2010-05-03 Thread Chris Rebert
On 4/05/2010, at 1:06 AM, Chris Rebert wrote: On Mon, May 3, 2010 at 5:29 AM, Chris Rebert c...@rebertia.com wrote: On Mon, May 3, 2010 at 5:05 AM, Samuel Williams space.ship.travel...@gmail.com wrote: snip In particular, Why would I learn this language? section needs to have a few

Re: Teaching Programming

2010-05-03 Thread Samuel Williams
Dear Chris, I will take your feedback into consideration and let you know the outcome when I have time to think about it. Again, I appreciate your thoughts. Thanks for taking the time to think about the comparison chart. Kind regards, Samuel On 4/05/2010, at 1:58 AM, Chris Rebert wrote: I

Re: Teaching Programming

2010-05-03 Thread Helmut Jarausch
in http://www.linuxjournal.com/article/3882 Please have a look at it, Helmut. (I'm teaching programming for more than 15 years) -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: Teaching Programming

2010-05-03 Thread Terry Reedy
On 5/3/2010 9:38 AM, Samuel Williams wrote: Dear Chris, Thanks for reading further into the site. Yes, it is complicated to provide a good comparison. It isn't always accurate and I welcome feedback. Please be aware that orange does not mean problem - it simply means take note that there may

Re: Teaching Programming

2010-05-03 Thread André
To Samuel Williams:(and other interested ;-) If you want to consider Python in education, I would encourage you have a look at http://www.python.org/community/sigs/current/edu-sig/ I think you will find that there are quite a few resources available - perhaps more than you are aware of.

Re: Teaching Programming

2010-05-03 Thread cjw
On 03-May-10 09:38 AM, Samuel Williams wrote: Dear Chris, Thanks for reading further into the site. Yes, it is complicated to provide a good comparison. It isn't always accurate and I welcome feedback. Please be aware that orange does not mean problem - it simply means take note that there

Re: Teaching Programming

2010-05-03 Thread CM
Nobody likes indentation at first, it is different.   For what it's worth, I didn't have a programming background, and I liked Python's indentation right from the start. I was used to thinking in terms of indentation from writing and word processing documents with subordinate sections, so I