`:` and `=` for initialization of data
Some languages like Go, Rust use : in their struct initialization syntax:
Foo {
bar: 10
}
while others use = such as C#.
What's the decision process here?
Swift uses : for passing arguments to named parameters (foo(a: 10)), why not =?
I'm trying to understand why this divergence and I feel like I'm missing something.
42 comments · 91% upvoted · other discussions
[deleted]
LuciferK9 [OP] 4 points · Aug 2023
I see, thanks! I was overthinking it by wondering if I was missing something like parsing ambiguities on edge cases, etc.
[deleted] 1 points · Aug 2023
[deleted]
oscarryz 2 points · Aug 2023 · Yz
What's GP? Why is that not a matter of taste?
mus1Kk 4 points · Aug 2023
GP is grandparent. From the perspective of the writer, the GP is the post two levels up (like parent post being one level up).