Live data from Hacker News

C# Pattern Matching

docs.microsoft.com

51–60 of 214 posts

Re: C# Pattern Matching

#51

Such a beautiful, elegant language. Simple to grasp and lets the compiler handle all that legitimate complexity. Wish more language designers would respect code authors like these designers do.

I suspect that it's not an issue of respect so much as an issue of governance. C# remains a commercial language, wholly owned by a single corporate entity. That, I think, allows its maintainers some luxuries that community languages don't enjoy. Chief among them is a whole team of full-time language designers and implementers who can sustain a sort of deep concentration 40-ish hours a week for years on end. I'm prett…

Technically it's owned by .NET Foundation now, but admittedly it's composed of MSFT people by a large part. Also, language design happens on GitHub, and the community is encouraged to get involved.

Re: C# Pattern Matching

#52

At this point I would not be sad if I was forced to use C# for some reason.

You should try it out sometime, regardless of coercion. There isn't much of a barrier to entry anymore. Even installing VS2019 is a pleasant experience now.

I have yet to meet a developer who gave C# a legitimate try and then decided it was entirely not for them. That said, I only personally know developers who are working in the realm of B2B application development, so perhaps there are other incompatible use cases that I am blind to from my current perspective.

Re: C# Pattern Matching

#53
post #7
post #3

Resharper has proven to be a great way for me to start learning and integrating new language features. I code in my original style and resharper suggests changes based on new features like pattern matching. At first I didnt see the benefit, but this is a hugely powerful feature once you start to wrap your mind around it.

as an aside, if you got Rider as part of your resharper subscription, try it out, it is basically a drop in replacement for visual studio but faster and with many many little quality of life improvements you never knew you needed :)

I started using Rider recently.

It's faster yes, but seems to be a bit more memory hungry out of the gate than VS+Resharper.

There is one HUGE thing I miss however - the Package Manager console. There's still a few things I have to do in there and thus have to switch back to VS.

Re: C# Pattern Matching

#55

Earlier quoted context omitted.

Wait till you get to work in some complex code bases and you'll understand why jamming all kinds of idioms into one language can become a disaster. It's a tool after all, if you know how to use it properly you don't paint yourself into a corner. However, too much flexibility can lead to many problems in larger teams. Good luck!

Java proves that limiting language features for "simplicity" just pushes the complexity somewhere else and generally much worse. C++ is usually taken as a language with too many features but really it just has a few very flexible features and people abused those features to do all kinds of metaprogramming. As C++ has been adding more native metaprogramming idioms it has actually been getting simpler to code in.

The only thing Java proved about language design is that popularity and good language design have zero correlation.

If you want to see simplicity that stood the test of time, look at Smalltalk or Lisp.

Re: C# Pattern Matching

#56
post #3

Resharper has proven to be a great way for me to start learning and integrating new language features. I code in my original style and resharper suggests changes based on new features like pattern matching. At first I didnt see the benefit, but this is a hugely powerful feature once you start to wrap your mind around it.

Indeed. A cool feature I love too. I miss this a lot when coding Python (in PyCharm) and JavaScript (in VS.Code).

Re: C# Pattern Matching

#57
post #7
post #3

Resharper has proven to be a great way for me to start learning and integrating new language features. I code in my original style and resharper suggests changes based on new features like pattern matching. At first I didnt see the benefit, but this is a hugely powerful feature once you start to wrap your mind around it.

as an aside, if you got Rider as part of your resharper subscription, try it out, it is basically a drop in replacement for visual studio but faster and with many many little quality of life improvements you never knew you needed :)

> replacement for visual studio but faster

How can a IntelliJ Idea derivative written in Java be faster than VistalStudio which is native code? Both Idea and PyCharm work much slower than VisualStudio on my machine.

Re: C# Pattern Matching

#58
post #7

Earlier quoted context omitted.

as an aside, if you got Rider as part of your resharper subscription, try it out, it is basically a drop in replacement for visual studio but faster and with many many little quality of life improvements you never knew you needed :)

> replacement for visual studio but faster How can a IntelliJ Idea derivative written in Java be faster than VistalStudio which is native code? Both Idea and PyCharm work much slower than VisualStudio on my machine.

Because VS has limitations on the amount of memory it can use and although they have been working on this, there is still functionality which is highly single threaded whereas Rider tends to offload most of the functionality from the UI thread into background processes.

Re: C# Pattern Matching

#59

Pattern matching is so much better in F#. C# gets more and bloated to the point of paralysis. It's not yet there but I;m sure it will at some point.

Every single feature C# got in past years increased my productivity. I understand that it may cause issues to new learners, but overall, what of them do you consider bloat?

There may be a point where the total economic cost of newbie training exceeds the benefits of improving efficiency for the experienced. C++ arguably did that. Another problem is that people will use different languages if the learning curve grows too high.

Re: C# Pattern Matching

#60

Earlier quoted context omitted.

I got nothing against functional programming, I embrace it. However, im stating again, shoving everything under one umbrella is bound to create a complex monster. Functional programming is actually easier to understand in F# rather than C#, the idioms do translate but clunkily. Do yourseves a favor and spend some time outside C# and you’ll come back illuminated. Not saying C# is bad, thats what you all seem to unders…

You find F# easier to work with. That's all. Doesn't mean others _must_ share your opinion. Good luck to you.

Yes, its all subjective, I know. But stepping out of the garden is what I’d like people to take out of this. Saying C# is the most beautiful language (like some commenter states) is true only if you haven’t dabbled in many languages. And once you do you feel stupid for having had this conviction in the first place. Ive used C# throughout my career, I don’t diss the language or the ecosystem, but other things are to be considered as well and cargoculting is a thing
Post reply on HN