5 ms·
Hm, a one-liner turnoff: const std = @import("std"); * pointless semicolon * pointless "@" * seemingly pointless "const" (can you define a mutable impor
by lazyjones 8y ago
Hm, a one-liner turnoff:
const std = @import("std");
* pointless semicolon
* pointless "@"
* seemingly pointless "const" (can you define a mutable import?)
* unnecessary verbosity defining an identifier for the import when there's almost never a need for naming it differently (i.e. it should default to "const std" if you just type "import 'std'"...
I like Go because it avoids pointless verbosity most of the time.
- GolDDranks 8y agoI'd avoid picking on a language just by one line – it's not a language for writing one-liners, in which case the critic would be valid. There might be very good reasons for each of those things, but it's hard to say without delving into it some more.
- andrewchambers 8y ago> I like Go because it avoids pointless verbosity most of the time. Except for all those times you had to manually write err != nil
- butterisgood 8y agoI think you can also write use @import("std"); but then you've just imported all of std into your own namespace. (probably not using the correct terminology here). At any rate the const indicates you're not changing, and the std is the name given to the root of the hierarchy for importing "std" into. Sure go lets you do this too, but has shorthand. import "fmt" can also be done as import fmt "fmt" but why would you do that? The go equivalent of zig's "use" is import . "fmt" "." means "the current working directory" on unix so it's familiar to folks in that sense perhaps. Principle of least surprise is nice when the syntax is terse. Still, I think I like zig. I feel like I want to try to write something non-trivial with it when I look at the features. I've already done that a few times with Go, and I enjoy that too.