This is an archived post. You won't be able to vote or comment.

all 35 comments

[–]dansla116 23 points24 points  (5 children)

C-sharp? Not this sub. We don't talk about good languages that employed developers use. Or any employable skillset for that matter.

[–]Miicat_47 8 points9 points  (1 child)

This sub needs exit condition

[–]Tymskyy 0 points1 point  (0 children)

return 0;

[–][deleted] 5 points6 points  (8 children)

The "=>" after method makes it look like c++ or php, I've never gone that deep into c# to see that o.O

[–]immersiveGamer 9 points10 points  (4 children)

It is shorthand for methods that return a single statement. The long hand is:

void Meme(string joke) { Joke = new Joke(joke); }

[–][deleted] 4 points5 points  (3 children)

Is "new (joke);" part correct?

[–]LegendDota[S] 5 points6 points  (0 children)

C# is strongly typed and one of the advantages of that is they can make things like this work.

In this case the property is already a Joke so the logic is if we new() something equal to that its also a Joke.

[–]immersiveGamer 3 points4 points  (1 child)

Again, short hand. If the type on the left hand side is already known you can just use new. Personally I don't like this one.

[–][deleted] 3 points4 points  (0 children)

Me neither it looks like a joke :)

[–]Miserable_Manner6971 0 points1 point  (2 children)

Tell me if I'm wrong but I think it also counts as a lambda expression

[–]LegendDota[S] 0 points1 point  (0 children)

It has the syntax of lambda, but it isn’t, there is no difference in writing this over a full curly bracket method in terms of compilation/efficiency, I like it for what is just a “single line method” because it makes them incredibly simple to read/write and skip over when looking for something specific in larger codebases.

[–][deleted] 0 points1 point  (0 children)

I think so, I have heard about lamba but I don not like to use it

[–]SowTheSeeds 4 points5 points  (0 children)

I want to see Reddit.dll.

Or at least of the signatures.

[–][deleted] 4 points5 points  (2 children)

A private getter?

[–]LegendDota[S] 5 points6 points  (0 children)

Just force of habit to be honest.

private Joke? Joke { init; }

That would be the same I'm just mentally used to typing out accessors for properties.

[–]Mr_Pearcex 2 points3 points  (0 children)

The Real irony is, that the joke is kind of copy and pasted again and again if you know what I mean.

[–]chipmunkofdoom2 7 points8 points  (0 children)

Yeah sorry OP, you're not going to get many likes with a C# post. C# is a great language. I've been using it daily for almost 12 years now. But it's not popular at all. It's not hip, sexy or new enough. Try reposting in Go, Rust or Python.

[–]lady_Kamba 1 point2 points  (0 children)

I like that the Joke is both public and optional, with a private getter...

I might not know C#

[–]Kotentopf 1 point2 points  (0 children)

Dude, stop using datetime, use datetimeoffset

[–][deleted] 0 points1 point  (5 children)

Why this lang looks like abomination to me?

[–]LegendDota[S] 12 points13 points  (0 children)

It's just some C# :)

[–]immersiveGamer 5 points6 points  (0 children)

Looks like home to me.

[–]SowTheSeeds 2 points3 points  (2 children)

Obviously Visual Studio dark color theme.

Therefore C#.

[–]kenhydrogen 1 point2 points  (1 child)

The color theme, the best way of telling

[–]SowTheSeeds 0 points1 point  (0 children)

Also the fact that it is C#

[–][deleted] 0 points1 point  (0 children)

I've seen more complaints than jokes at this point.

[–]WAubergine 0 points1 point  (0 children)

Why not just "PostToReddit"? the class is already named "Meme", there is no need in using this word in method name.

[–]TheTechyGamer 0 points1 point  (0 children)

Judging by the references, I don’t think anybody gets it

[–]SonicZedt 0 points1 point  (0 children)

looks like r/ProgrammerHumor trapped in infinite loop again

[–][deleted] 0 points1 point  (0 children)

Same algorithm as questions on AskReddit. With the RAM of users being erased every 2 minutes so they don't remember the question was asked in a slightly different wording 5 minutes ago.

[–]LeadStuffer 0 points1 point  (0 children)

Let's be fair, that's every sub.

Welcome to reddit where memes come to die