The best practices for teaching a coding class
Articles
April 28, 2022

Top tips for teaching programming

In 30 seconds...

As a relatively young discipline, the best ways to teach programming are still being investigated. We’ve gathered some top tips for improving coding education.

Coding education has increased considerably in recent years. A 2021 Brookings report found that 43% of high-income countries require students to be educated in Computer Science in primary and/or secondary school. For low-middle income countries, this statistic was only 5%, although 58% offer some kind of Computer Science education depending on the educational institution. As a relatively young discipline, the best ways in which we teach code effectively are still being figured out. We have gathered some key tips for teaching programming.

Know your audience

The most important factor in teaching coding is the who! Who are you teaching? Obviously, the manner in which you teach will differ vastly depending on your audience. From a group of third-year CS university students, supplementary self-paced business analytics courses to a K-12 class's very first programming course - there is no one size that fits all!

As coding is set to become a part of everyone’s future, the type of coders have diversified. Now, Computer Science courses are not reserved for the future software developers. In a previous blog post, we talked about the three types of coders and how they differ (read it in full here!): those coding to understand, those learning coding as a skill and those learning to code as a career. 

The first group are those who use coding to understand. These are learners who won’t work in coding-heavy job roles, but will require basic knowledge of coding. For example, a consultant in a tech company can use coding to understand their revenue models and risks. These novice coders will need to become familiar with basic coding concepts, as you have to start with the foundations. Beginners can easily get overwhelmed by the coding environment - downloading a program, installing packages and compiling and running the programming language are all necessary before you even start to code! These are very useful skills, but may be too much to grasp as a novice coder, who just wants to understand the basics of coding. A user-friendly environment lets students focus on the assignment at hand.  

The second group are those coding as a skill. This group will code regularly but alongside other skills. Examples of this are those in the applied sciences field - data scientists, analysts and engineers. This group applies their basic knowledge of coding in a specific domain. They should be familiar with domain-specific libraries and be able to write small scripts and programs to solve problems, create dynamic models or automate processes. As these coders grow more confident with programming, the environment should be usable outside of school or university, allowing them to improve and use their coding skills on their own time as well. This group also benefits from being able to use specialized libraries, as they are familiar with, but not restricted to, certain frameworks. 

The third coder group consists of those coding as a career. This group will code daily and learn to apply domain knowledge to build efficient and reliable software. They are proficient in multiple programming languages and paradigms, they can implement testing, organize code and deliver it to a high quality. Also, this group should be able to set up and optimize their programming environment themselves, whereas Group 1 will benefit more from a web editor. 

The type of coder you are teaching also influences what tools are most needed. Novice programmers benefit from fast feedback and a non-distracting coding environment, whereas more experienced coders need to use specialized libraries and tools, such as git. Figure 1 highlights some of the key assessment features that benefit each different group. 

Figure 1: Three types of coders and the tools they need
Learn how to effectively scale up your coding classroom.

Keep it simple

Our next tip is one for teaching novice programmers. Stick to one language, without any frameworks and in one simple programming environment! It’s far easier to get to grips with one than try to master them all. In the beginning, learning to code is a very daunting task that will have you close throwing your computer out the window. Keeping the initial instruction simple and clear is paramount to building students’ coding confidence. Introducing another language,framework or adding distractions like git before a student has got to grips with their first is confusing and can lessen their confidence. Now, which programming language to teach first is a complex question in and of itself - our take can be read here

Watch out for biases and assumptions

Despite our best intentions, it’s important to keep in mind that various biases and assumptions may sneak into our teaching. One dangerous assumption you may have heard before is that of the ‘geek gene’. This myth refers to the idea that some people are just naturally talented at coding. Those with this gene are destined for success and those who don’t - tough luck! In reality, there is no evidence-based argument for this idea yet, this belief may subconsciously influence teaching. 

Unfortunately, ‘evidence’ from university CS grade distributions are often used to back up this claim. The distribution of grades for CS degrees is seen as bimodal - one  group who score very highly (those that ‘get it’) and another group of students who score poorly (those that don’t). Patitsas, Berlin, Craig & Easterbrook (2016) investigated the perception of grade distributions and what they found was concerning. They found that a mere 5.8% of introductory computing course grades were multimodal; a probability distribution of two or more modes. Despite this, CS faculty perceived distributions as bimodal if they believed the results were taken from a programming course. This effect was seen more in faculty members who believed in the idea that some learners are naturally more suited to succeed in computer science.   

Another assumption is that novices are not experts. Of course, educators are well aware of this. However, as we master certain skills, it can be easy to forget the days when we started out. The way we think about code changes hugely from beginner to expert. Highly-skilled coders have stored knowledge that can be easily accessed when faced with a problem. Attempting to solve a problem or debugging relies on a certain amount base knowledge of how a chunk of code should function. In beginners, this base knowledge is still being formed and can be fragile. Keeping an eye out for this assumption is worthwhile. There are many useful resources looking into common programming misconceptions - we hosted a guest webinar with Luca Chiodini, covering precisely this! 

Let students try, and try again

Another difference between beginners and experts relates to the most effective types of assessments. To help construct a strong foundation of programming knowledge, beginners need frequent, small, simple assignments that do not rely on having a vast understanding of many different concepts.  As they gain a deeper understanding of coding and develop more confidence, assignments can become more detailed, such as using specialized libraries. 

Designing appropriate assignments for different levels of coders also contributes to students’ coding confidence. Alongside the content of assignments, the system used also plays an important role. When starting out, an intuitive, non-distracting coding environment may be preferred, whereas further down the line, an industry-standard one is recommended. 

Students should be able to code iteratively. If a learner submits their code and has to wait a week to receive feedback, the learning process becomes long and painful. Getting feedback (almost) instantly allows students to see their mistakes, correct them, and resubmit. Of course, higher quality coding education results in an increased workload for teachers. This is where selecting the right platform and support tools comes in (read more about that here).

Conclusion

The future of coding education is exciting and ever-changing. We are always interested to hear your thoughts and top tips for teaching programming! Let us know what you think by reaching out to us on our socials below. 

References

Brown, Neil CC, and Greg Wilson. "Ten quick tips for teaching programming." PLoS computational biology 14.4 (2018): e1006023.

Patitsas, Elizabeth, et al. "Evidence that computer science grades are not bimodal." Communications of the ACM 63.1 (2019): 91-98.

Continue reading

Best Practices for Rubric Design in Coding Assignments

Discover best practices for rubric design in coding education. Learn to align rubrics with learning objectives, use automated tests, and explore ungrading for fairer, growth-focused assessments

Watch now! How to teach Python

Watch our 2024 webinar for updates on the Introductory Python course, including new modules, knowledge checks, and grading automation with CodeGrade.

Follow A New User!

See how CodeGrade streamlines grading and improves assignment design in programming courses.

How to configure an AI Assistant for code

CodeGrade’s AI Assistant offers a flexible way to support coding education through tailored guidance and feedback. This guide explains how to configure and customize the assistant to fit your teaching goals, from helping students debug code to providing conceptual explanations.

Sign up to our newsletter

Transform your Jupyter Notebooks course today!