[Edu-sig] Re: ChatGPT for py teaching

2023-01-04 Thread Christian Mascher

Hi,

a student of mine was aware of this chatbot and asked it about a
class-assignment of his own accord. We program in Java with some extra
homemade library class used by some schools in our region.

The bot came up with a "solution" which was flawed in several respects:
1. It used some other (unimported) classes - solution doesn't work and
doesn't fit the assignment.
2. It put all the code into the constructor, a typical (design and
style) error for students beginning with Java.

When confronted with the problem number one above, it acknowledged the
fault and produced a different unrelated solution.

Sooo

I was impressed how well the chatbot simulated a typical clueless human
who even thinks he is smart, while his code is basically bullshit.
(Probably a result of googling forums, where other learners posted their
solutions to assignments with the given school library classes.) The bot
clearly passed the Turing test ;-)

But...

I don't think the interaction was helpful for somebody who is learning
to program. It is probably less helpful than conversing with other also
not very knowledgeable students as they are at least reasoning humans.

Talking to the bot might be fun to do in the last lesson before
christmas or so. Entertaining until you realise the software is
"simulating" intelligent conversation - not really talking with insight.
And that could turn out to be a waste of time.

Happy new year

Christian

Am 03.01.2023 um 04:06 schrieb Jurgis Pralgauskis:

Hi, happy NY!

ChatGPT can create, fix and explain code
https://openai.com/blog/chatgpt/#samples


Anyone tried to incorporate it into teaching process?
Or have ideas/doubts how it ciuld help?

___
Edu-sig mailing list -- edu-sig@python.org
To unsubscribe send an email to edu-sig-le...@python.org
https://mail.python.org/mailman3/lists/edu-sig.python.org/
Member address: christian.masc...@gmx.de

___
Edu-sig mailing list -- edu-sig@python.org
To unsubscribe send an email to edu-sig-le...@python.org
https://mail.python.org/mailman3/lists/edu-sig.python.org/
Member address: arch...@mail-archive.com


Re: [Edu-sig] Test

2016-03-01 Thread Christian Mascher



I joined
the list and tried to write to it several times but seems that my letters
are just vanishing. I also wrote to edu-sig-ow...@python.org and
wil...@visi.com (couple of weeks ago) but got no response.


I am a long-time lurker, but lately some of my mails seemed to vanish as 
well, so this is just a test ;-)


Hope it gets sorted out for everyone,

Christian
___
Edu-sig mailing list
Edu-sig@python.org
https://mail.python.org/mailman/listinfo/edu-sig


[Edu-sig] Edu-sig list offline?

2015-09-24 Thread Christian Mascher

Hi all,

as a long-time lurker I seem to be getting no more postings on this 
list. Has everybody moved to EduWG, or are you all just very busy at the 
moment?


Cheers,

Christian
___
Edu-sig mailing list
Edu-sig@python.org
https://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Recommendation for editor+console or IDE for teaching beginners

2014-12-10 Thread Christian Mascher


Hi Andre,



I would really like some advice based on practical experience teaching
beginners.



I personally would  stick with Idle. There was a time, when it was 
problematic under MacOS  because tkinter was missing there - but those 
days are over.


As an all-platform, _already (battery-) included_ editor, Idle is simple 
but pretty good. There is not much you have to explain which concerns 
the ide.


Most of the problems of beginners in Idle (and I always use idle in 
class, apart from reeborg) are not very idle-specific (indentation, copy 
and paste in console-mode, miximg tabs and spaces, saving, importing).


You will have to explain the difference between programming at the 
prompt or in a file, but you would have to explain similar things in 
other ide's as well.


If you want to keep it safe and simple, write programs with Idle only in 
files (File-New File, and run them with F5). Most technical problems 
arise when using the live-prompt (session-saving is useless).


Some students used idle and pygame together some years ago with no problems.





1. Use IDLE.  Free, part of the standard distribution.  I never used it
very much myself and I keep reading about how tricky it can be to set up
properly for beginners - mostly, I gathered, due to path problems on
Windows.   There is a proposal to make it better (
https://github.com/asweigart/idle-reimagined/wiki) but it is doubtful it
will be realized soon enough (or at all) to make it worthwhile waiting for
it.



I haven't encountered path problems with idle recently (about since the 
introduction of Windows XP and python msi-installers ...)


When Pygame is installed Python has got to find it, but that shouldn't 
be a concern of Idle.


Having to install only two things (check for the python dependency of 
the pygame-version first!) would be my choice.


Cheers,

Christian
___
Edu-sig mailing list
Edu-sig@python.org
https://mail.python.org/mailman/listinfo/edu-sig


[Edu-sig] computers and schools

2014-11-30 Thread Christian Mascher

Hi Kirby,


I think many students would be better served if the emphasis were on
creating for them a safe personal workspace, with plenty of bandwidth
to the outside world, with opportunities for 2-way interactions (so
not just receiving broadcast television, as in the mindless consumer
couch potato model of the late 1900s).



I know that many if not most of our students have exactly this
environment at their home. But they don't use it much for learning. The
average 14-year-old won't do much education-wise outside of some fields
of special interest, if there isn't any pressure in form of exams and
tests etc. Just talking about real students...


In a comfortable middle class household, Johnny already has a heated
bedroom with a desk, books, and computer, but has to leave this
workspace to rub shoulders with peers in a daycare setting we call
school.


I know quite a lot would rather stay at home and play the same computer
games all day. Still waiting to see the masses who want to learn two
foreign languages plus maths and sciences all on their own...

(I know there always are some exceptions. I always wanted to learn more 
than what I learned at school, but even I did go to school nevertheless 
and probably would never have learnt Maths or French all on my own.)







Said school may censor Youtube and/or otherwise block access to
information, so for many school-goers the experience of school is of
burning an expensive fuel to frequent a less information-rich
environment than their own comfortable bedrooms.



Well I get to see lots of real students, but when they open youtube in a
computer lab at school, they never look at those wonderful educational
videos. I encourage them to do so at home (maths is explained pretty
much like at school, but with a pause and rewind button!), but many
prefer to use their own time otherwise.






Better that Sally should stay home and watch instructional Youtubes
about  math + programming approach to STEM. She just won't find that
at her  local day care center.  Why waste Sally's time?


I haven't met many of Sally' s kind.

Also: In many countries in Europe (in Germany for instance)
homeschooling is actually forbidden for a variety of reasons.

But apart from that: I do question the main assumption that not using a
computer for a couple of hours each day is in any way damaging to the
education. On the contrary I think it is higly unlikely that a large
proportion of the youth in Germany would still learn English, Maths,
some bits about Science and History at the same levels as today when
they would be left to their own (computer) devices.

Already in the present system the advantaged students are those who have
educated parents, not those with the biggest computer racks at home.
That problem would be amplified to the extreme, when education would be
privatized in this way. My guess is: Only the very best 1-3% students
would learn more or less about as much as now, because some kind of
coach would be around.

To paraprase Churchhill: Schools are lousy ecosystems for learning but
we haven't found any practical better systems yet.

How successful has the OLPC-project actually been? Any evidence beyond
quotes and ideas from SciFi The diamond age ;-) ?

Cheers

Christian


___
Edu-sig mailing list
Edu-sig@python.org
https://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] gimme more computers (rant)

2014-11-26 Thread Christian Mascher

Hi Laura,



Children all over Sweden are getting ipads, ruggardized from the school
districts.  They are 240 x 170 mm, and apple has done a very good job of
convincing education officials that this is where the 'computer literacy'
money should be spent.


I think the public attitude to computers and education (all over the 
world) is crazy.


You don't _need_ computers for education. Computers are extremely 
overrated concerning school education in my personal view.


It is useful to have some computer literacy, but compared with 
literacy itself: many orders of magnitude difference in usefulness, so 
actually the word 'computer literacy' is an exaggeration in itself.


In Germany they just published a study, showing that we are far behind 
Canada and many other OECD-states regarding computer-use in schools. No 
journalist even questioned the general assumption that this is 
necessarily a bad thing the public should get hysterical about. I also 
haven't heard about German engineers being lo-tech because they weren't 
allowed to look up everything in wikipedia when they went to school.


But the marketing of the Big Money Firms in IT-industry will pay off 
some time. Hey, lets burn lots of money for more computers in school - 
sounds GREAT.


Crazy...

Christian



___
Edu-sig mailing list
Edu-sig@python.org
https://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Reeborg update

2014-11-24 Thread Christian Mascher

 Hi,


I went there in a recent chrome on a laptop with a fairly small screen and
there are some rendering issues that make some of the controls unusable.



I noticed the same with Nexus 7 (android) and firefox. On the desktop 
Ctrl + - usually makes things smaller and thus fit onto the screen (esp. 
editor right next to the world, so the controls below the world are 
visible), but on the android tablet that didn't help.


These tablets are just to small for all the information and even firefox 
is different compared to its desktop version.


Christian

___
Edu-sig mailing list
Edu-sig@python.org
https://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] graphical calculator

2014-04-15 Thread Christian Mascher

Hi,



Unfortunately, I'd love to do the same in AP Calculus but Graphing
Calculators are required on that AP exam. The students need to use the
Graphing Calculator all year to be proficient enough by May.


in my state of Germany the graphical calculator ist just being adopted 
as mandatory in high-school math (last three years).


As much as I like Python, I understand the administration's point that 
PCs/tablets are not an option, because they can't be used in exams (too 
much risk of cheating with WIFI, other installed programs ...).


Schools can choose to use a CAS, but then they get entirely different 
graduation exam questions. Even then, it is most likely they have to use 
CAS-calculators (quite expensive but bought by the students) because 
otherwise the schools would have to keep a whole set of tablets ready 
for the exams and guarantee that only the CAS-program can be used during 
the tests.


My experience with Python certainly helped me to get my head round the 
way _simple_ graphical calculators work with lists quickly. OTOH the 
average math classes here have just 135 min a week and must cover 
calculus, vectors, matrices (to a certain degree) and statistics. Not 
much time to use different tools. Perhaps even not enough time to learn 
to use the more complicated calculators proficiently along the way. So I 
always look for tools which are as simple to use as Python. That might 
rather be the more simpler graphical calculator (versus the high-end 
type which can do so much more but requires months of tool-training).


Just my 2c

Christian
 So, adding

SAGE/python to the mix there would not be helpful. If only the
CollegeBoard would allow PC/Tablet based calculators/programming
languages/CASs, I'd be all over it!



In fact, I just started a

DonorsChoose project to at least replace my Graphing Calculators
(TI-83/TI-89) with something more modern (TI Nspire CX CAS):
http://www.donorschoose.org/calcpage2010?active=true

Sincerely,
A. Jorge Garcia
Applied Math, Physics  CS
http://shadowfaxrant.blogspot.com
http://www.youtube.com/calcpage2009
2013 NYS Secondary Math http://PAEMST.org Nominee


___
Edu-sig mailing list
Edu-sig@python.org
https://mail.python.org/mailman/listinfo/edu-sig



___
Edu-sig mailing list
Edu-sig@python.org
https://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Strange results

2012-01-03 Thread Christian Mascher

Hi,

apart from integer-division (see Kirby's post) the result also depends 
on different interpretations of the operator -:



My friend noticed strange results from Python 2.5.2:

  b=47
  0-b/2
-23


is interpreted as 0 - ( b/2) so integer division comes first before 
subtraction (- as subtraction operator).



  -b/2+0
-24



is interpreted like ( (-1) * b ) / 2 + 0
so a leading - is applied like a _multiplication_ and because * and / 
are on equal levels of execution, the left-most is evaluated first.


Always interesting how seemingly simple and straightforward rules can 
trip you in special circumstances. Parentheses are recommended if you 
want to be sure.


Happy new year

Christian

Anybody can explain that?

Regards,
Andrzej Kapanowski




___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Using try / except: any stipulations against routine use?

2011-12-15 Thread Christian Mascher



On the other hand,
 res_dict[ext] = res_dict.get(ext, 0) + 1


Isn't this at least as readable, and conceptually simpler?

if ext in res_dict:
res_dict[ext] += 1
else: 
res_dict[ext] = 1





I haven't done much coding in Python lately. And I found this much more 
readable than the .get method which I forgot about. I positively didn't 
understand the oneliner just by reading it over and over again.


Of course I could easily have opened idle and looked up the .get method 
online (or looked in a manual).


The really good thing about Python is that so much of the core language 
doesn't surprise you. One is able to write code which is understandable 
even to people with very little experience or to yourself after not 
coding in Python for years. Nobody has to write such clear-cut code all 
the time, but at least it is possible with very little effort.


Christian
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Interesting gotcha

2011-03-29 Thread Christian Mascher

Hi,

I really like it that python allows me to write

if 10  x =  b:
...

impossible in many other languages.
But all things come at a cost:



  if x  y == True:



I think this is a real gotcha, because it might get you, because you 
_know too much_:

 if 4:
print True


True

So all things different from 0, '', ... are considered True by python.
But.

spoiler ahead ;-)
 4==True

False


Cheers

Christian
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] rewriting examples in python

2010-04-14 Thread Christian Mascher

roberto wrote:

hello, i found this very famous book
Turtle Geometry: The Computer as a Medium for Exploring Mathematics
(Artificial Intelligence)
by Harold Abelson and Andrea diSessa
and i was wondering if anyone of the turtle experts has ever rewritten
in python the logo examples in the book;

Nobody has answered, so probably not. Nevertheless I think its a good 
idea to try this. It will probably turn out to be perfectly feasible to 
do these examples in Python with the turtle module by Gregor Lingl. And 
a good exercise too. If you run into problems let us know.


--Christian


i am more interested in the turtle spirit than in the logo language,
so i'd like to use python directly along with the book itself

thank you very much in advance


___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] mathematics and language

2010-04-12 Thread Christian Mascher

Hi all,

thanks for your reactions. Just wanted to clarify a bit, although most 
of you seemed to have understood me quite well.



Sorry, I don't know J (Kirby does), but this is exactly the reason I prefer
Python. Readability counts (for me).


Of course this was a bit offensive, telling someone who is really in 
love with something (in this case J) that you're not that interested. 
Gives rise to some hard feeling.


Every teacher experiences this. I work as a teacher - I know how it 
feels, when students don't share your own enthusiasm. And they never 
semm to have good reasons ;-), just feelings.


Every teacher knows these questions: Oh, why do we have to learn this? I 
will never need this. What will we do next? When will we start with 
something different? Real students tend to ask these questions, 
communicating: This is hard stuff, I have other things on my mind I 
consider more important


And now sometimes I find myself in a similar position; although I 
consider myself a person who is constantly learning new things. But my 
time is limited and I can choose my interests now.


When I studied physics in university (got a diploma in physics, 5 years 
of study) I had chosen a subject with lots of maths (mostly together 
with the mathematicians), I really liked it. I like maths. But that 
level is esoteric for most other peaople and more scary: most of it is 
far away and esoteric stuff for me now, too.


Last week because I needed some space in my workplace I stacked away 
lots of university textbooks. In over ten years as a high-school teacher 
I never needed most of them, especially the highly mathematical texts. 
It was kind of sad, but I said farewell to them as I realized I would 
probably never in my life use them anymore. (I kept Feynman lectures 
though.)



This turns out not to be the case. The complete syntax table for J
consists of 12 lines. You are talking glibly about a topic on which
you have no information.


Thats how it is. I can't be an knowledgable in everything. So many 
things I can just talk about as an outsider.


In the past years I have taught myself Python, Java and Smalltalk in my 
free time together with OO-thinking, Linux,... . I have also looked into 
Scheme/Lisp a bit. Smalltalk was the most interesting experience, the 
famous syntax table on a postcard. But while Python is a tool I 
actually use, Smalltalk was considerably harder to get to grips with. In 
school we use Java (with BlueJ) in the upper classes. For my personal 
bio I decided to switch interests away from programming for a while.




And without a lesson? Do you believe that Python syntax is intuitive,
and can be guessed without a manual or lessons? In i., the i stands
for index. It is easy to learn, and reasonably mnemonic.


No, nothing is intuitive when you start from scratch. I can understand 
people who don't (want to?) learn Python, although I would always say it 
is useful and looks easy for me. But I had to invest there too.




% x is reciprocal of x, so o. % 180 is pi/180

Don't think that is very useful.




I meant: if I have a division operator then I don't have to learn about 
another special symbol for the reciprocal.



These objections are trivial and uninformed. You aren't a
mathematician, you don't like math and math notation, so there is
nothing more to say, except please stand out of the way of people who
can benefit from it and want it.


I don't stand in your way. Go ahead.

But I like math, believe it or not ;-).


Lost you there...
I put this in in remembrance of the late Arthur Siegel. Hope he doesn't 
mind... But he could have posted this.



LOL. Math notation is what mathematicians use, not schoolchildren.
They are constantly inventing more of it. What you call math notation
is known to mathematicians as arithmetic.

There is no standard math notation.


Every mathematician (person who creates maths) is free to invent the 
symbols he finds useful.


Still: I often think of mathematics as a language, at least as hard to 
learn as latin. You can use it to think (communicate with yourself) or 
to express your ideas in the most clear way for others to follow the 
reasoning.


Over the years some symbols have proven to be more useful than others 
(think of d/dx Leibniz versus Newton). Some symbols are just handy 
because they are more or less universally agreed upon (like the 
indo-arabic numerals, function names sin(), mathematical constants e, 
pi, ...). For starting to learn maths I have to teach pupils the most 
common vocabulary, and the correct way to express yourself. For 
instance: An expression carries no meaning if it doesn't contain a =, , 
 or !=. High-schoolers tend to forget that and write only one side of 
an equation

-p/2 +- sqrt((p/2)**2-q)
when they actually want to solve a quadratic equation. I have to correct 
this, because it is like a sentence without a verb.


Mathematics as a language is more than just the vocabulary. 
Mathematicians have 

Re: [Edu-sig] using Python as a calculator

2010-04-10 Thread Christian Mascher

Edward Cherlin wrote:

[sigh]

Do math tables in a math array language.

degrees =. i. 91  NB. 0..90

radians =. degrees * o. % 180

table =. |: degrees, 1 2 3 o./ radians


Sorry, I don't know J (Kirby does), but this is exactly the reason I 
prefer Python. Readability counts (for me). For creating a table, most 
people would probably use a spreadsheet anyway, but as I happen to know 
Python, I use it for such tasks from time to time. I can even remember 
the syntax without having used Python for months. Don't think that would 
be the case with J. Not very inclined to learn that.




where

=. is assignment
i. creates a list of consecutive numbers starting at 0.

Who on earth would think of that without a manual?
NB. is the comment marker 
o. x is pi times x

Why not pi?

% x is reciprocal of x, so o. % 180 is pi/180

Don't think that is very useful.

|: is transpose

Another very special symbol.

, appends an array to another. It turns a list into a table in order
to match dimensions.

Lost you there...

1 2 3 o. x gives sine, cosine, tangent of x
Why don't they use sin(), cos(), tan() like the rest of the mathematical 
world?

/ creates a table with the given function (o.) applied to two list arguments

The result is a 91 row, 4 column table of angles and trig function values.


Impressive ;-))

I can easily give you a short sequence of lessons leading to this
level, introducing some other arithmetic, transcendental, and
array-handling functions along the way, and a little more about
operating on functions to define new functions.


Python is much nearer to standard Math-notation, that is a good thing. I 
like to learn new languages - up to a point. I don't see the added value 
of J in this case.


Just my 2c

Christian

___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Progamming advice.

2009-04-08 Thread Christian Mascher

Hi Gary,

Kirby is right: this is what you should be looking at.

There's the design patterns literature, sometimes fun to just eyeball
so you get used to seeing patterns, even if different from the ones
described.


Some IMHO really good books on the practical aspects of software design 
with agile languages are:


Refactoring, by Martin Fowler. You have probably heard of this book.

Smalltalk Best Practice Patterns, by Kent Beck.
A set of rules how to write cleaner code (in Smalltalk). I like it, 
because it adresses little, practical aspects like appropriate naming 
(Role suggesting temporary variable name, , Type suggesting parameter 
name) which can be applied to Python-code (weakly typed like 
Smalltalk). I am not aware of a similar book for Python. Does anyone?


(Kent Beck also wrote a book on Test-Driven Delopment where he actually 
uses Python in the second part.)


HTH

Christian
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


[Edu-sig] [Fwd: Re: do as a keyword]

2007-12-12 Thread Christian Mascher


---BeginMessage---

Hi,

Brian Blais wrote:

I find that when teaching beginning programmers, they usually think in 
until terms, and not while terms.


do:
Forward()
until Touched()

and I have to explain to them that Python doesn't have until, and 
that the logic for while is exactly the opposite:


while not Touched():
Forward()

I must admit, this is one of those cases, where the PASCAL way is indeed 
just how beginners tend to think. I guess many of our students would say 
the same. On the other hand, the bigger problem is understanding 
condition controlled loops at all, so it is only a minor thing which you 
have to get over with when using Python.


If Python's main goal was to be the most beginner friendly programming 
language for the first x hours, then it should probably provide many 
more such constructs; PASCAL FOR-loop is also easier to teach to novices 
than Pythons list iteration on a range()-result.


Havin said that: more experienced programmers appreciate Python, because 
these possibilities don't exist. In the long run, it is easier for me to 
read code when there is principally just one way to do it. Perhaps it 
was a tiny bit harder to program the loop by using an entry condition. 
But as a reader, I only have to scan from top down, always only entry 
conditions, never exit conditions (except with a break, but then the 
exit condition is directly next to the break and I seldom use break.)


they find the while logic to be unintuitive, and I often find myself 
feeling the same way: crafting it with the until logic, and then 
reversing it.  Perhaps I should do as above, and do:


while True:
Forward()
if Touched(): break

but somehow that feels wrong to me, like bypassing the point of the 
while: all that power to check for conditions, and you just use it to 
check True, and then use a break inside.  It's readable, I guess, but 
not a programming construct I am immediately drawn to.


I liked your first way much better. Reversing the condition is very 
readable:


while not touched():
   forward()
# must have touched something to come here
doSomethingAtTheEnd()

Cheers,

Christian

---End Message---
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] interesting article about the future of user platforms

2007-05-04 Thread Christian Mascher


---BeginMessage---

Thank you for the link, Laura,

quite a long article, but he's got some really fresh ideas. It is always 
remarkable, when somebody can see what is _missing_ .  Top notch.




Christian


http://worrydream.com/MagicInk/


I rather like the site name, too. :-)

Laura Creighton
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig

 




---End Message---
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] An OOP view of the number concept

2007-04-22 Thread Christian Mascher
Hi Kirby,

3 .__add__(5)


3 .__add__(5)

8


Of course this still looks strange to people who grew
up in the 1900s (as I did) and think in a different paradigm.

In the old way of thinking, operations were not included
in our type definitions. The idea of adding was
somehow independent of the set theory definitions
(since dispensed with) of integers for example.


I still recall the moment, when - while learning some smalltalk (after I 
knew Python) - one expression really impressed me:
smalltalk
2 sin
/smalltalk
Because in smalltalk nearly all expressions are message sends of the syntax
receiver message
this would mean the same as
2.sin()
in a python-like-syntax. So 2 is an object, which you can ask to give 
you its sine-value. This is classical smalltalk-80.
Everything is an object means more to me since that moment.

It is interesting how they do this in smalltalk, for instance, you can 
easily put different kinds of number types on the left side- like 2.0 
sin gives you the same value for a float type.

Actually in Python, dot-notation breaks down with this case:
2.0.sin() ???
I just noticed that. Perhaps one of the reasons smalltalk doesn't use 
the dot.

Greetings

Christian


___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] An OOP view of the number concept

2007-04-22 Thread Christian Mascher
Hi,

 The way I look at it, Python ints and floats out of the box have a more
 limited repertoire than in Smalltalk apparently.

Limited for a reason, see below.

 Once we import math, then we get these external functions, which don't
 actually reach into the guts of the number type for an answer.  The
 native types are knowledgeable, but not omniscient (likewise with
 user-defined).

Right, so there is also a virtue in Pythons way of number-objects _not_ 
knowing about sin(): smalltalk's smart numbers only work, because 
everything (every method/function) is contained in one image; 
mathematical functions are methods defined somewhere in the Number class 
hierarchy of the smalltalk system. And you always have everything 
around, if you use it or not.

Contrast this with Python, where you start with a limited set of builtin 
functions and object types and import other stuff only when needed. You 
save your work with little files (modules) and use rather less 
ressources than a full smalltalk image. Much more lightweight approach. 
Certainly one of the most important reasons I prefer Python, even when I 
admire the uniformity of smalltalk objects: the granularity of module 
files and a small efficient runtime environment running fast enough 
everywhere.

Christian
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Arthur Siegel

2007-02-04 Thread Christian Mascher
Arthur wrote:

thank you all for listening.

Art
  

Thank you, Arthur. I will miss you on this list, too.

Christian

___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] suggestions about turtle.py

2006-03-01 Thread Christian Mascher

Hi all,

some years ago I had to teach using a macintosh lab: due to some 
problems with Tk on mac there was no Idle (and no turtle.py IIRC). That 
was when I realized how useful the batteries included Idle (-n) 
together with the old turle.py really was for me. It is my standard 
graphics package.

I once used it to demonstrate the adding up of arrows for physics 
(arrows representing sine-waves with different phases like from a 
grating): you could script this from idle and look at the different 
resulting amplitudes for different angles (arrow spirals curling up or 
not). Physicists will know what I mean. A Turtle was exactly the right 
tool to do this.

As a quick way to introduce loops etc. with visual feedback the turtle 
has always worked out well in my (school) classes: ages 15-17.

I also like it that the old turtle.py lets you decide if you want to do 
it procedural (module-level functions) or OO-like. And if you want to 
hide the things you don't need or rename methods etc. just implement an 
appropriate intermediate module with your favorite settings and put it 
in the pythonpath for the class to import:

# ooTurtle.py
from turtle import Pen
class Turtle:
def __init__(self, mycolor='black'):
self._pen=Pen()
self.color(mycolor)
def color(self,*args):
self._pen.color(*args)
...

So dir(Turtle) will only show the methods you explicitly put in there. 
And you can have the names that you want.

Gregor Lingl wrote:
 
 In the meantime (and looking forward to preparing a second edition
 of my book) I've been working on a new turtle graphics module - I named 
 it Xturtle.py.

BTW, I like your book.

 1) I submit my Xturtle.py module along with a set of 10+ demo samples.
 I've zipped them into a package and I'll try to submit them as
 an attachment in a separate follow up posting.

Great stuff.

  Moreover let's remember, that
 turtle graphics was invented to teach programming to very young people.
 So let's do it in a way, that interesting things can easily be done with it.

Still: young could be quite old. I still like to play around with 
turtles...

 (a) How about compatibility? Should every old turtle program  be 
 executable with the amended module? Remind that there is some
 strange behaviour in the old module concerning fill. IMO it should be 
 discussed if the radians-mode in turtle.py should be retained. (Is it 
 really useful?)

As I could rename methods (i.e. to German) anyway, backwards 
compatibility isn't that important. I just need to find the things I 
need. Fixing things to go with a new turtle-module shouldn't be 
difficult. But there should always be an Out-of-the-Box turtle in the 
standard installation.

 (c) I'd propose to add a sort of TurtleCanvas class to the turtle 
 module. 

Seems reasonable to me.

Just my 2c.

Cheers

Christian

___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Programming in the Classroom

2006-02-26 Thread Christian Mascher
Hi Kirby,

 Given this is 8th grade, I look at it as first exposure or a first pass.
 Some stuff will go over their heads, some will stick.  It's not necessary
 that they be complete masters of everything they see.  I think a lot of
 education is previewing.  What I dislike about most math curricula is how
 it's taboo to look ahead and see where we're going.
Looking ahead is an underdeveloped strain in most curricula, I'm sure. 
It's partly in the (traditional use) of the word curriculum: a path from 
a defined outset to a  well-defined goal.

Given limited time and the pressure of written examinations teachers 
tend to shorten those interesting but time-consuming overview sessions 
in favor of more exercises (at least it happens to me often enough, 
learning _my_ lessons as a teacher, sigh).

Another thing: Only an expert will be able to do a meaningful preview, 
so it's a lecture which mainly reaches the more interested students (who 
will appreciate it and learn from listening) but leaves the rest with 
nothing to _do_. So I don't think it is a taboo that these connections 
with future themes are understressed. It is just hard to do this right 
for larger audiences (classes).

Still, I think you are right: It is a good thing to (quietly) stick in 
more than the linear curriculum stuff, even things which will go over 
their heads. I _am_ doing this here, for instance using the words 
'object' or 'method' without explaining it, only introducing a 
vocabulary through usage.

On the other hand, I want to have a very clear picture in my head of 
_those_ ideas which will be spelled out step by step and which will be 
in the tests.

 I understand the Sony robot dog has Python bindings but have no details.
 Sony should send me a sample.  :-D

If they send samples, I want one too... ;-))

 I started out talking about types e.g. type(2), type(2.0) and
 type('hello').  Thinking in terms of types makes plenty of sense, because
 what Python provides is an extensible type system i.e. you get the
 primitive types out of the box, then you build your own, adding to the types
 ( = classes) available.

Having looked at smalltalk (squeak) a little in the past year: in this 
aspect Python is not nearly as uniform (difference between primitive 
types/user classes) as smalltalk is. I understand that much work is 
going on to address this issue...


 I use a projector, boost IDLE to like 20 point (Comic Sans
 these days) and have kids follow along at their own workstations as I
 doodle i.e. write simple functions and stuff.  Other times I hand out
 stuff on paper and walk around the room, helping where needed.

I often use the projector in exactly the same way (apart from the Comic 
Sans, will try that out next time)

 I continue to think programming is a very motivating way to get into
 mathematics.  
Yes. And Python together with Idle (doodling up functions) is a 
wonderful tool.
 In the pre-college years, I wouldn't be unhappy to see
 programming move into the foreground.  To make it sound radical and provoke
 anxiety, I'd say my position is:  drop math completely as traditionally
 taught, and teach computer science instead -- but in a different way that
 preserves most of the old math content (plus adds a lot of new stuff).
I could imagine that, too. But in a centralized school system it doesn't 
look like anything like this is going to happen here soon.

  A
 less radical position:  offer this as an alternative track running in
 parallel and let it compete with traditional math.  That's actually a
 crueler option (means slow death of traditional math vs. a quick transition
 to these better methods).

In our system pupils are obliged to choose an optional subject (with 3 
lesson-hours a 45 min per week) in grade nine and ten. This can be 
another foreign language or a combination like biology/chemistry or 
maths/computer. The latter is chosen rather often with different 
motivations:
a) I like playing around with computers ('cause I like computer games) 
and it sounds less dull and less hard than, say French
b) Computers will be important in a later professional life (often the 
parents' view)
c) I like maths and want more of that
So some have this on top of their regular maths-class (also 3 
lesson-hours per week). Although many have chosen it with motive a) 
rather than c) I think one can say that all profit from getting exposed 
to more maths. (Nearly all of them will go on to high-school-level 
later, where maths (calculus, vectors, probability) is obligatory for 
everyone.)

I can't help but think that 3 weekly lesson-hours (from around 32) for 
maths is not enough. The German system has always promoted _many_ 
different subjects at the same time on the grounds that only general 
education is the goal of the schools. I liked this as a pupil (with many 
different interests). But as a teacher I feel that today just too many 
pupils get only very superficial bits of knowledge here and there. 

[Edu-sig] Elementary School Instruction

2005-06-09 Thread Christian Mascher

 I am winding up my first year as a high school technology teacher, after 20+ 
 years as an engineer and programmer.  I teach 10th graders (ages 15 or 16) 
 in a magnet high school for kids interested in medical careers.   

I think your experiences are quite normal, so don't be frustrated.

 So the idea that much younger kids are grasping syntax like 
 this:
thewords = {'noun1':'house', 'noun2':'mouse'}
print In this %(noun1)s there lives a %(noun2)s. % thewords
 makes me weep in frustration.  

No, you shouldn't. You can't expect this from most children I know of. 
This requires a lot of abstract thinking, which is based on lots of 
experience and having seen this again and again. What you and I can 
read in code is so different from a beginners view, we probably can't 
imagine it.

Working with 15/16 year olds (the 'normal' ones with little formal 
training in math/programming), it does help very much to stick to a few 
restricted environments  as
turtle programming
simulations with random()
and doing lots of exercises with apparently little changes to the 
algorithms. We tend to be to fast at this stage, because Python is (for 
aus) so easily readable.

The problem might be that students appear to get bored. But it won't 
help to go faster if you haven't built up some solid ground, be it very 
simple algorithmically. Turtle-Graphics helps a bit with the motivation ...

Loops are not easy for beginners. Still the turtle or Robot helps, 
because you don't have to dicuss variable assignments at this stage, 
which actually _is_ a separate difficult subject.

Look at the heaps of exercise the TeachScheme Project uses for solving 
absolutely simple programs in the first chapters. They know why the do 
it this way.

I guess, I'm a bit frustrated myself that I have no Kings Way to teach 
programming faster, when I see so many possibilities to solve problems 
with Python myself.

Christian

 So, my question is, if you wanted a group of certainly-not-stupid 16 year 
 old kids to at least get a taste of programming, understanding that many of 
 them are there because it's a required course, and they're not predisposed 
 to be interested in it, what would you do?  What is a minimal set of things 
 they ought to be exposed to?  How much time would you spend on it?  What do 
 you think they ought to be able to do at the end of the time?

___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


[Edu-sig] How do I import from __future__ at startup?

2005-02-27 Thread Christian Mascher
Hello all,
I managed to do this once, but I forgot.
I want division always to be imported from __future__ at startup.
Putting
from __future__ import division
in a file sitecustomize.py doesn't work (which I think is 
counterintuitive). Do I have to use PYTHONSTARTUP variable? Is there any 
way at all?

I searched google and python.org but didn't find a quick answer to this.
Perhaps somebody can help me out?
Thanks,
Christian
___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig


Re: [Edu-sig] Naming in Python

2005-01-29 Thread Christian Mascher
Arthur wrote:
Python is a naming language.  The interpreter is working with assigned
names of objects more directly and more significantly than in other
languages (of which I am aware). 
 I can imagine of one, see below.
As a programmer, one is conversing with the
interpreter by way of these names, as names and objects are closely bound.
You mention two special features:
1. Every variable is _always_ just a pointer/reference to an
individual object. So most of the time you don't even have to think of 
this level of indirection. And you can assign just about anything to a name.

2. Live objects can be examined on the spot in the interpreter.
You don't have this in compiled languages. Interestingly instructors in
Java seem to like this feature , too. When the language doesn't provide 
for it, you need an intermediate (interpreter-like) program to simulate 
the experience. Take the BlueJ-environment, where you can manipulate 
objects in a comparable way (or even through uml-editors and such).

Still, this is not only a feature of the language as such, but also of 
the environment or the tools you use together with the language. It's 
not being interpreted alone, it's the IDLE-shell (rather than the simple 
command-line), the dir() function, the always accessible module code, 
documentation close to the source and the flexibility in assigning names 
whenever you want to.

I have found one language which is very similar to Python in respect to
the two mentioned characteristics and that is Smalltalk. The
variable-concept (everything is an object, every variable a pointer), 
and the live environment-approach to programming are both going back 
at least as far as Smalltalk-80. (Didn't Guido mention Smalltalk as one 
of his influences somewhere?)

I think both languages feel very similar in this way. You can interact 
with live objects, change them in small steps, examine them (e.g. dir() 
in Python, inspect in Smalltalk). Programming is fun in both cases. Who 
needs .exe-files really?

Christian

___
Edu-sig mailing list
Edu-sig@python.org
http://mail.python.org/mailman/listinfo/edu-sig