≈ the.bay.news

Unsure about how to handle function parameters

Ziggit
Unsure about how to handle function parameters
Hey everyone, I’m refactoring the API for my S3 client lib (zig-s3) and want to see what people prefer regarding ergonomics and Zig conventions. Initially, functions used plain positional arguments. As parameters started piling up, I considered switching everything to struct literals, but wrapping mandatory parameters in a struct feels like unnecessary friction for simple calls. Comparing both approaches: Everything in a struct try client.createBucket(.{ .bucket_name = "my-bucket" }); var ...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.