News for hackers. Stuff that matters.
Re:Learn to program Python using a Logo-like turtle by edw on Thursday April 28, 2011 @02:40PM (#2494523)
This—as well as Logo, however fond my memories of it are—are a bad idea because turtles graphics are by nature imperative: you're programming exclusively for side effects.

What the world needs is an approachable version of a system like the image manipulation presented in Structure and Interpretation of Computer Programs, which takes a functional approach. (It may have only been in the first edition, but it is covered in the Hewlett-Packard videos.)

I'm not a functional programming absolutist, but experience has taught me to think functionally by default. The habit should be instilled in would-be programmers as early as possible.

Re:Learn to program Python using a Logo-like turtle by dpritchett on Thursday April 28, 2011 @05:44PM (#2495220)
I haven't finished SICP so I'm not sure which bit you're talking about, could you please point it out? http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html#...

All IO is inherently impure, right? At best you're going to be composing funtions out of smaller functions that implement your graphics desires.

How can you get around having e.g. a circle(radius, x-pos, y-pos, line-color, fill-color) function that draws per your specifications? There's no reason you couldn't implement that circle function using turtle...

Re:Learn to program Python using a Logo-like turtle by hendzen on Thursday April 28, 2011 @09:21PM (#2495961)
All the exercises and code in Section 2.2.4
Re:Learn to program Python using a Logo-like turtle by ronreiter on Thursday April 28, 2011 @08:58PM (#2495898)
I did not learn how to program using a turtle, so I don't know if it's the right way to go. But intuitively, it seems very simple, at least more than I/O.