diff --git a/exercises/026_hello2.zig b/exercises/026_hello2.zig index f110d87..dc1e019 100644 --- a/exercises/026_hello2.zig +++ b/exercises/026_hello2.zig @@ -30,3 +30,11 @@ pub fn main(init: std.process.Init) !void { // We just learned of a single statement which can accomplish this. stdout.print("Hello world!\n", .{}); } + +// Now you must be thinking "Why would I need to do this instead of good +// old `std.debug.print()`?", but here's what you need to understand: +// `std.debug.print()` prints its output to stderr, while the stdout_writer +// approach prints to stdout. +// A common practice is to pipe output of a command to other commands, +// and in order for the piping to work, those commands expect thier input +// to come from stdout, not stderr.