Getting Started
Every programming language has its own way to start. Here's how to create a simple "Hello, World!" program in each language.
Language Overview
- JavaScript
- PHP
- Rust
- Go
- Python
- Zig
- C#
- C++
- C
- Java
- Ruby
- Swift
Type: Interpreted, dynamically typed
Paradigm: Multi-paradigm (procedural, object-oriented, functional)
Runtime: Node.js (server-side) or browser (client-side)
Installation:
- Download from nodejs.org
- Or use package managers:
brew install node(macOS),apt install nodejs(Linux)
Official Documentation: developer.mozilla.org
Verification:
After installation, verify your setup:
node --versionType: Interpreted, dynamically typed
Paradigm: Multi-paradigm (procedural, object-oriented, functional)
Runtime: PHP CLI or web server (Apache/Nginx)
Installation:
- Download from php.net
- Or use package managers:
brew install php(macOS),apt install php(Linux)
Official Documentation: php.net/manual
Verification:
After installation, verify your setup:
php --versionType: Compiled, statically typed
Paradigm: Multi-paradigm (systems, functional, object-oriented features)
Runtime: Native binary
Installation:
- Install via rustup.rs
- Command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Official Documentation: doc.rust-lang.org
Verification:
After installation, verify your setup:
rustc --versionType: Compiled, statically typed
Paradigm: Multi-paradigm (procedural, concurrent)
Runtime: Native binary
Installation:
- Download from go.dev
- Or use package managers:
brew install go(macOS),apt install golang-go(Linux)
Official Documentation: go.dev/doc
Verification:
After installation, verify your setup:
go versionType: Interpreted, dynamically typed
Paradigm: Multi-paradigm (procedural, object-oriented, functional)
Runtime: Python interpreter (CPython, PyPy, etc.)
Installation:
- Download from python.org
- Or use package managers:
brew install python(macOS),apt install python3(Linux)
Official Documentation: docs.python.org
Verification:
After installation, verify your setup:
python --version # or python3 --versionType: Compiled, statically typed
Paradigm: Systems programming
Runtime: Native binary
Installation:
- Download from ziglang.org
- Or use package managers:
brew install zig(macOS)
Official Documentation: ziglang.org/documentation
Verification:
After installation, verify your setup:
zig versionType: Compiled (JIT), statically typed
Paradigm: Object-oriented, multi-paradigm
Runtime: .NET runtime (CLR)
Installation:
- Download .NET SDK from dotnet.microsoft.com
- Or use package managers:
brew install dotnet(macOS),apt install dotnet-sdk-8.0(Linux)
Official Documentation: learn.microsoft.com/dotnet
Verification:
After installation, verify your setup:
dotnet --versionType: Compiled, statically typed
Paradigm: Multi-paradigm (procedural, object-oriented, generic)
Runtime: Native binary
Installation:
- Install compiler:
g++(GCC) orclang++(Clang) - macOS:
xcode-select --installorbrew install gcc - Linux:
apt install build-essential
Official Documentation: cppreference.com
Verification:
After installation, verify your setup:
g++ --version # or clang++ --versionType: Compiled, statically typed
Paradigm: Procedural, imperative
Runtime: Native binary
Installation:
- Install compiler:
gcc(GCC) orclang(Clang) - macOS:
xcode-select --installorbrew install gcc - Linux:
apt install build-essential
Official Documentation: en.cppreference.com/w/c
Verification:
After installation, verify your setup:
gcc --version # or clang --versionType: Compiled (to bytecode), statically typed
Paradigm: Object-oriented, multi-paradigm
Runtime: JVM (Java Virtual Machine)
Installation:
- Download JDK from oracle.com/java or adoptium.net
- Or use package managers:
brew install openjdk(macOS),apt install default-jdk(Linux)
Official Documentation: docs.oracle.com/javase
Verification:
After installation, verify your setup:
java -version javac -versionType: Interpreted, dynamically typed
Paradigm: Multi-paradigm (object-oriented, functional, procedural)
Runtime: Ruby interpreter (MRI, JRuby, etc.)
Installation:
- Download from ruby-lang.org
- Or use package managers:
brew install ruby(macOS),apt install ruby-full(Linux) - Or use version managers:
rbenv,rvm
Official Documentation: ruby-lang.org/documentation
Verification:
After installation, verify your setup:
ruby --versionType: Compiled, statically typed
Paradigm: Multi-paradigm (object-oriented, functional, protocol-oriented)
Runtime: Native binary or Swift runtime
Installation:
- macOS: Included with Xcode (download from App Store)
- Linux: Download from swift.org/download
- Or use package managers:
brew install swift(macOS)
Official Documentation: swift.org/documentation
Verification:
After installation, verify your setup:
swift --versionPrerequisites
Before you start coding, make sure you have:
- A text editor or IDE (VS Code, Vim, IntelliJ, etc.)
- The language runtime/compiler installed (see installation instructions above)
- Terminal/Command line access to run your programs
- Basic understanding of command line operations
Hello World
- JavaScript
- PHP
- Rust
- Go
- Python
- Zig
- C#
- C++
- C
- Java
- Ruby
- Swift
// JavaScript (Node.js)
console.log('Hello, World!');
<?php
echo "Hello, World!";
?>
fn main() {
println!("Hello, World!");
}
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
# Python
print("Hello, World!")
const std = @import("std");
pub fn main() !void {
const stdout = std.io.getStdOut().writer();
try stdout.print("Hello, World!\n", .{});
}
using System;
class Program
{
static void Main()
{
Console.WriteLine("Hello, World!");
}
}
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
# Ruby
puts "Hello, World!"
import Swift
print("Hello, World!")
Running Your First Program
- JavaScript
- PHP
- Rust
- Go
- Python
- Zig
- C#
- C++
- C
- Java
- Ruby
- Swift
node hello.js
php hello.php
rustc hello.rs
./hello
go run hello.go
python hello.py
zig build-exe hello.zig
./hello
csc hello.cs
./hello.exe
g++ hello.cpp -o hello
./hello
gcc hello.c -o hello
./hello
javac HelloWorld.java
java HelloWorld
ruby hello.rb
swift hello.swift
Key Takeaways
-
Paradigm diversity -- Languages span from procedural (C) to multi-paradigm (JavaScript, Python, Rust) to systems-focused (Zig). For example, C keeps you close to the machine with a minimal procedural model, while Rust and Swift blend systems programming with functional and object-oriented features. JavaScript and Python support multiple paradigms: you can write imperative, OOP, or functional code in the same file. When choosing a language, pick C or Zig for low-level control; Rust, Go, or Swift for systems performance with modern ergonomics; and JavaScript, Python, or Ruby for rapid iteration and broad ecosystem support.
-
Typing systems -- Compiled languages (Rust, Go, C++, Java, Swift, Zig) are statically typed, meaning type errors are caught before the program runs. Interpreted languages (JavaScript, Python, PHP, Ruby) are dynamically typed, so you can reassign variables to different types (
let x = 42; x = "hello"in JavaScript). Static typing gives stronger guarantees and better IDE support; dynamic typing favors fast prototyping. For large, long-lived codebases, prefer Rust, Go, Java, or C#; for scripts and prototypes, Python or JavaScript often suffice. -
Execution models -- Compiled languages (C, C++, Rust, Go, Zig, Swift) produce native machine code; you run the binary directly. JavaScript uses Node.js or the browser; Java uses the JVM; C# uses the .NET runtime. Python and Ruby use interpreters that execute source line-by-line. Compiled binaries start fast and often run faster; runtime-based languages offer cross-platform ease and dynamic features. Choose compiled languages for performance-critical or standalone deployments; choose runtimes for web backends and cross-platform apps.
-
Entry point requirements -- C-style languages require an explicit
main()(e.g.,fn main()in Rust,func main()in Go,int main()in C). Python and Ruby execute top-level code from the first line;print("Hello")at the top of a file runs immediately. Go uniquely requires bothpackage mainandfunc main()in the same package. Java and C# tie entry points to a class (public static void main). When switching languages, note these differences: some expect a single entry function, others run scripts top-to-bottom. -
Setup and verification -- Each language has its own installer and version command:
node --version,python3 --version,rustc --version,go version, etc. Use these to confirm your environment before coding. For systems languages (C, C++, Rust, Zig), you typically compile then run; for interpreted or runtime-based languages, you run the source or bytecode directly. Prefer the official installers (e.g., rustup for Rust, SDK installers for .NET and Java) for the smoothest experience.