Background image
logologo symbol

3 - The fundamentals

SPECIALITY - Reading code

Description

Before we start to dive into TypeScript it is good to stop a bit and try to understand where we are and what we know. A good way to check your own knowledge is to try to read through some code and see how much of it you can understand.
The art of reading code has become more and more important skill in recent years. You have already read through some code when reviewing some of your classmates assignments and that is a very good practice. Code reviews are a big part of professional programmers day and just as important as writing code because it ensures good code quality. With the introduction of Large Language Models like ChatGPT and Claude more and more code is written by machines and that way it becomes even more important to know how to read code because we need to be able to understand what the AI is trying to do.
In this guide you will need to read through some code and try to understand it, Write comments or take notes to try to explain the code that you see and make sense of it yourself. If you have troubles understanding it, try to ask ChatGPT or Claude to explain it and see if that helps.

Topics

Things you will run into in the code you read:
  • Data types
  • Conditionals
  • Functions
  • Code reviews

Goals

Knowledge

Know how to read code
Know how to comment code
Know how to make an educated guess and get the answer

Skills

Be able to read and understand code
Be able to get help online when you don't understand some code
Be able to read and understand code you have never seen before

Idea for return

In this guide you can choose any code that you have encountered on your coding journey so far. When you have decided what code you want to use you can:
  • Read through the whole code
  • Comment what you think each part of the code does
  • Use Google, ChatGPT or Claude to explain the code
  • Write another comment and compare it to your guess to see how far you were from the truth.
If you have a hard time finding some code you can use this repository that I created with 10 levels of code. It is alright if you can not explain all of them but try to go as far as you can:
When you are ready, push your code with all the comments into a new GitHub repository and return it here. And remember to make a review ;-)
Good luck!