{"slug": "program-with-paint-brushes-not-pencils", "title": "Program with Paint Brushes, Not Pencils", "summary": "A former high school computer science teacher argues that AI tools like Claude can generate code in seconds, but well-designed abstractions such as a Python PaintBrush class can motivate students to write code by hand, fostering creativity and self-efficacy. The teacher, who wrote the PaintBrush class in 2022 for his students, suggests that LLMs enable teachers to quickly create new engaging abstractions, making programming lessons more compelling than repetitive tasks.", "body_md": "# Program with Paint Brushes, Not Pencils\n\nIn 2022 while I was still teaching high school CS, I wrote a Python class called `PaintBrush`\n\nfor my students to use. This took 20-30 minutes on a Sunday afternoon with my laptop and a cup of coffee. Today, that code could be written by Claude in 20-30 seconds.\n\nIn 2022, my goal was to get students motivated with a lesson where their code could do something visual and fun. Today, this sort of lesson serves that same purpose and can help serve another: motivating students to write code by hand when an LLM could easily do it for them.\n\nLet’s get concrete and look at how the `PaintBrush`\n\nlesson worked.\n\n``` python\nimport turtle\nimport random\n\nclass PaintBrush():\n  def __init__(self):\n    self.t = turtle.Turtle()\n    self.t.color(\"black\")\n    self.t.width(3)\n    self.t.speed(6)\n    self.t.hideturtle()\n    self.randomness = 0\n    \n  def line(self, x1, y1, x2, y2):\n    self.t.penup()\n    def get_delta():\n      return random.randint(-self.randomness * 5, self.randomness * 5)\n      \n    self.t.goto(x1 + get_delta(), y1 + get_delta())\n    self.t.pendown()\n    \n    self.t.goto(x2 + get_delta(), y2 + get_delta())\n\n  def setrandomness(self, amount):\n    self.randomness = amount\n\n  def setcolor(self, color):\n    self.t.color(color)\n\n  def setwidth(self, width):\n    self.t.width(width)\n```\n\nWith this class, students could write code like:\n\n``` python\nfrom paint import PaintBrush\n\nbrush = PaintBrush()\n\n# Draws the letter C\nbrush.setrandomness(0)\nbrush.setwidth(10)\nbrush.line(-50, 100, -100, 100)\nbrush.line(-100, 100, -100, 0)\nbrush.line(-100, 0, -50, 0)\n```\n\nA `PaintBrush`\n\nobject works differently than the `turtle`\n\nclass that is so familiar in the history of CS pedagogy, allowing students to draw lines between specific coordinates in the plane. The `PaintBrush`\n\nclass is an *abstraction* for students.\n\nHere were the instructions I gave students after we reviewed the basics of the `PaintBrush`\n\ntogether:\n\nIn 2022, students wrote this code by hand, because there wasn’t another option. My hypothesis is that in 2026, students would be more likely to write code by hand for this lesson because of how easy it is to produce tangible results.\n\nIf lessons are repetitive, tedious, or overly prescriptive, I wouldn’t blame a student for generating code with AI. “Write a loop to print a multiplication table” should yield different student engagement from “can you use a concept we know to make 1000 lines in your painting?”\n\nThe specifics of the `PaintBrush`\n\nlesson aren’t as important as the overall concept. Programming is a tool for creative expression, and high-level abstractions allow students to engage with programming in different ways. If print statements are pencils in art class, abstractions like `PaintBrush`\n\nare, well, paint brushes.\n\nThe `PaintBrush`\n\nhere isn’t unique in being a “paint brush”. `Turtle`\n\n, `processing`\n\n, and `pygame`\n\nare all abstractions in this vein. However, any individual abstraction is not interesting to students for long. Your twelfth turtle drawing doesn’t “hit” with the same excitement as the first or second.\n\nBecause of the speed with which teachers can generate new abstractions with LLMs, we aren’t stuck pulling just from the existing menu. We can write code that lets students easily make music, data visualizations, photo filters, games, videos, etc.\n\nWith the right abstractions, I believe we can convince students to interact with the code itself without using AI as a shortcut. It doesn’t matter if an LLM could generate their code more quickly. Learning to program is about fostering a sense of self efficacy and pride in students as they create work that’s authentically theirs. We need every tool we can find to help students see that.", "url": "https://wpnews.pro/news/program-with-paint-brushes-not-pencils", "canonical_source": "https://blog.pickcode.io/program-with-paint-brushes-not-pencils/", "published_at": "2026-08-11 15:30:04+00:00", "updated_at": "2026-08-11 15:42:59.054850+00:00", "lang": "en", "topics": ["artificial-intelligence"], "entities": ["Claude", "Python", "PaintBrush", "Turtle", "processing", "pygame"], "alternates": {"html": "https://wpnews.pro/news/program-with-paint-brushes-not-pencils", "markdown": "https://wpnews.pro/news/program-with-paint-brushes-not-pencils.md", "text": "https://wpnews.pro/news/program-with-paint-brushes-not-pencils.txt", "jsonld": "https://wpnews.pro/news/program-with-paint-brushes-not-pencils.jsonld"}}