Re: [Edu-sig] Research on best language to use for teaching beginners

Look at page 19 on how the loop syntax was used! It was used just for "repeat n times" - really simple, (and with a trivial useless loop body). "while" is for a more complicated situation (in general) where there the number of repetitions is controlled by a significant and flexible condition. Such loops (particularly with code to prepare for the next time through the loop) are likely the most difficult for my students to understand, but I am not convinced that it is because of the word keyword used, but just because of the more complicated real situation. Also the keywords were not tested when a definite collection of objects was being iterated over, as opposed to a simple repetition or an artificial sequence created just to repeat. Then foreach sounds like a clear winner, likely somewhat better than to shorter Python "for". "while" and "for" require complicated additional syntax if you just want "repeat n times". The question then becomes whether adding special syntax for a simple repetition complicates the overall learning situation more than sticking with fewer keywords and depending on flexible synthesis, like using "for" with "range" in Python. This is the only thing I get out of the looping section of the article. I find the table very misleading. Dr. Andrew N. Harrington Computer Science Department Graduate Program Director gpd@cs.luc.edu Loyola University Chicago 529 Lewis Towers, 111 E. Pearson St. (Downtown) 417 Cudahy Science Hall (Rogers Park campus) http://www.cs.luc.edu/~anh Phone: 312-915-7982 Fax: 312-915-7998 aharrin@luc.edu (as professor, not gpd role) On Fri, Oct 2, 2015 at 9:02 AM, David Handy <david@handysoftware.com> wrote:
On Thursday, October 1, 2015 4:50pm, "Andre Roberge" < andre.roberge@gmail.com> said:
...
The best keywords (combining result from the two groups) are thought to include: repeat, again, loop, cycle The worst keywords are thought to include: foreach, while, echo, duplicate, for .... with "for" getting the worst result of all. Now that you mention it, I have hazy memories from > 30 years ago, when I was learning BASIC, of puzzling over the meaning of the FOR keyword and wondering why they chose that word. So I'm not surprised to see that on the list of difficult keywords. However, the WHILE keyword in BASIC was intuitive for me. So it surprises me to see that on their list of bad keywords. David H

I have found that if you begin teaching: for item in lst: and for letter in word: and then add break, and continue, and then teach for x in range(y): and then teach while (something): it all goes better than if you begin with while loops. But I don't know whether this means this is a better order to teach in, or simply a better order for _me_ to teach in. Laura

I would take this sort of study with a pinch of salt... The quality and skill of the teacher as well as the aptitude and learning context of the students has a huge impact on the end result. There are numerous studies that show this. To my mind this invalidates the "use method X or Y in subject area Z?" type questions such as this one. (For example, in my specialism of music there's a huge amount of debate over when and how to introduce various concepts. Such arguments usually boil down to, a good teacher will use their judgement depending on the aptitude and outlook of their students. This has been the case for at least 500 years of western classical music education.) Social science FTW!!!!! (So says a former teacher and classical musician with a philosophy degree.) :-) N. On 02/10/15 17:33, Laura Creighton wrote:
I have found that if you begin teaching:
for item in lst:
and
for letter in word:
and then add break, and continue,
and then teach
for x in range(y):
and then teach
while (something):
it all goes better than if you begin with while loops.
But I don't know whether this means this is a better order to teach in, or simply a better order for _me_ to teach in.
Laura
_______________________________________________ Edu-sig mailing list Edu-sig@python.org https://mail.python.org/mailman/listinfo/edu-sig

I'd say it's not just a matter of which keywords one chooses but how many. It'd be easy enough for Python to bloat with additional control structures the "fit the brain" of those used to thinking a particular way. I favor teaching any language with an assumption the student will always be learning others, so it helps to make bridges and analogies. When it comes to keywords, the discussion could go in the direction of "expression versus statement" e.g. in Python we have that distinction (an if statement is not an expression, defining expressions as "namables" e.g. name = "rock" in pile) whereas in Clojure (LISP family) we don't. Python's list comprehension syntax is a good example of how the keywords for controlling logic also enter into creating expressions i.e. for loop and if condition syntax as a part of an expression. That brings up another point: once you've mastered Python's for, you also have easy access to list, set and dict comprehension syntax. So the question is not just: which keywords are best but *how few* might one get away with (if *any*) and what's the payback for learning them i.e. how powerful are they, used in conjunction? Kirby

On Fri, Oct 2, 2015 at 10:16 AM, kirby urner <kirby.urner@gmail.com> wrote:
That brings up another point: once you've mastered Python's for, you also have easy access to list, set and dict comprehension syntax.
... and generator expression syntax, I should have added. :-D
I like Laura's ordering as well. Also, I spend some time talking about how not all callables are functions and indeed the range type is a good example. In Python 2.x, range( ) was a built-in function returning a list. By Python 3.now, range() is a type call, just as are str(), list( ), dict( ), int( ), float( ) -- these are not function calls. A function is a type of callable, not the callable type in the general sense. Kirby
participants (4)
-
Andrew Harrington
-
kirby urner
-
Laura Creighton
-
Nicholas H.Tollervey