Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show case of PolySharp benefits? #105

Open
apm1grb opened this issue Jul 26, 2024 · 3 comments
Open

Show case of PolySharp benefits? #105

apm1grb opened this issue Jul 26, 2024 · 3 comments

Comments

@apm1grb
Copy link

apm1grb commented Jul 26, 2024

It would be beneficial to have some examples of how using PolySharp helps. I'm keen to provide a presentation for my colleagues that underlines the pros of PolySharp. A demo code base - one project without PolySharp (and with errors) and one with PolySharp (and
without errors) - would be helpful. Also, some words about typical alternatives might be helpful to advertise the adoption of PolySharp.

In my case, I mentioned spontaneously the helpful polyfill for record types and immediately got the feedback from the team: It makes no difference whether we add a reference to PolySharp or provide a class IsExternalInit. Okay, my fault for not having the best sample, but also other samples on various internet resources underline benefits of PolySharp, that are not really benefits of PolySharp, instead they come with Latest.

@TrubbleAC
Copy link

Not exactly a comparison but you might be able to get some use out of PolySharp.Playground - it at least highlights what features are explicitly supported by PolySharp with code samples for each feature. It breaks things out by version, as well as whether or not the feature uses a polyfill or is compiler-only.

@Sergio0694
Copy link
Owner

Sergio0694 commented Aug 23, 2024

"It makes no difference whether we add a reference to PolySharp or provide a class IsExternalInit."

I mean, they're not wrong, but they're also missing the whole point of PolySharp: which is precisely to avoid having to do that for every feature you care about. You just use the package, and then you can just forget about it and use features normally.

Also worth noting:

  • There's literally dozens of polyfill types. It's not fun having to manually add all of them.
  • PolySharp also automatically handles type forwards where needed. That's not intuitive to do on your own.

This project literally exists because I was tired of copying yet another polyfill type in the Microsoft Store repo 😆

@rabejens
Copy link

My key point is: I have to use .net Standard 2.0 for some libraries because we have some legacy stuff that still needs the old .net Framework. With PolySharp, I can just set the language version to 12 and use most of the new C# features anyway and don't have to remember whether I can use a newer feature or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants