Learn Programming Better in Classes
By: Sharena Rice
Tags: Code, Programming, Computer Science, Coding, Learning To Code

Learn Programming Better in Classes

Get the most out of lectures with meta-learning strategies

There is a light at the end of the finite for loop, but do not let it throw you for a loop! Image by author.

“We jumped from zero to a hundred, and I was lost.”

This is the common sentiment I noticed even among some of the brightest students taking their first programming course. They show up to class, but much of the material goes over their heads unless they came in with prior knowledge of programming. Staying lost means that the time they spend in lectures is not used as effectively as it could be. The students then lose excitement about learning to program.

What happened?

What strategies can help people get the most out of the time they spend in programming lectures?

There are many programming courses and tutorials out there… but can you meta-learn programming?

Absolutely! Based on my experience learning to program in classes, here are some key strategies in mind as you head into lectures, whether they are in-person, remote, or within a pre-recorded course:

Think like a robot

A robot only does the things that it is told to do, and only in the way it is programmed. Nothing less, nothing more.

Similarly, if you come to class thinking like a robot, you will type in the exact commands the instructor tells you to type while they are instructing. Nothing less, nothing more.

Programming involves logic spelled out in exact ways. While the programming languages may look somewhat like commands in English, they are written in their precise syntax. Many languages are case-sensitive and have their own conventions to them. There are often multiple ways to write algorithms that do similar things. But before you start programming creatively and with your own ideas, it is important to learn the concept at hand during class.

Think like a robot to write commands in code exactly as it needs to be written in class.

Comment your code

Comments are not commands that are executed in the code. They are solely for the benefit of the human reader or programmer of the code.

While it helps to write commands in the code itself exactly as the instructor does, the instructor may not be writing comments during their demonstrations. It is important for you to write comments in the script to look back at later, especially for newly-introduced comments, so that you can tell what each line of code does, even if the next time you revisit the code is years later. Comments make the code much easier to follow as it is written. It also makes the code easier to re-purpose for projects and assignments.

Comment your code in class. Word your comments in a way that make sense to you. This will help your future self and others who may read your code. If you have a grader, they will probably want to see comments on assignments or exams, as well.

If you are watching a programming lecture that can be paused, using the pause button will allow you to take extra time to write comments in your code.

Follow like a sheep

Programming is different from many other courses. In many fields, a student could zone out for a couple of minutes and still be able to follow the lecture. In programming, this is not the case. Programming is an active process. Every single step needs to be followed for a favorable outcome. Skipping a step in programming is similar to forgetting to add an ingredient in a recipe. Missing a minute may mean that you are in the wrong directory, missed defining a variable, or did not input key information correctly in your script. In any of these cases, you may find yourself with errors you cannot explain to yourself.

It is one thing to show up. It is another thing to show up.

Show up to class with energy. Be fully present. Stay focused.

Do not doodle or daydream.

Block out distractions during class.

Do not step out to use the washroom unless there is a break.

This will help you follow the lines of logic during the lecture and help you remember how processes were done.

Sustain your attention to show up and follow like a sheep in class.

Ask questions

If you are lost, ask for help quickly to get back on track. This will prevent you from being lost for the rest of class. This may mean asking an instructional aide for help. This may mean asking a question in the course’s Q&A if the course is online.

If you are learning from lectures in video recordings, you can rewind to see where you got lost and follow along starting from that point or ask a question on the website of the video recording.

There are also ways to ask questions outside of class: through forums about your programming language of interest, through talking with other programmers at local meetup groups, or through discussions with classmates.

Asking questions will help you get back on track in class. This will also help you stay motivated in the learning process.

Afterword:

Depending on what you make of it, programming lectures can be a time of confusion, or they can be taken as a learning opportunity. In summary, the strategies to get the most out of them are:

Think like a robot to write code exactly as it needs to be written. Comment your code in class. This will help your future self and others who may read your code. Sustain your attention to show up and follow like a sheep. Ask questions to stay on track.

You can better jump from zero to a hundred in your programming courses.

The views expressed in this article are solely those of the author and do not necessarily reflect those of the OmarLab, University of Michigan, or Intvo. The spiral staircase was photographed by the author during travels.