| ||||||
| 5/16 |
| 2004/4/16-17 [Computer/SW/Languages/Functional] UID:13234 Activity:high |
4/16 So, here's a question. I'm learning Python, and it seems to me that it
includes a lot of the power of Scheme or Lips, with out the wierdness.
Would Python make a better introduction to CS language than Scheme?
\_ Dunno, why don't you just ask Ping, he taught a 61A style course
in python at Cal. He claims it was good. I still haven't yet
found a good dollar Return on Investment for the time I spent
using scheme. ping's URL : http://zesty.ca/bc/info.html -pst
\_ We had a similar thread on this involving sysadmins. If you
want ROI on your time, get out of CS and leave it to people who
want to be doing it. Go do banking or something. -- ilyas
\_ you seem to be forgetting all about systems. systems people
probably almost never use scheme per se, though granted,
competent ones probably make use of concepts/techniques from
the functional languages.
\_ Did you actually read what my objection was? At any rate,
plenty of 'systems' people use functional languages, if
not necessarily scheme itself. -- ilyas
using scheme. - pst
\_ Read Norvig's essay on python. Languages which don't understand
lisp are forced to reimplement it, badly. I find python a lot
less intuitive than either lisp or scheme. YMMV. -- ilyas
\_ Link? All I could find was Python for Lisp Programmers.
\_ That's the one. It compares python to lisp in various ways.
\_ Link? All I could find was Python for Lisp Programmers.
-- ilyas
\_ Agreed. What's so weird about Scheme? There are almost no
syntax rules in Scheme; the language is very self-consistent and
uniform. Python seems to have a lot of extra, unnecessary
syntactical baggage that doesn't improve language
expressiveness. I also can't understand why Python has such
crippled lambdas. As for the original question about it being
a better intro language than Scheme, until Abelson and Sussman
rewrite SICP to use Python, I'd say no.
\_ Well, yes SICP would be the problem. But imagine we're
in fairy land where SICP is available for EVERY lanugage...
in fairy land where SICP is available for EVERY lanugage...
\_ python sicp: http://www.ibiblio.org/obp/thinkCSpy - pst
\_ There's nothing really "weird" about Lisp. I don't understand why
people think Lisp is any "weirder" than Prolog, Eiffel, Modula-2
or any other language. Just because it's not an ALGOG derived
language doesn't mean it's more or less difficult to learn.
-- williamc
\_ Ok, I like prolog, and use it frequently, but even I admit it's
'weird.' It has a whole different programming paradigm all to
itself. -- ilyas
\_ I haven't used it much, but it seems to be a very or perversely
specialized kind of FP.
\_ Prolog is not functional programming, although you can sort
of think of it that way if you squint and don't look too
hard. Prolog programs are statements which are true, and
prolog flow of control is a proof search. I found I
couldn't really grasp prolog by just pretending it's scheme
without parens, you really need to think about statements
and proofs to program prolog well. -- ilyas
\_ You can write in FP so that all your functions return
boolean and the only operator you use is AND with early
termination. And then adjust the eval loop so it takes
falsehood as failure rather than falsehood.
\_ ... and you still wouldn't get prolog. You would
need OR, and cuts, and superlogical features of
prolog like setof. And you would need to implement
the non-local prolog failure (which to do properly
requires non-trivial messing around with exceptions
or continuations). Like I said, you could sort of
do it, but you wouldn't be a very good prolog
programmer. Doing prolog properly in FP would just
entail implementing a prolog interpreter.
Look at
\_ python sicp: http://www.ibiblio.org/obp/thinkCSpy - pst
couldn't really grasp prolog by just pretending it's scheme
without parens, you really need to think about statements
\_ There's nothing really "weird" about Lisp. I don't understand why
people think Lisp is any "weirder" than Prolog, Eiffel, Modula-2
or any other language. Just because it's not an ALGOG derived language
doesn't mean it's more or less difficult to learn. -- williamc
requires non-trivial messing around with exceptions
stuctures is pretty odd. As Norvig points out "Python seems to be
easier to read than Lisp for someone with no experience in
and proofs to program prolog well. -- ilyas
http://www.bushong.net/david/comparisons/powerset.html
or continuations). Like I said, you could sort of
do it, but you wouldn't be a very good prolog
programmer. -- ilyas
\_ Oh, I don't know, the whole pair/cons/list way of building data-
and think about why the prolog is algorithmically so
different from the others. -- ilyas
\_ Oh, I don't know, the whole pair/cons/list way of building data-
either language."
\_ I can agree with that. Lisp's parentheses explosion is not
as easy for me to read anyway. Personally I found Ruby to be
very easy and elegant, although the block-passing syntax
can get a bit odd. It has very easy-to-use classes
\_ Ruby is closer to smalltalk than Python.
\_ Oh, I don't know, the whole pair/cons/list way of building data-
stuctures is pretty odd. As Norvig points out "Python seems to be
easier to read than Lisp for someone with no experience in
either language."
and objects too, unlike scheme. Python's a bit messier but
has the same stuff (Python's "len()" bothers me.)
stuctures is pretty odd. As Norvig points out "Python seems to
be easier to read than Lisp for someone with no experience in
either language."
\_ I can agree with that. Lisp's parentheses explosion is not
as easy for me to read anyway. Personally I found Ruby to be
very easy and elegant, although the block-passing syntax
can get a bit odd. It has very easy-to-use classes
and objects too, unlike scheme. Python's a bit messier but
has the same stuff (Python's "len()" bothers me.)
\_ And processing lists (which is actually very intuitive
for anybody who has taken introductory set theory) is
somehow stranger than processing
while (<>) { if ( $_ ~=/foo/) { s/bar/baz/}}? I don't know
but it took me about 30 minutes to learn scheme, whereas
it took me a solid week to just learn the basics of C,
and another month to do something useful with it.
\_ are you replying to the right person? I mentioned Ruby,
not Perl or C.
\_ Personally, I think Smalltalk, which Python is closely based on,
is better than both Lisp or Python. Lisp has a lot of great things
but the problem is that there is no syntax to the language. The
human has to be the compiler (and, when debugging, the decompiler).
Dylan on the other hand...
\_ Ruby is closer to smalltalk than Python. |
| 5/16 |
|
| zesty.ca/bc/info.html Short Description This course will introduce you to the Python programming language from a design point of view , with an emphasis on practical ways to use Python to make your computer more useful to you. Youll learn about string processing, object-oriented programming, e-mail handling, and Web site scripting, while getting experience with good programming practices like code review, testing, debugging, and refactoring. Python is an interpreted, object-oriented programming language that runs on just about any popular operating system. It has very clear syntax, provides useful high-level built-in types, and comes with a large and capable standard library. It is often compared to other languages such as Perl, Tcl, Scheme, or Java. You should have done some kind of programming before taking this course. We wont spend time explaining what it means to program a computer, though well quickly go over basic programming ideas as part of introducing how things are done in Python. If youve taken a programming course before, the course probably taught Scheme if youre lucky, or Java, or C, or C if youre not so lucky. But do you ever write programs to save yourself time and effort, to get your computer to help you get things done? If you already write programs for yourself or, say, a website, you might find that Python works better for some purposes. If you dont program for yourself, maybe thats because its too much trouble to write programs, or to set up the language tools on your computer. Python will be a refreshing change: its one of the easiest languages to use, to read, and to learn, and yet it gives you a lot of power. I hope this course will give you a new level of control over your computer and open up a range of possibilities for you to use it in new and productive ways. If youve never written a program before, this course might not be for you. However, if youre technically inclined, keen, and willing to do some exploration on your own, talk to me about taking the course. I personally think Python is the best choice of a first language for most people who want to learn how to program. Writing a Python program is one of the quickest ways to get your computer to do something for you. The syntax is simple, which makes it much easier to read and write than many other languages. Ten lines of Python can often do more than 30 lines of Java or 100 lines of C. Scheme might be able to express more in ten lines than Python can, though most people would find Python easier to read than Scheme. Python comes with a library of useful tools to take care of many common tasks, like downloading files or handling e-mail. Lots of people use Python, even though it isnt marketed as heavily as Java or as widely known as Perl. Python is used extensively in many places , including Google, Yahoo, Infoseek, NASA, tons of startups, industry research labs, and national research labs like LANL and LLNL. Ive been using Python for a while now, and gotten to be friends with some of the nice Python folks . Please feel free to write to me with any questions you have about the course. Enrollment There are two sections, one for lower division and one for upper division, but theyre the same course. In order to enroll, you must fill out the online survey and you must attend the first class . Prerequisites You should have done some sort of programming before. If you havent, but youre really keen, have a technical mind , and an appetite for tinkering , talk to me about taking the course. If you arent already comfortable with using a text editor any editor is fine or installing software on your computer, then this course probably isnt for you. You will need to have a computer, or access to a computer account on campus the OCF provides free computer accounts for Berkeley students. We wont require any special tools beyond Python and a text editor. Course Goals Python is good for writing programs for yourself , and for other people . By the end of the course: You should be able to make your computer more useful to you, by automating simple tasks with Python programs. You should be comfortable having other people look at your code, and comfortable looking at code written by others. Meetings Well meet weekly on Wednesdays from 4pm to 6pm in 320 Soda Hall. I really want to encourage you to get used to looking at code, so well spend the first part of each class reviewing and discussing everyones work, and then the second part of the class teaching new material. I realize it may sound a little scary to have everyone looking at your work. Dont let that frighten you: I want you to get used to the idea because thats what happens in real life, and come to be proud of what you write. Each assignment will be due at 6 pm on the Monday after it is assigned so that there is time to have them graded before the next class. All of the work you do will be posted on this web site for other students to look at. The idea is that youll have all weekend to do the assignment, Ill get them and post them on Monday, Ill grade them on Tuesday, and youll have a day if you want to look at everyones work before class on Wednesday. There will also be a final project, which should result in a program that you can go on using after this course is over. Ill suggest some topics for final projects, but theyre only ideas; I will be looking for project proposals from you by the eighth week of class March 12. Grading Every assignment will get two grades : one for correctness, and one for readability. |
| www.ibiblio.org/obp/thinkCSpy -> www.ibiblio.org/obp/thinkCSpy/ Downey , Jeffrey Elkner and Chris Meyers Printed copies now available from Green Tea Press . |
| www.bushong.net/david/comparisons/powerset.html Programming Comparisons: Power Set Programming Comparisons: Power Set Problem: give the smallest possible complete subroutine/function/method definition in a language of your choice which, when called with a list, array, whatever, returns the power set of that list. It may be in any order, but must not contain duplicates. |