Reference

Programming languages

Choose TypeScript, Go, Rust or C++ and find syntax, everyday APIs, standard libraries and tools in one place.

Scope and conventions

TypeScript/Node, Go 1.23+, Rust 2024 and C++23: from a first CLI to files, JSON, HTTP, concurrency and testing. Complete programs are labeled; other examples identify their surrounding code/imports. Optional libraries and version requirements are named in each entry.

Debugging & diagnostics

Pause and inspect a failing execution

C++

Build with debug information and use the platform-supported GDB or LLDB. Optimized code can reorder/eliminate variables.

Typical compiler flags: -g -O0. Debug the test binary with its focused test filter.

Check races with a supported tool

C++

ThreadSanitizer needs a supported compiler/runtime and instrumented build. It detects executed data races, not all concurrency bugs.

Typical supported Clang setup: -g -fsanitize=thread for compilation and linking. Run separately from AddressSanitizer.

Run formatting and static checks separately from tests

C++

clang-format formats source; clang-tidy performs configured static checks using an appropriate compile database. Tool installation and configuration are separate from GoogleTest.

Shell with tools/configuration: clang-format --dry-run --Werror example.cpp; clang-tidy -p build example.cpp. Generate compile_commands.json with a supported build generator.

Reduce a failure to one repeatable case

C++

Record exact input, expected/observed behavior, version/configuration and a focused command. Reduce unrelated code while preserving the failure. Keep the result as a regression test once the cause is fixed.

Fragment

main.cpp
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
reproduce → narrow → inspect → change → rerun
retain the failing input or seed