| modified | Monday 4 May 2026 |
|---|
1const std = @import("std");
2
3pub fn main(init: std.process.Init) !void {
4 try std.Io.File.stdout().writeStreamingAll(init.io, "Hello, World!\n");
5}
vs. without semicolons:
1const std = @import("std")
2
3pub fn main(init: std.process.Init) !void {
4 try std.Io.File.stdout().writeStreamingAll(init.io, "Hello, World!\n")
5}
main in this example don’t have any function. they’re not grouping any params. ¶1pub fn main() void {
2 std.debug.print("Hello, {s}!\n", .{"World"});
3}
vs. without ():
1pub fn main void {
2 std.debug.print("Hello, {s}!\n", .{"World"});
3}
.{} also, feels like unnecessary clutter. ¶1pub fn main() void {
2 std.debug.print("Hello, {s}!\n", .{"World"});
3}
vs. without .{}:
1pub fn main() void {
2 std.debug.print("Hello, {s}!\n", "World");
3}
// for comments instead of #, now Zig lost the opportunity to have a #!/usr/bin/env zig I guessconst one_plus_one: i32 = 1 + 1; after the variable name doesn’t make sense too, just cluttering the line, it could have been: const one_plus_one i32 = 1 + 1