Polyglot Primer
Go, Java, JavaScript and Python side by side.
A quick side-by-side refresher of Go, Java, JavaScript and Python: syntax tables, quirks, what is idiomatic in each, a checklist and exercises per chapter. Core language and standard library only.
Chapters
- Chapter 1: Program Basics
Hello world, how each language runs code, where main lives, comments, and the naming/formatting culture of each. Versions assumed: Go 1.22+, Java 21,... - Chapter 2: Variables, Constants and Types
How to declare things, what the built-in types are, what "nothing" looks like, and how each language treats conversion, equality and operators. - Chapter 3: Strings and Text
Strings are immutable in all four languages, but what a "character" is differs sharply: bytes (Go), UTF-16 units (Java, JS) or code points (Python). - Chapter 4: Control Flow
Branching and looping. Go has the fewest keywords (one loop, for); Java and JavaScript have the most (for, while, do/while, enhanced for); Python has... - Chapter 5: Functions
Declaring, calling and passing functions. Go returns multiple values and uses them for errors; JS and Python treat functions as ordinary values with rich... - Chapter 6: Collections - Arrays, Lists, Maps and Sets
The workhorse data structures. Go has just arrays, slices and maps built into the language; Java ships a full Collections Framework; JS has arrays, objects,...
How each chapter works
- Comparison tables and code for all four languages, one topic at a time.
- Quirks and gotchas, and what is idiomatic in each language.
- A checklist of what you should have learned, and an exercise to do in every language.
- Search across everything (try
go looping), tick topics you understand, and keep notes. Sign in with Google to keep progress and notes across devices.