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?

  • @shotgun_crab
    link
    English
    611 months ago

    Anything is fine as long as it’s not an arrow (I’m looking at you, PHP)

      • @shotgun_crab
        link
        English
        411 months ago

        C is the cool grandpa of today’s programming languages so he can get away with this