Earlier quoted context omitted.
> You can write C# in too many forms and I don't believe that's really good. Why not? And what, exactly, defines "too many"?
Perhaps he means something like Python's motto of "There should be one--and preferably only one--obvious way to do it." https://www.python.org/dev/peps/pep-0020/
C# 8: Switch expressions
121–124 of 124 posts
Re: C# 8: Switch expressions
#122Earlier quoted context omitted.
> You can write C# in too many forms and I don't believe that's really good. Why not? And what, exactly, defines "too many"?
I know people meme a lot about Go and "not having generics," but I really feel that a lot of the things left out of Go have benefitted it. I've never really been able to jump into a project without a lot of mental overhead. With Go, most code everywhere is written pretty idiomatically, making it easy to approach and read. I've heard similar things about C#, but my experience hasn't been as great. This is a big proble…
Yes, that's why we program in Brainf__k here: It only has the bare essentials and it's so easy to learn.
Re: C# 8: Switch expressions
#123Earlier quoted context omitted.
That is ugly. What he's doing is creating an anonymous function which takes no parameters and returns an int. That's what a Func is, and then he is executing that function, that's the () bit after })) He could write it nicer as: "+" => Add(), Where he defines add as int Add() => a + b; He's just doing too much inline, 99% of C# developers would not write code as he has done there. Its' the bloggers code style that is…
I agree with your conclusion, but let's keep the conversation civil.