3 ms·
As someone who doesn't write Zig (but is hoping to soon!), I'm struck when reading this that the new interface seems much more verbose than the old interface...
by sarreph 2mo ago
As someone who doesn't write Zig (but is hoping to soon!), I'm struck when reading this that the new interface seems much more verbose than the old interface... i.e. 6 LoC vs the previous implementation's 3 LoC.
I was under the impression that verbosity was something that Zig tries to reduce, but perhaps this is not emblematic of other updates to the language?
- wmedrano 2mo agoZig is more about "no hidden control flow" than conciseness. https://ziglang.org/learn/overview/#small-simple-language https://ziglang.org/learn/overview/#small-simple-language
- PunchyHamster 2mo agoAt glance it looks more of "performance vs readability" tradeoff. Not sure if making every IO handling code look worse is worthy tradeoff.
- jibal 2mo agoOld way to write: try writer.print("Hello {s}\n", .{"world"}); New way to write: try writer.print("Hello {s}\n", .{"world"});
- jibal 2mo agoCounting LoC in boilerplate is somewhere between silly and absurd ... there's just one instance of those lines for a large body of code. 3 more lines is not "much more verbose". Old way to write: try writer.print("Hello {s}\n", .{"world"}); New way to write: try writer.print("Hello {s}\n", .{"world"}); And no, reducing verbosity is not a Zig thing. And there were far more important goals driving WriterGate than verbosity -- there were problems to be solved. If they could have been solved less verbosely then perhaps they would have been.