# Printing Lists
Source: [https://matklad.github.io/2026/08/14/printing-lists.html](https://matklad.github.io/2026/08/14/printing-lists.html)
Aug 14, 2026To print a comma\-separated list, a concise idiom is to optionally print the comma first, before the element:
```
for (items, 0..) |item, item_index| {
if (item_index > 0) std.debug.print(", ");
std.debug.print("{}", .{item})
}
```
A blog post describing two tips for using `zig fmt` effectively, highlighting its 'steerable' formatting approach where trailing commas and line breaks control layout decisions, and showcasing columnar array formatting.
Mitchell Hashimoto demonstrates how to use Zig's comptime to create subset types of tagged unions, enabling compile-time safety without exhaustive case handling.