How to fly the nest and develop code offline
Relying on cloud-based environments like GitHub Codespaces is convenient, but what happens when you lose your connection? Learning to set up VS Code locally on your Mac unlocks new development possibilities, allowing you to build, debug, and program without an internet connection.
For many students in Harvard's CS50, the initial development experience happens within the controlled environment of GitHub Codespaces. However, transitioning to a local setup—often referred to as 'flying the nest'—allows for more robust, offline-capable programming. This process involves configuring your own computer with the essential tools used throughout the course, such as Python, SQLite, and Git.
A critical part of this transition is managing your project files correctly. To avoid interference with build tools or Git, it is recommended to create a dedicated folder for your computer science projects. You should avoid using synchronized folders like iCloud, Dropbox, or OneDrive, as these synchronization programs can disrupt the development process. When working with Git, the repository acts as the handoff point between different environments, such as moving from a cloud-based Codespace to your local machine.
To bring an existing project to your local machine, you can use the 'Clone' method. In VS Code, you can trigger the Command Palette using Cmd+Shift+P, run the Git: Clone command, and select your repository from GitHub. Once cloned, you should open the entire project folder rather than individual files; this ensures that the debugger and build tools can access necessary components like the Makefile and the .vscode folder. For those starting from scratch, you can also initiate a completely local project by opening a new folder directly in VS Code.
Source: Developing Your Project Locally with VS Code (Mac) - CS50 Seminars 2021