Why Learning Programming is Hard

On Programming thinking

I had a lot of difficulties learning programming at the beginning. After my first coding class at NTU, which I almost dropped, I thought I didn’t have a talent for coding. However, if many people struggle on this journey, is it due to our lack of intelligence or a failure in our education system to properly teach programming?

To improve my own programming education,

I am currently reading a book called Mindstorms by Seymour Papert. The book discusses the difference in mentality required for learning programming compared to other subjects.

Many children are held back in their learning because they have a model of learning in which you have either “got it” or “got it wrong.” But when you learn to program a computer, you almost never get it right the first time. Learning to be a master programmer is learning to become highly skilled at isolating and correcting “bugs,” the parts that keep the program from working.

The language we learn

Computers are capable of understanding both mathematical and alphabetic languages. However, we are not exposed to this type of learning during our childhood. As children, we learn a lot of vocabulary and become familiar with humanity-related subjects, making these subjects easier to start with.

In contrast, learning mathematical and alphabetic languages is more difficult and hard to be seen. For example, children may not understand that pouring water from a wide container into a taller, thinner one does not change its volume. They need to learn the concept of conservation.

The design of computers has the potential to enhance how people learn formal thinking. By designing computers that children can interact with in a natural way, we can create a learning process similar to learning French by living in France, rather than trying to learn it through the unnatural process of American foreign-language instruction in classrooms.

The emergence of Large Language Models (LLMs) makes this process potentially much easier, as LLMs can compile natural language into coding language. You can think of LLMs as translators when you travel to a foreign country. I am interested in exploring how to apply LLMs to help us better learn programming, beyond the current debugging and explaining code in ChatGPT.

Institutions hinder programming learning

If this way of looking at intellectual products were generalized to how the larger culture thinks about knowledge and its acquisition, we all might be less intimidated by our fears of “being wrong.” — Mindstorms

Schools are institutions that reflect the social and cultural expectations of society. They are like churches, with lots of superstitions, installing the way we should learn, defining the success of learning, and creating taboos on learning.

Through the assessment system in schools, we grow up in a culture that divides people into “smart” and “dumb.” However, this constrains our thinking about what is learnable, as shown by people’s fear of math and programming. Nevertheless, the idea of being smart or dumb is inherently a social construction. In I don’t know shit. People don’t either, I imagine a system that can help us escape this social construction, reducing our fear of being wrong and being deemed “dumb.”

I will argue that the courage to be wrong is especially important in learning programming because most of the time, programming is about detecting “where” and “why” something is wrong. We need to learn how to isolate the chunk of code and test for bugs. My biggest lesson in programming is trying not to feel frustrated when I am wrong and instead read the error messages. I learned that the moment I got frustrated, I made irrational debugging attempts by repeatedly trying the same wrong code. The mindset of debugging is all about patience, examining errors, and extracting valuable information from error messages.

In general, our learning process and mindset are heavily influenced by how schools teach us (digesting the content) and what they consider to be successful (getting the question right). This can become problematic when trying to learn programming, as it requires a very different approach (testing in isolation) and mindset (digging inside the parts that are wrong) to master it.

Therefore, the next project I want to work on is to test how LLM can assist in our process of developing programming thinking. Looking forward to more ideas.

This is the 40th post from my 60-day writing challenges. I was inspired by Tung Nguyen, a friend who is a famous blogger. If you want to get an email notification for my post, feel free to subscribe to my substack: here.

My substack: here

--

--