Re: [Edu-sig] Programming Exercises
Chuck Allison wrote: Hello edu-sig, Does anyone know of a good source of programming exercises/projects to use when teaching Python to people who already know another language? Solutions don't need to be available - I just need some good sample programming assignments. Thanks. You need to tell us what yu are interested in / would like to do. Do you want to find eigenvectors? Do you want to do GUI work? -- -- Scott David Daniels [EMAIL PROTECTED] ___ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
Re: [Edu-sig] Programming Exercises
Chuck Allison wrote: Hello Scott, Thursday, May 26, 2005, 1:55:15 AM, you wrote: SDD Chuck Allison wrote: Hello edu-sig, Does anyone know of a good source of programming exercises/projects to use when teaching Python to people who already know another language? Solutions don't need to be available - I just need some good sample programming assignments. Thanks. SDD You need to tell us what yu are interested in / would like to do. SDD Do you want to find eigenvectors? Do you want to do GUI work? Good question. Mostly I need general assignments (using sequences, mappings, text processing, basic OO, launching processes for testing, etc.), but also simple mail apps and basic COM (like processing Microsoft Word docs). No higher math. Some basic GUI ones would be nice too (will be using wxPython). Thanks! First, do the Python tutorial if you have not. Try following Dive Into Python if it meets your tastes. For text processing: Create or obtain a couple of plain ASCII texts. One should be short for testing and development, and another long for fun and production. Look to Project Gutenberg if you don't have anything long yourself. Make a concordance (words to position) that you can save and restore w/o re-counting your text. Find the N (50 for big) most frequent words used. Once you have all that working, figure out how to show all instances of a selected word in context. For extra credit, words, sorted by frequency or alphabetically (button selectable) presented on a wx window that show your word in context when clicking on a word. That should hold you for a day or two. --- My bias is to go test-forward, so (if you want to try that) here is a start (a first test to pass). Most of this is boilerplate, look at the body of test_words to see the only actual test here. Create a test_wordy.py file as so: import unittest from StringIO import StringIO import wordy # the module you are actually testing class TestWords(unittest.TestCase): def test_words(self): source = StringIO(a test) self.assertEqual(['a', 'test'], list(wordy.aswords(source))) if __name__ == '__main__': unittest.main() Now, when you run python on this file you will get a failure. The first one is that wordy.py doesn't exist. Keep fixing until your test passes. Then add tests for new behavior, watch them fail, and fix the source until it works. --Scott David Daniels [EMAIL PROTECTED] ___ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
Re: [Edu-sig] Lisping
It is fine and good to learn a single language, but this is not computer science. A single language is just a tool. It is necessary to learn several languages in order to have an idea of what computer science actually means. I believe that introductory computer science should be taught with more than one language. Certainly, teaching several languages poses its own problems. I believe two languages are just right for CS1/2 courses. My personal choice has been Python for CS1 and Java for CS2. In this way, students get familiar with the two principal programming language cultures: interpreted languages and compiled languages. My experience shows that students learn Java easier after having been acquainted with Python. Also, teaching CS1 with Python and then CS2 with Java allows one to cover more concepts (than by using only Java for both CS1 and CS2) namely because the two languages are so different. Different languages have different orientations, different tools, and different fundamental assumptions. I would want my students (indeed, myself) to be able to solve a problem/write a program satisfying particular criteria in ANY appropriate language, and also to recognize which languages are inappropriate for a given task. Prerequisite to this is knowledge and use of more than one language. Very well said, indeed. It can hardly be said better than this. Atanas Radenski mailto:[EMAIL PROTECTED] http://www.chapman.edu/~radenski/ Thinking is the hardest work there is, which is probably why so few engage in it -- Henry Ford ___ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
[Edu-sig] Python and OCaml (Was Lisping)
On Thu, 26 May 2005, Radenski, Atanas wrote: It is fine and good to learn a single language, but this is not computer science. A single language is just a tool. It is necessary to learn several languages in order to have an idea of what computer science actually means. I believe that introductory computer science should be taught with more than one language. Certainly, teaching several languages poses its own problems. I believe two languages are just right for CS1/2 courses. My personal choice has been Python for CS1 and Java for CS2. In this way, students get familiar with the two principal programming language cultures: interpreted languages and compiled languages. Hi Atanas, Rather than contrasting languages based on compiled vs. interpreted, I think a comparative course based on the treatment of types would be interesting. I've always been curious; has anyone heard of an approach that uses Python and OCaml? The two languages have such a different take on the value of typing; Python does type checking at runtime, and OCaml at compile time. ___ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
[Edu-sig] An somewhat stale article about using Java for introductory programming; what can we as Python educators learn from them?
Hi everyone, [Warning: I guess I ramble and rant here a bit. My apologies!] I picked up an interesting (if outdated) article on the Use of Java as an Introductory Programming Language: http://www.acm.org/crossroads/xrds4-4/introjava.html It's written in the 1990's, so some of the comments are not relevant, but a surprising number of them are still quite pointed. Here's the jist of the article: Georgia Institute of technology switched to Java for their courses because: 1. They were concerned that Pascal wasn't up to date with current programming practice. 2. Java provided OOP, garbage collection, and exceptions. 3. Java was more marketable. They ran into the following problems: 1. Input and output routines in Java were hideous. They got around this by providing their own library. 2. Java error messages weren't helpful. They rewrote the error messages themselves to suit their students. 3. Students found it easier to plagerize, given the popularity of the language. 4. Introductory books were scarce at the time. 5. The division between primitive types and the other data types was difficult to explain to new users. 6. There was a high initial overhead due to Java's scaffolding code. (public static void main(String[] args) { ... }) The authors argue, finally, that the particular programming language chosen really isn't a factor, but that: 1. Teaching good design (modularity, coupling, abstraction, etc.) 2. Showing iterative program construction in the classroom were really more important. This I agree with, and thought the mention of Eductional Software Process (ESP), to use industry best practices, sounded very relevant, much like the introduction of unit testing as an educational technique. Yet... I know I shouldn't think this, but the tone felt a little half-hearted, considering that the author had just finished describing the factors that they said hampered their student's understanding of the system. I just found it sad that the majority of the article focused on all the problems Georgia Tech instructors ran into, but then again, it's easier to point out failures than successes. A lot of the cons in the problem section above are points in favor for Python, but there are some things that Python could benefit from. In particular, I thought Problem 2, on customizing error messages to make erroneous situations easier to understand, was a very interesting one. As I understand it, many of Python's error messages are hardcoded into modules and binaries. Would it be worth it to allow for easy error message customization through some external file resource? Last of all, I took a look at Georgia Tech's CS 1321 web page, just out of curiosity, and came with: http://www.cc.gatech.edu/classes/AY2005/cs1321_spring/ So perhaps language matters after all. *cough cough* ___ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig