Jorge Valenzuela
Computer programming in 4 steps

At the secondary level, core computer science (CS) concepts and practices are taught in courses typically within the information technology (IT) career cluster under the umbrella of career and technical education (CTE). However, CS concepts and practices are also increasingly being incorporated into academics and also electives (and are influenced by art and design).

No matter the discipline, creating computational artifacts is one of the core CS practices students should consistently experience to become better problem-solvers. Computational artifacts may include images, videos, presentations, audio files and computer programs.

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.

four 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.

Here are some popular VPLs:

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 KitThe 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:

  1. Build their robots. Practically every kid loved this part.
  2. Learn the basics. Through exploring tutorials, they learned about motors, sensors, gears and other components.
  3. 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.
  4. 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. For high school students who’ve already practiced coding using a VPL and either have or are mastering foundational programming principles, the next step is to get them coding in an industry sought-after programming language like JavaScript, Python, Pearl or C++. Luckily programming a robot like the VEX EDR gives high schoolers an intro to this valuable learning experience. Students programming the VEX EDR learn to use the ROBOTC C-based programming language and can see the effects of the code they write in real time by solving problems using the engineering design process.

I recently began learning to program the VEX EDR when I participated in an Engineering Design course training with the International Technology and Engineering Educator’s Association. It was there that I met and was partnered with Tim Oltman — the Martha Layne Collins high school teacher of the year. He and fellow teacher Shane Ware have considerable experience teaching kids to program robots for various VEX robotics competitive events and have won numerous awards in Kentucky.

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 educational coach and a graduate teaching assistant at Old Dominion University. He is also the lead coach for Lifelong Learning Defined, Inc., a national faculty of the Buck Institute for Education, a national teacher effectiveness coach with the International Technology and Engineering Educators Association (ITEEA) and part of the Lead Educator program for littleBits. You can connect with Jorge on Twitter @JorgeDoesPBL to continue the conversation.

Like