Programming Questions Every Student Has Encountered

mbvissers.eth
3 min readFeb 9, 2021

Why can’t teachers be more creative?

By Kari Shea on Unsplash.

Introduction

There are a ton of programming courses these days. Minor programs and Udemy courses. And they all teach the same thing (more or less), programming. Programming is a useful skill for automating simple tasks to developing enterprise-ready web applications. But we all start at the basics at one point.

These basics will contain questions that showcase if statements, lambda functions, or classes. But they always teach it the same way.

Hello, World!

Well, it had to be said. The Hello World application is probably the first thing you will learn, and with the same text as well.

A ‘Hello World’ application is a simple program that displays ‘Hello, World!’ In one way or another. In Python programming, this would probably be in the terminal, and when you’re learning to develop web applications it would be physical text in your web browser.

And it is a very useful step. The first-ever step to create something in a new foreign language that can be displayed. The next variation on this is adding a variable to the mix. Then it would most likely be ‘Hello, <Name>’.

Swapping Two Variables

When you first get started using variables you will always get the same question. Swap two variables using a third variable.

And while this question is a good one for learning to use variables, it is also a bit over-done and outdated. I’ve followed a few courses and they all feature this exercise.

In JavaScript, you can even do it without using a third variable, but no course teaches that.

[a, b] = [b, a]

But I featured that in another article already. Have you encountered this question before already? Was it easy or hard for you?

Books or Movies

Classes are often learned by using them as Book objects or Movie objects. Databases also often start with this as well as some sort of arrays or objects.

The exercise often reads as followed. Create a Library class that has multiple Book objects within itself. The Book class should have an author, which can be in another database table or class as well.

This exercise is a very good way to learn these concepts as the subject themselves is often understood by anyone. Anyone knows what a library is or what a movie is and that they can have fields for data such as authors or actors.

Drawing Shapes

Most prominent in terminal-based applications, but not exclusive to. Drawing simple shapes using asterisks or other characters. Drawing a triangle, a hollow square, or a diamond.

These exercises are useful for learning loops and conditional statements. The triangle only uses a simple loop and a variable for counting while the hollow square also features an if-statement.

*
**
***
****
*****

But while this exercise can be fun, I just think that there should be a better way to learn simple loops or conditional statements.

Conclusion

I cannot think of any more I’ve had when I started to learn how to program. Have you ever even seen these? I’m sure you have seen some of them at least.

Thank you very much for reading and have a great day.

--

--

mbvissers.eth

I occasionally write about programming. Follow me on Twitter @0xmbvissers