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
    6
    ·
    1 year ago

    Yeah, but does that matter? I don’t think, I’ve ever accidentally broken these conventions, where compiler assistance would have been helpful.