Chapter 1 - Installing and Setting Up Tools
This guide will walk you through the installation and setup of all the tools you'll need to follow the Basic Programming course. By the end of this guide, you'll have a fully functioning programming environment, ready for Python, PHP, C++, Zig, and Go development on Linux, Windows, and macOS.
Tools Overview
Code Editor: Visual Studio Code (VS Code) is recommended for this course.
Compilers/Interpreters:
Python: Python interpreter (latest version)
PHP: PHP runtime
C++: GCC or Clang compiler
Zig: Zig programming language toolchain
Go: Go programming language toolchain
Version Control: Git for source code management.
Terminal Emulator: Optional for Windows users—install Windows Terminal or use the built-in Command Prompt/PowerShell.
Build Tools: Additional build tools like Make or CMake for C++ projects.
Installing Visual Studio Code
Linux
Download the VS Code package for your Linux distribution:
wget -qO- https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64 -O vscode.deb sudo dpkg -i vscode.deb sudo apt-get install -f # Fix dependenciesStart VS Code:
code
Windows
Download VS Code from Visual Studio Code’s official website.
Run the installer and follow the setup wizard.
Ensure the "Add to PATH" option is checked during installation.
macOS
Download the VS Code
.dmgfile from Visual Studio Code’s website.Drag the VS Code icon into the Applications folder.
Open VS Code from Launchpad or Finder.
Installing Compilers and Runtimes
Python
Linux:
sudo apt update sudo apt install python3 python3-pipWindows:
Download Python from python.org.
Run the installer and ensure "Add Python to PATH" is selected.
macOS:
brew install python
PHP
Linux:
sudo apt update sudo apt install phpWindows:
Download PHP from php.net.
Add PHP to the system PATH.
macOS:
brew install php
C++ Compiler (GCC/Clang)
Linux:
sudo apt update sudo apt install build-essentialWindows:
Install MSYS2.
Open MSYS2 and run:
pacman -S mingw-w64-x86_64-gcc
macOS:
xcode-select --install
Zig
Linux:
wget https://ziglang.org/download/index.html -O zig.tar.xz tar -xf zig.tar.xz sudo mv zig-* /opt/zig sudo ln -s /opt/zig/zig /usr/local/bin/zigWindows:
Download Zig from ziglang.org.
Extract the zip file and add Zig to your system PATH.
macOS:
brew install zig
Go
Linux:
wget https://golang.org/dl/go1.20.linux-amd64.tar.gz -O go.tar.gz sudo tar -C /usr/local -xzf go.tar.gz echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile source ~/.profileWindows:
Download Go from golang.org.
Run the installer and follow the setup wizard.
Restart your terminal to ensure Go is added to the PATH.
macOS:
brew install go
Installing Git
Linux:
sudo apt update sudo apt install gitWindows:
Download Git from git-scm.com.
Follow the setup wizard, choosing default options unless otherwise specified.
macOS:
brew install git
Optional: Installing Build Tools (Make/CMake)
Make
Linux:
sudo apt install makeWindows:
Install GNU Make.
Add Make to the PATH.
macOS:
brew install make
CMake
Linux:
sudo apt install cmakeWindows:
Download CMake from cmake.org.
Run the installer and select "Add CMake to system PATH."
macOS:
brew install cmake
Verifying Your Setup
Run the following commands to verify the installation of each tool:
Python:
python3 --versionPHP:
php --versionGCC (C++):
gcc --versionZig:
zig versionGo:
go versionGit:
git --versionMake (if installed):
make --versionCMake (if installed):
cmake --version
Setting Up Your Development Environment
Install Extensions in VS Code:
Python
PHP Intelephense
C++
Zig Language Support
Go
GitLens (for Git integration)
Configure Git:
git config --global user.name "Your Name" git config --global user.email "youremail@example.com"Test a "Hello, World!" Program in Each Language:
Python:
print("Hello, World!")PHP:
<?php echo "Hello, World!"; ?>C++:
#include <iostream> using namespace std; int main() { cout << "Hello, World!" << endl; return 0; }Zig:
const std = @import("std"); pub fn main() void { std.debug.print("Hello, World!\n", .{}); }Go:
package main import "fmt" func main() { fmt.Println("Hello, World!") }
Run each program using the respective compiler or interpreter.
Now that you have all the tools installed and configured, you're ready to dive into the Basic Programming course!