Create pain points for material you want to introduce that motivate the need for abstraction and programming language features so that students realize the need for concepts before you introduce them.

  • The goal of these pain points is to get students to deeply understand the need for an abstraction or a programming language feature through fatigue of using less elegant instruments.

  • Example activity:

    • Provide students with a turn left method that turns 90 degrees counter-clockwise.

    • Ask students to implement turning right using the turn left method.

    • Students will eventually ask, "Can’t we just have a turn right function?"

      • By creating a pain point, students independently develop an understanding of the need for creating a method (a great example of abstraction!)

  • Other potential topics to create pain points for.

    • No looping construct: Have students repeat multiple lines of code without a looping construct.

      • This will be used to motivate the need for loops.

    • No function definition: Have students repeat common blocks of code without a function definition.

      • This is another way to motivate the need for creating a method.

      • Require a change to the common block of code change after it’s all over their program to really stress why having methods and not replicating code is a crucial feature.

    • No organized data structures: Give students unstructured data to motivate organized data structures.

      • This will motivate the need to having consistent, structured data types.

    More about this tip

    External Source

    interview with Eric Allatta.