Hello! Well. I was asked to introduce myself and here is my informal self-introduction in the aspect of this SIG. As I hope to stay (at least lurk) here for long. Two years ago I conducted a class in a 10-11 forms (in Russia, these can be called "higher school" forms). And for no apparent reason I chose Python to do programming. (At that time I had no exposure to Python. I even thought, it was a kind of LISP or Schema or similarly AIsh.) I used Perl to do admin/text processing task, C for other small things. I learned Python for the purpose of teaching only, but it occured to be so magically powerful and attractive, that now (I changed jobs since then) it my primary language for most tasks. However, I was always interested in the teaching programming and it always intrigues me how one become a programmer. Yesterday you can't program, and today you feel, that you can! I can't tell that those programming classes were full success, but nevertheless, I made some observation of what young people expect from the CS/programming teacher. And I must tell you that I heard a lot of things like: "Why not {Delphi, Java, Pascal, C++}" from my pupils. Those usually did not understand what programming is about. On the contrary, those who listened made more progress. They were open to new ideas (not just their maximalist views) and were very supportive of what we did. * Really, I don't know why I am here. Probably, I want to listen to more stories (cases) and find something similar or dissimilar. But one thing I am very strong about: if we need to teach somebody programming, the Python is the choice No. 1. (Well, probably it depends on the age. For little-ones Logo is probably the choice or some special adopted environment). But for those who want to learn programming Python is very-very useful. (It's hard to switch from it to other languages, though ;-) But in schools we do not need to prepare programmers. It's all about development in the minds... OK. I joined this list as I feel that this direction could be forgotten, SIG closed, etc. IMHO, Python's one of primary goals is to be excellent for teaching programming. In today's school we are drifting more and more toward "user skills" (worsprocessing and such mouse-moving behaviour). This is what bothers me too, as I think those who is capable of programming need to have tools to learn and get successful results. This raises their IQ ;-) and improves understanding of life, whereever they will work. Still I do not see what can be done to the situation except with promoting Python to the advanced users and teachers. Unfortunately, I am no more in position where I can influence this process here (I worked in the teacher's retraining institute's IT center), so probably my presence here will not be too visible (I do not have much time to do something real, usually I just generate lots of ideas ;-) I read some of the archives. Probably I could add something later to share with others. (I am also a participant of Seul/EDU (Simple End User Linux, educational aspect. Python Edu-SIG /\ Seul-EDU != []. And a moderator of relcom.education newsgroup. So, if there are some need to communicate some ideas/offers/questions/queries with the later, you can ask me. I will try to translate it into Russian and put it into there. In fact, in the near future I want to prepare an "advertizement" of Python (and free software) for relcom.education. That is why I also want to listen here. Wow. It was quite lenthy explanation! (I do not have a web-page, at least updated less than 4 years ago ;-) Sincerely yours, Roman Suzi -- _/ Russia _/ Karelia _/ Petrozavodsk _/ rnd@onego.ru _/ _/ Friday, May 04, 2001 _/ Powered by Linux RedHat 6.2 _/ _/ "A program without bugs is obsolete." _/
In a recent thread, we were looking at source code for doing polynomial expressions, with both a symbolic and number crunching aspect. Thanks to Brent, the polynomial quickly became an object, which allowed for operator overloading of multiply, add, subtract and power (but not divide). Example usage:
from polynomial import * p1 = Poly([1,2,3]) p2 = Poly([2,0,0]) p1 x**2 + 2*x + 3 p2 2*x**2 p1*p2 2*x**4 + 4*x**3 + 6*x**2 p2(10) 200 p1+p2 3*x**2 + 2*x + 3 p2.deriv() 4*x
I think such source code is illustrative of a genre I'd call "throwaway code". In the old days, time on computers was hard to come by, programming was more difficult and for the highly skilled, and so if you had the opportunity to write some code, the economics of the situation often dictated that you do so "for the ages". In other words, your end-user was someone you maybe will never meet, but because you've written a set of FORTRAN functions for manipulating matrices, and put them in a library someplace, along with documentation, that end user will be able to take advantage of your precious skills (and FORTRAN's power). Given your code might get pulled in by some larger system in charge of monitoring nuclear power plants, or launching a rocket, it'd better be robust and full of error trapping -- make your code as bullet proof and "ready for anything" as possible. That's the opposite of throwaway code, and the need for it hasn't gone away by any means. We all depend on such robust, archived, documented and (if we're lucky) open source assets at every turn. On the other hand, computer time is now very cheap, programming is relatively easy, and it's no longer anti-economic to write code with primarily one end-user in mind -- oneself. It's more of a scratch pad approach. You scribble code as you would math notations to perform a calculation, with the added benefit that your module is more easily saved and re-run later. simplematrix.py is another example of throwaway code. It looks a lot like polynomial.py in that it contains essentially one list of data, and overrides * ** + and -. No determinant or inverse here [in the works]. This is not a commercial grade module, optimized for speed, and generic enough for any end user. It's more illustrative of the kind of thing a student could whip out in a relatively short time. Example usage:
from simplematrix import Matrix a = Matrix([[1,2],[3,4]]) a [1, 2] [3, 4]
b = Matrix([[-1,0],[0,-1]]) b [-1, 0] [0, -1]
a*b [-1, -2] [-3, -4]
a**2 [7, 10] [15, 22]
a+2 [3, 4] [5, 6]
"Math through programming" is very tied to this "throwaway code" concept, because the focus is on the math, the mathematical concepts, and not on all the claptrap that makes a program commercial grade and ready for prime time. We don't assume an anonymous and/or naive and/or malicious end user who might keep passing illegal arguments. We don't necessarily optimize for speed (which might mean coding in C and using Python as a front end) because our goal is transparency: it's more important to be able to see/read the code and understand what principles it embodies. We therefore to use "pure Python" whenever possible. One thesis I've advanced at my website is that the computer science notion of "object" is going to percolate more and more through math world, such that we'll be spontaneously thinking of polynomials and matrices as objects (vectors, quaternions, sets, functions -- all are objects). One difference between a function and an object is that an object saves persistent state data internally. Functions are more "pass through" and the feeling you get is that data is out in some logical space, there to be operated upon by functions, but functions don't contain data, and data have no clue about functions. With objects, this changes: data is may be internal to objects, which is also where the functionality is contained. Instead of "functions working on data", we have "objects containing both data and functions, and working with one another". It may be a subtle shift, but I think one that's destined to affect mathematics, not just computer science. So in Python, using throwaway code, now that we have both Poly objects (polynomials) and Matrix objects, with no additional code, we can create some synergy: pass a matrix to a polynomial for evaluation, or populate a matrix with polynomials. This illustrates the power of objects, and why we might want to teach Python in complement with mathematics -- because it helps us conceptualize the math:
p1 x**2 + 2*x + 3 p2 2*x**2 a [1, 2] [3, 4]
# passing matrix object to a polynomial object p1(a) [12, 17] [24, 33]
# populating a matrix w/ polynomials c = Matrix([[p1,p2],[p2,-p1]]) c [x**2 + 2*x + 3, 2*x**2] [2*x**2, -x**2 - 2*x - 3]
c**2 [5*x**4 + 4*x**3 + 10*x**2 + 12*x + 9, 0] [0, 5*x**4 + 4*x**3 + 10*x**2 + 12*x + 9]
# passing a matrix populated with polynomials to a polynomial
p2(c) [10*x**4 + 8*x**3 + 20*x**2 + 24*x + 18, 0] [0, 10*x**4 + 8*x**3 + 20*x**2 + 24*x + 18]
Kirby Notes: polynomial.py http://www.inetarena.com/~pdx4d/ocn/python/polynomial.html (or .py) simplematrix.py http://www.inetarena.com/~pdx4d/ocn/python/simplematrix.html (or .py) Re: OOP affecting math http://www.inetarena.com/~pdx4d/ocn/oopalgebra.html
From: "Roman Suzi" <rnd@onego.ru>
Well. I was asked to introduce myself and here is my informal self-introduction in the aspect of this SIG. As I hope to stay (at least lurk) here for long.
Hi Roman Thanks for the intro.. I hope you stick around. You seem to be grappling with familiar problems.
However, I was always interested in the teaching programming and it always intrigues me how one become a programmer. Yesterday you can't program, and today you feel, that you can!
I feel that several times every day! Seriously.
But one thing I am very strong about: if we need to teach somebody programming, the Python is the choice No. 1. (Well, probably it depends on the age. For little-ones Logo is probably the choice or some special adopted environment). But for those who want to learn programming Python is very-very useful.
We all agree Python is great andlove it. But I question anyone who implies xyz god/tool/method is the #1. Everything and everybody has a context, needs, a past, a present and future. This raises some interesing isseus about 'suitability' of programming languages for kids [we are all kids] and how to get them going... CASE STUDY: 12-year old want to learn 'programming' WHY: - He's curious - Wants to impress his friends - it's the new rock'n'roll - Dreams of controlling everything in his home with wireless magic embdeded cyberware - Likes Flash animations/games and computer games and would like to 'program' some of his own - He's surrounded by a culture of MegaBudget 'computer' graphics Hollywood movies, and dreams of making a succesful career as independent computer whiz, and at the same time showing anyone [teachers especially] who ever doubted him: "See how smart I really was/am/will_be ?!" My nephew is 12 and really keen to get started on programming. His parents and school know next to nothign about any of this. So he's own except for the beautiful deep ocean of the Internet. I wanted to say PythonPythonPython to him, but he already had eyes for REALBasic [he hs an iMac since 1 year]. Last summer he asked me what I thought he should learn and what I thought about REALBasic. I said something to the effect of: "Languages and technologies come and go. 50% of why you select XYZ should be based on the vitality and quality if its community. Pay attention to the age of something. If it is dying..probably best not to invest much effort unless you are very confident. If it is too young, this is exciting but 'bleeding edge' is also very time consuming and can be frustrating to get things done. For beginners, best to find something which has been around for some time, is well supported and still very much growing. Like a healthy mature fruit tree..etc" Then we went on the web together and browsed around the REALBasic sites, looking at list archives, contributions, reviews etc. I showed them that the first thing you have want to know whenever you read a nice review is the truth behind it. So we looked at the mailing list. We scanned the subject headers tree to get a feel for what kind of dialogue, what depth of detail and support, what kind of problems people were having, and if they were gettign satisfactory answers. Look at some contributions. Anywy , after looking at REALBasic for a while, I came away pretty impressed. I said: "Yes this is not a bad place to start. Looks like fun. What you will learn here will be helpful. Later you will probably want to explore other types of programming and langauges. The most importnat thing is how to describe what you want, naming things, how to analyze problems, and match that with whatever tools you have. Know your tools and how to pick them and combine them well." The langauge environemnts I recommended were ActionScript in Flash5 [he's keen on Flash] , Lego Mindstorms [he's loves the idea of robotics], and of course Python. An important issues here is also that REALBasic is something he found out about for himself, and wants to try. This proabably comes from reading some enthusiatic reviews in a Macintosh Magazine. I showed him Jasonic Trick #T for quickly assessing any technology: http://www.google.com search for trouble <name of your perfect technology here> for example: trouble RealBasic or trouble Python or trouble outlook Try again with similar keys like "troubleshooting", 'Help!" I suggested wait a year till ActionScript has stabilized and the books and How-Tos are avaiable. [Summer 2001 this is now true. The new OReilly book *just* published. See some samples quotes at end of this email. I think Colin Moock writes a great introduction to programming. What do you think ..?] Lego Mindstorms is very cool but probably best tackled after getting comfortable with other prgoramming liek REALBasic or Python. He asked me what's Python. So we looked at Python together - in Pythonwin, and browsed online etc. I could see he was not ready for it and I was afraid I was going to lose him fast... All that Unix culture oozing through the cracks, mysterious intros that mention environment variables withuot explaing what the fuck they are and how to set them, dubious Mac support [getting better again with MacOSX coudl be much more Python friendly] no simple one-click executables without diving through lots in clever READMEs. This kids wants to progam something and end up with soemthnig which will work. A single binary object he can put on his desktop, a disk or email to friend, show his doubting teachers. Python does not encourage this, though it is becoming more and more possible. If it were bundled and installed everywhere on all systems, life would be different [and better]. Yes it is usually easy to download and install when you know how, but CP4E needs to figure the distribution politics better. ============================================================================
(It's hard to switch from it to other languages, though ;-) But in schools we do not need to prepare programmers. It's all about development in the minds...
Yes
In today's school we are drifting more and more toward "user skills" (worsprocessing and such mouse-moving behaviour). This is what bothers me too, as I think those who is capable of programming need to have tools to learn and get successful results. This raises their IQ ;-) and improves understanding of life, whereever they will work.
Yes.
Still I do not see what can be done to the situation except with promoting Python to the advanced users and teachers. Unfortunately, I am no more in position where I can influence this process here (I worked in the teacher's retraining institute's IT center), so probably my presence here will not be too visible (I do not have much time to do something real, usually I just generate lots of ideas ;-)
Well I believe Kirby's curriculum strategy is an essential step. http://www.inetarena.com/~pdx4d/ocn/ Even if everyone got hit by a very special RCrumb meatball today or next Tuesday, and said "OK! Wow - Let's start using nothing but Python for all our teaching from now on" Then they would have job #1 - figuring out how what and when and lack of curriculum. Countries who have embraced Linux as national OS policy and have ambitious plans active for computer education and network infsractucture are likely to be the move Python in the classrom from enlightened experiment to reality. South Korea for example.
(I am also a participant of Seul/EDU (Simple End User Linux, educational aspect. Python Edu-SIG /\ Seul-EDU != [].
And a moderator of relcom.education newsgroup.
Don't follow that. Thanks I'll look
So, if there are some need to communicate some ideas/offers/questions/queries with the later, you can ask me. I will try to translate it into Russian and put it into there.
Great.
In fact, in the near future I want to prepare an "advertizement" of Python (and free software) for relcom.education. That is why I also want to listen here.
cheers ./Jason REFERENCE READING for REALBasic and Actionscript ============================================================================ http://www.realbasic.com/ REALbasic : The Definitive Guide by Matt Neuburg Paperback - 660 pages 1 Ed edition (October 1999) O'Reilly & Associates; ISBN: 1565926579 http://www.amazon.com/exec/obidos/ASIN/1565926579/ref%3Dpd%5Fsim%5Felt%5Fl1/ 107-4909741-5694943 ============================================================================ http://www.moock.org/asdg/ sample chapters: What do you think of this as style/content for beginners? <quote> Chapter 1 - A Gentle Introduction for Non-Programmers I'm going to teach you to talk to Flash. Not just to program Flash but to say things to it and to listen to what it has to say in return. This is not a metaphor or simply a rhetorical device. It's a philosophical approach to programming. Programming languages are used to send information to and receive information from computers. They are collections of vocabulary and grammar used to communicate, just like human languages. Using a programming language we tell a computer what to do or ask it for information. It listens, tries to perform the requested actions, and gives responses. So while you may think you are reading this book in order to "learn to program" you are actually learning to communicate with Flash. But of course, Flash doesn't speak English, French, German, or Cantonese. Flash's native language is ActionScript, and you're going to learn to speak it. Learning to speak a computer language is sometimes considered synonymous with learning to program. But there is more to programming than learning a language's syntax. What would it be like if Flash could speak English-if we didn't need to learn ActionScript in order to communicate with it? What would happen if we were to say, "Flash, make a ball bounce around the screen?" Flash couldn't fulfill our request because it doesn't know what a "ball" is. Okay, okay, that's just a matter of semantics. What Flash expects us to describe is the objects in the world it knows: movie clips, buttons, frames, etc. So, let's rephrase our request in terms Flash recognizes and see what happens: "Flash, make the movie clip named ball_one bounce around the screen." Flash still can't fulfill our request without more information. How big should the ball be? Where should it be placed? In which direction should it begin travelling? How fast should it go? Around which part of the screen should it bounce? For how long? In two dimensions or three? Hmm...we weren't expecting all these questions. In reality, Flash doesn't ask us these questions. Instead, when Flash can't understand us, it just doesn't do what we want it to, or it yields an error message. For now, we'll pretend Flash asked us for more explicit instructions, and reformulate our request as a series of steps. 1. A ball is a circular movie clip symbol named ball. 2. A square is a four-sided movie clip symbol named square. 3. Make a new green ball 50 pixels in diameter. 4. Call the new ball ball_one. 5. Make a new black square 300 pixels wide and place it in the middle of the Stage. 6. Place ball_one somewhere on top of the square. 7. Move ball_one in a random direction at 75 pixels per second. 8. If ball_one hits one of the sides of the square, make it bounce. 9. Do this until I tell you to stop. Even though we gave our instructions in English, we still had to work through all the logic that governs our bouncing ball in order for Flash to understand us. Obviously there's more to programming than merely the syntax of programming languages. Just as in English, knowing lots of words doesn't necessarily mean you're a great communicator. Our hypothetical English-speaking-Flash example exposes four important aspects of programming: · No matter what the language, the art of programming lies in the formulation of logical steps. · Before you try to say something in a computer language, it usually helps to say it in English. · A conversation in one language translated into a different language is still made up of the same basic statements. · Computers aren't very good at making assumptions. They also have a very limited vocabulary. Most programming has nothing to do with writing code. Before you write even a single line of ActionScript, think through exactly what you want to do and write out your system's functionality as a flowchart or a blueprint. Once your program has been described sufficiently at the conceptual level, you can translate it into ActionScript. In programming-as in love, politics, and business-effective communication is the key to success. For Flash to understand your ActionScript, you have to get your syntax absolutely correct down to the last quote, equal sign, and semicolon. And to assure that Flash knows what you're talking about, you must only refer to the world it knows in terms it recognizes. What may be obvious to you is not obvious to a computer. Think of programming a computer like talking to a child: take nothing for granted, be explicit in every detail, and list every step that's necessary to complete a task. But remember that unlike children, Flash will do precisely what you tell it to do and nothing that you don't tell it do. Some Basic Phrases On the first day of any language school you'd expect to learn a few basic phrases ("Good day," "How are you," etc). Even if you're just memorizing a phrase and don't know what each word means, you can learn the effect of the phrase and can repeat it to produce that effect. Then, once you've learned the rules of grammar, expanded your vocabulary, and used the words from your memorized phrases in multiple contexts, you can reassess your early phrases and understand them in a richer way. The rest of this chapter will be much like that first day of language school-you'll see bits and pieces of code, and you'll be introduced to some fundamental programming grammar. The rest of the book will build on that foundation. You may want to come back to this chapter when you've finished the book to see just how far you've traveled. <quote> ...fast forward to ... excerpt from chapter sample online at: <quote> The "Objectness" of Movie Clips As of Flash 5, movie clips can be manipulated like the objects we learned about in Chapter 12, Objects and Classes. We may retrieve and set the properties of a clip, and we may invoke built-in or custom methods on a clip. Unlike other objects, an operation performed on a clip may have a visible or audible result in the Player. Movie clips are not truly a type of object; there is no MovieClip class or constructor, nor can we use an object literal to instantiate a movie clip in our code. So what, then, are movie clips if not objects? They are members of their very own object-like datatype, called movieclip (we can prove it by executing typeof on a movie clip, which returns the string "movieclip"). The main difference between movie clips and true objects is how they are allocated (created) and deallocated (disposed of, or freed). For details, see Chapter 15, Advanced Topics. Despite this technicality, however, we nearly always treat movie clips exactly like objects. So how does the "objectness" of movie clips affect our use of them in ActionScript? Most notably, it dictates the way we control clips and examine their properties. Movie clips can be controlled directly through built-in methods. For example: eyes.play( ); We can retrieve and set a movie clip's properties using the dot operator, just as we would access the properties of any object: ball._xscale = 90; var radius = ball._width / 2; A variable in a movie clip is simply a property of that clip, and we can use the dot operator to set and retrieve variable values: myClip.myVariable = 14; x = myClip.myVariable; Submovie clips can be treated as object properties of their parent movie clips. We therefore use the dot operator to access "nested" clips: clipA.clipB.clipC.play( ); and we use the reserved _ parent property to refer to the clip containing the current clip: _ parent.clipC.play( ); Treating clips as objects affords us all the luxuries of convenient syntax and flexible playback control. But our use of clips as objects also lets us manage clips as data; we can store a movie clip in an array element or a variable and even pass a clip reference to a function as an argument! Here, for example, is a function that moves a clip to a particular location on the screen: function moveClip (clip, x, y) { clip._x = x; clip._y = y; } moveClip(ball, 14, 399); Throughout the rest of this chapter, we'll learn the specifics of referencing, controlling, and manipulating movie clips as data objects. </quote> ============================================================================ ___________________________________________________________ Jason CUNLIFFE = NOMADICS['Interactive Art and Technology']
Excellent points re the intimidating side of Python, Jason. Having computers set up and ready, with a curriculum handy, is one thing. But trying to start from scratch and write canned apps you can share as compiled binaries is something else again. Kirby
On Wed, 9 May 2001, Jason Cunliffe wrote: hi!
Hi Roman
Thanks for the intro..
I hope you stick around. You seem to be grappling with familiar problems.
But I question anyone who implies xyz god/tool/method is the #1. Everything and everybody has a context, needs, a past, a present and future.
Of course.
CASE STUDY: 12-year old want to learn 'programming'
At this age kids are usually very "visually-inclined". They prefer nice, colorful pictures and interfaces to UNIX-like ones...
All that Unix culture oozing through the cracks, mysterious intros that mention environment variables withuot explaing what the fuck they are and how to set them, dubious Mac support [getting better again with MacOSX coudl be much more Python friendly] no simple one-click executables without diving through lots in clever READMEs. This kids wants to progam something and end up with soemthnig which will work. A single binary object he can put on his desktop, a disk or email to friend, show his doubting teachers. Python does not encourage this, though it is becoming more and more possible.
Well I believe Kirby's curriculum strategy is an essential step. http://www.inetarena.com/~pdx4d/ocn/
I'll look at it.
Even if everyone got hit by a very special RCrumb meatball today or next Tuesday, and said "OK! Wow - Let's start using nothing but Python for all our teaching from now on" Then they would have job #1 - figuring out how what and when and lack of curriculum.
Countries who have embraced Linux as national OS policy and have ambitious plans active for computer education and network infsractucture are likely to be the move Python in the classrom from enlightened experiment to reality. South Korea for example.
(I am also a participant of Seul/EDU (Simple End User Linux, educational aspect. Python Edu-SIG /\ Seul-EDU != [].
And a moderator of relcom.education newsgroup.
Don't follow that. Thanks I'll look
[the rest will be answered separately] Sincerely yours, Roman A.Suzi -- - Petrozavodsk - Karelia - Russia - mailto:rnd@onego.ru -
On Wed, 9 May 2001, Jason Cunliffe wrote: Hi Jason!
http://www.moock.org/asdg/ sample chapters:
What do you think of this as style/content for beginners?
<quote> Chapter 1 - A Gentle Introduction for Non-Programmers
Overall very nice! The first chapter is alittle too verbose to impatient. Usually it is not very comfortable to feed beginners with philosophy. Me too done it and it was not usually understood. It seems, deduction doesn't work for most students. Them can't deduce from common "philosophical" phrases practical implications. I looked into Contents at the web: its traditional for programming books. I do not know if RealBasic is strongly typed or not, but for Python I think the better approach is to learn functions early and probably not to make stress on data types. For example: ------------------------------- First: 0. Dialog with Python (...,calculator,etc) Second: 1. Hello world 2. Arithmetics (Numbers) 3. Functions 4. Strings 5. Conditions 6. Boolean logic 7. Loops 8. Comments 9. Lists 10. Text processing (regular expressions included) 11. Formatting output 12. Files Third...: Functional style Modular style OOP style Fourth: IDLE Fifth: Debug, optimization summarised ---------------------- One more point. Flash is about more visual art than text processing, for example. When I teached HyperCard we touched programming very gently, as an aux. tools. (Despite even the fact that I myself dislike WISYWIG) Sincerely yours, Roman A.Suzi -- - Petrozavodsk - Karelia - Russia - mailto:rnd@onego.ru -
participants (3)
-
Jason Cunliffe
-
Kirby Urner
-
Roman Suzi