Blog Post

Exploring Languages Through FizzBuzz

February 20, 2026
code languages

Every language has its own personality. You can feel it in something as simple as FizzBuzz — the way each one wants you to think about the problem is different.

Python

Clean and readable. Does exactly what you’d expect.

for i in range(1, 101):
    if i % 15 == 0:
        print("FizzBuzz")
    elif i % 3 == 0:
        print("Fizz")
    elif i % 5 == 0:
        print("Buzz")
    else:
        print(i)

TypeScript

A bit more ceremony, but the types keep you honest.

function fizzBuzz(n: number): string {
  if (n % 15 === 0) return "FizzBuzz"; 
  if (n % 3 === 0) return "Fizz"; 
  if (n % 5 === 0) return "Buzz"; 
  return String(n); 
} 

Array.from({ length: 100 }, (_, i) => i + 1)
  .map(fizzBuzz)
  .forEach(console.log);

Rust

Ownership and pattern matching make even simple things feel deliberate.

fn main() {
    for i in 1..=100 {
        let result = match (i % 3, i % 5) {
            (0, 0) => String::from("FizzBuzz"), 
            (0, _) => String::from("Fizz"),
            (_, 0) => String::from("Buzz"),
            _ => i.to_string(),
        };
        println!("{result}");
    }
}

Go

No generics needed. No cleverness wanted. Just write the loop.

package main

import "fmt"

func main() {
    for i := 1; i <= 100; i++ {
        switch {
        case i%15 == 0:
            fmt.Println("FizzBuzz")
        case i%3 == 0:
            fmt.Println("Fizz")
        case i%5 == 0:
            fmt.Println("Buzz")
        default:
            fmt.Println(i)
        }
    }
}

Bash

Sometimes you just need a shell one-liner that gets the job done.

for i in $(seq 1 100); do
  if (( i % 15 == 0 )); then echo "FizzBuzz"
  elif (( i % 3 == 0 )); then echo "Fizz"
  elif (( i % 5 == 0 )); then echo "Buzz"
  else echo "$i"
  fi
done

Same problem, five different ways of thinking. That’s what makes programming interesting.