Computer science (CS) has infiltrated nearly everything humans do — from our jobs and hobbies to the way we organize our homes and plan our vacations. Therefore, CS should be embedded in every subject, from science and literature and electives like art and design.
Precise and consistent practice in computer programming (CP) will help students construct cross-curricular knowledge in tandem with both academic and CS concepts and practices. As CP is the process of writing a program from start to finish, students receive exposure in the amalgamation of practices 3-6 found in the K-12 Computer Science Framework.
So, how can we successfully engage students in CP? Here’s how we can do so in four major steps.
Step 1: Identify the problem
When students are new to CP, we typically start teaching them how to program and code using tutorials. Although there’s nothing wrong with that, we don’t want to keep them there.
Usually the writer of a tutorial has already identified both the problem and the solution of the program. The best way for kids to learn is by writing their own problems and solutions and creating their own programs. Otherwise, they will focus more on learning to code specific functions in a particular language, which is generally no different than rote memorization, which should be replaced with the development of working memory.
Identifying (or defining) the problem is the most critical part of the CP process as students will need to develop a concrete plan for what their complete program will do. This process involves identifying both the known inputs (or given data) and what is to be obtained via outputs (the result). Although CP isn’t a simple process, consistent and precise practice will build student confidence over time in articulating the details on the kind of input, processing and output desired for their programs. To get students started in programming, read this great intro to a lesson for building and sharing apps by Code.org.
Step 2: Find a solution
To find or plan the solution to the problem identified in Step 1, students can either create a flowchart or write pseudocode. Experienced programmers can and will use either of these methods to convey program development to clients, teachers, etc.
A flowchart is a step-by-step solution to a problem that uses a pictorial representation of the direction of the program and consists of arrows, boxes and other symbols that represent actions (i.e., input/output, process, etc.). Pseudocode is similar to English and is used to convey the solution with more accuracy than in plain English — but with less meticulousness required by a formal programming language.
The solution process enables the programmer to focus on the logical flow of the program without having to adhere to the actual syntax used by the programming language for the project. Check out this fun Technovation lesson to help your students plan their code.
Step 3: Code it
Often coding is confused with programming, but coding is just one part of the programming process. Good coders can create instructions from the solutions (discussed in Step 2) and write them into code for the computer to understand. This is where the algorithmic design skills from computational thinking come into play.
It helps when you think of your problem as a math problem, not because you’re always doing a lot of math while programming, but because the thought process is the same. In mathematics we often use algorithmic sets of instructions that we follow in a sequence of steps to achieve a goal. That process is likened to both a well-detailed flowchart and code (in a specific programming language).
Practicing coding will help students understand that coding isn’t complicated when they learn how to think logically and in steps. Getting students started by writing simple programs will teach them how to give computers instructions, how computers actually work and that good coders aren’t vague and don’t skip steps. They will also understand that the code they write is processed (translated) by a compiler into machine language for execution.
For kids new to coding, I recommend starting with a visual programming language (VPL), which allows kids to describe their algorithms using illustrations and lets coders describe the process in terms that make sense to them.
Although there are several ways to get students started in coding, I highly recommend your entire school participate in an Hour of Code and also teach kids to code within the context of a STEM/STEAM design challenge.
Step 4: Test it
Testing in CP is a critical process used to determine the quality of a program and find bugs (problems). As a college intern, I was first introduced to testing and debugging of ActiveX Controls in the Visual Basic programming language. Although testing has different levels and will determine if programs work or don’t — working to find bugs for the software developers to correct was very powerful in helping me understand the quality of the programs I used every day and also the importance of updating them regularly.
Requiring students to present their work publicly, is an excellent technique for engaging and instilling in them the importance of the testing process for discussing and showcasing high-quality CS work. Again, the App Lab (in Step 1) is a great lesson and project for helping kids learn CP from start to testing.
CP for different grade levels
Computer programming can be taught at all grade levels. Here are some tools to use with various ages and levels of learners.
Grades 3-8: littleBits Code Kit
The code kit comes equipped with electronic building blocks and an app with coding tutorials, and is an excellent scaffold for teaching students the concepts of coding, light, sound and motion in the context of a design challenge or invention.
What I find most powerful about the code kit is the app because it helps users become grounded in basic coding principles. A good coder, no matter the language or coding experience, will need to understand the basics — like input/output, loops, functions, variables and also logic. Success always relates to developing internal self-mastery of the fundamentals. Like Dr. Stephen R. Covey, author of The 7 Habits of Highly Effective People, once said, “Put first things first.”
The code kit also works in conjunction with all of the educational resources an educator would need, including lesson plans, student handouts and alignment to the Next Generation Science Standards. Many of the resources were tested and developed by the littleBits Lead Educator Cohort of 2017 and as a proud member, I was very fortunate to have worked and learned with such a talented group of educators!
Grades 6-8: robotics
Getting kids started in programming is fairly easy. In my previous role as a curriculum specialist, we used the Lego Mindstorms robot as the intro. These were the steps we took in helping kids understand key concepts, as well as programming:
Learn the basics. Through exploring tutorials, they learned about motors, sensors, gears and other components.
Learn to program. The brick had six built-in missions, which enabled students to see how to make the robot move with motors and respond to touch or motion with sensors. As they became more accustomed to the built-in programs, they started making their own programs, using ROBOLAB programming blocks.
Connect to CS and STEM. We found that this helped greatly elucidate the concepts and practice of both pattern recognition and algorithmic design. And then, of course, lessons in CS and STEM, which included coding, force and motion, and design and technology. We also found that the VEX IQ Kit was great for similar purposes and we used both VEX and Lego, based on the different competitive events that our students participated in.
Grades 8-12: advanced robotics
I asked Tim for his thoughts on how teachers should proceed when moving kids from programming in a VPL to a C-based program like for VEX, and he said, “First, build relationships with your students, and then learn with them. Let them see you try and fail, and they will enjoy struggling through the process with you. Eventually, they will surpass you and become the teachers.”
Jorge Valenzuela is an education coach, author and advocate. He has years of experience as a classroom and online teacher, a curriculum specialist and as a consultant. His work focuses on improving teacher preparation in project-based learning, computational thinking and computer science integration, STEM education, and equity-based restorative practices. Jorge is an adjunct professor at Old Dominion University and the lead coach at Lifelong Learning Defined. His book Rev Up Robotics: Real-World Computational Thinking in the K–8 Classroom is available from ISTE. This is an updated version of a post that originally published on March 20, 2018.