Skip to content

Commit

Permalink
Add a links to learn about pointers, stack, and heap (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
illicitonion authored Jan 13, 2024
1 parent a5dd989 commit 660d3e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions prep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Before you start this course, there's a few things we assume you've done:
- You're familiar with the essentials of writing code in JavaScript
- You have experience with JavaScript in the browser and in [Node](https://nodejs.org/en/)
- You've completed the [Tour of Go](https://go.dev/tour/welcome/1)
- Learnt about pointers and memory:
- Read the [Pointers chapter](https://www.golang-book.com/books/intro/8) of [An Introduction to Programming in Go](https://www.golang-book.com/books/intro), and do the problems listed in the chapter.
- Read about [stack and heap memory](https://courses.engr.illinois.edu/cs225/fa2022/resources/stack-heap/) - note that the examples here are C++ not Go, but you should be able to follow them. One important difference between these languages is that in Go, you don't need to worry about whether a value lives on the heap or the stack (in fact, Go is allowed to choose where your variable lives, and even move it around) - this means that it's ok to return a pointer to a stack variable in Go. You also don't need to call `delete` yourself in Go - Go is [a garbage collected language](https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)) so it will delete variables when they're no longer needed.

This is important because we don't cover the basic language features of Go: you need to be familiar with writing Go functions and methods, plus the basics of types in Go. You'll also need to know how to navigate [packages and documentation](https://pkg.go.dev/), and we have a [short guide on how to do that](#learn-how-to-navigate-go-documentation).

Expand Down

0 comments on commit 660d3e8

Please sign in to comment.