AI in learning programmimng

1.3. AI in learning programmimng#

Lately we’ve been witness to a massive increase in popularity and usage of large language models (LLMs), in particular ChatGPT. Here we would like to encourage you to use LLMs such as ChatGPT in a responsible way while learning the basics of programming.

AI tip

If you get stuck or just want a quick explanation, try asking an LLM to clarify a programming concept or review your code. Remember, using AI as a supportive tool can help you learn faster and deepen your understanding.

../../_images/chatgpt.png

Fig. 1.8 ChatGPT logo.#

In this book, we are building the foundations of your programming skills - this is analogous to learning the fundamentals of calculus, such as multiplication table, which you did a long time ago in elementary school. Notice that while there are calculators readily available on your computer and smartphones, you still learned by heart how to do multiplication, and are able to perform a sanity check if your calculator would give you a wrong output for 4 {times} 5.

Translating this to programming, the concepts you will learn in this book are the very essence of programming. While it is possible to take shortcuts and find (parts of) the code available online and/or with LLMs, if you skip learning the basics, you may hit the ceiling when it comes to programming skills rather quickly.

Why is that?

  • Critical thinking and problem solving require practice. Learning the basics trains your logical thinking and teaches you how to break problems into smaller, manageable steps—skills that copying solutions won’t develop. If you skip learning the basics and practicing on your own, you will not develop these critical scientific skills.

  • More practically, LLMs often don’t provide (entirely) correct solutions. Using ready-made code or AI-generated solutions can help you complete tasks, but without understanding the basics, you may struggle to modify, debug, or extend code when needed. It will always be up to you to understand and improve solutions, which you won’t be able to do if you don’t learn how to code independently.

  • In science, we’re exploring the unknown, whereas LLMs are trained using the text available online and can only reproduce what they’ve already “seen”. Therefore, LLMs won’t always have solutions to your (thus far untackled) questions, which may require hundreds of lines of code.

This book will gradually introduce you to best practices for using LLMs while learning the fundamentals of programming, keeping the earlier warnings in mind. In later sections and exercises, you will learn how to approach AI tools with a critical mindset in order to get the most of them without hindering the development of your core programming skills.