95
submitted 10 months ago* (last edited 10 months ago) by 3h5Hne7t1K@lemmy.world to c/programming@programming.dev

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?

you are viewing a single comment's thread
view the rest of the comments
[-] shotgun_crab@lemmy.world 6 points 10 months ago

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

[-] owenfromcanada@lemmy.world 8 points 10 months ago

Sweats nervously in C pointer

[-] shotgun_crab@lemmy.world 4 points 10 months ago

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

[-] MaoZedongers@lemmy.today 1 points 9 months ago

Nobody would cry if it disappeared tomorrow though

this post was submitted on 27 Dec 2023
95 points (93.6% liked)

Programming

17314 readers
71 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS