Learn to code
Learn classes, encapsulation and project layout with line-by-line examples.
Where the five languages come from
| Language | Made by | First release | Used mostly for |
|---|---|---|---|
| Java | Sun Microsystems (USA), a team led by James Gosling | Announced 1995 · JDK 1.0 in January 1996 | Business back ends, Android apps, big-data processing |
| Python | CWI (Netherlands), Guido van Rossum | 0.9.0 in February 1991 · 3.0 in December 2008 | Data analysis, machine learning, web back ends, automation |
| PHP | Rasmus Lerdorf | PHP Tools in June 1995 · PHP 3 in 1998 | Websites, online shops, WordPress, admin screens |
| C# | Microsoft (USA), design led by Anders Hejlsberg | C# 1.0 in January 2002 · ECMA-334 standard (December 2001) | Windows apps, web servers and APIs, Unity games, cloud |
| Swift | Apple (USA), started by Chris Lattner | Announced June 2014 · Swift 1.0 in September | iPhone, Mac and Apple Watch apps, SwiftUI screens |
What a topic page contains
- A one-line meaning, why you need it and an everyday picture to get the idea first.
- The example code with its class diagram and output next to it.
- A Next button that moves one line at a time and shows how variables change.
- Common mistakes, with the wrong code and the fixed code side by side.
- Two short questions at the end to check yourself.
How to read the step-through
Each press of Next moves the bright bar to the line that just ran. The value box shows variables after that line, with changed values in a different color. Lines that print something light up in the output box.
When a line calls a method, the bar jumps into that method and comes back to the caller afterwards.
How to read the class diagrams
The top of a box is the class name, the middle holds fields and the bottom holds methods. A hollow triangle arrow means inheritance (extends), a dashed one means implements, and a line with a diamond means one class keeps the other in a field (has a).
Signs before names: + public · - private · # protected · ~ no modifier
Project structure
Pick a program type and a build tool, and the folder tree and starter files appear right away. Read what each file does, then download the zip and build it.
Questions people ask
Is it free? Do I need an account?
It is free, and every page works without signing up.
Which languages can I learn here?
Java, Python, PHP, C# and Swift. Each topic has an example, a line-by-line step-through, a class diagram and two questions, and one table compares the languages.
Can I run code on the page?
Python and PHP run right in your browser when you press Run. For Java, C# and Swift you see output we produced beforehand on our server, so run edited code on your own computer.