Both zig and go use the dot operator, but I find the ‘::’ operator much more readable.

Vec::new();

Makes it clear that were accessing a static method belonging to the Vec struct/namespace.

Vec.new()

Makes it seem like Vec is an object with a ‘new’ method.

Am I alone in thinking this?

  • Ephera@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    11 months ago

    Yeah, kind of curious what Go does here then / what the actual experience is like.
    It abuses casing for public/private, so presumably there’s no way to see whether a given sequence of letters is a variable or a type.