Join Nostr
2026-07-01 13:59:39 UTC

Evolution of printf

C:

printf("%d %d\n", x, y);

C++98: “don’t use printf, use type-safe, extensible i/o streams!”

std::cout << x << " " <<  y << '\n';

C++20: “all right all right, you can format as before”

#include <format>

std::cout << std::format("{} {}", x, y);

C++23: ”ok fine, you can have your printf back”

#include <print>

std::println("{} {}", x, y);