this post was submitted on 07 Oct 2025
170 points (91.3% liked)

Programmer Humor

26846 readers
1887 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] marcos@lemmy.world -5 points 5 days ago (3 children)

Da fuck?!

Where doe it declare it's a public property? Is it some kind of default now? Everything you write becomes one?

[–] Mozingo@lemmy.world 18 points 5 days ago (1 children)

Right there where it says "public". What are you talking about?

[–] marcos@lemmy.world 4 points 5 days ago

Oh, right. I read it all wrong for a moment.

[–] hdsrob@lemmy.world 4 points 5 days ago

It's an Expression-Bodied Member (available since C#6). The expression (=>) is just syntactic sugar that the compiler recognizes as a single line property with only a getter (under the hood both versions compile the same).

[–] victorz@lemmy.world 4 points 5 days ago

What do you mean? Why does what need to be a public property?