this post was submitted on 07 Oct 2025
171 points (90.9% liked)

Programmer Humor

27489 readers
1385 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 1 month 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 1 month ago (1 children)

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

[–] marcos@lemmy.world 4 points 1 month ago

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

[–] hdsrob@lemmy.world 4 points 1 month 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 1 month ago

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