Stats
ashmind/SharpLab is an open source project licensed under BSD 2-clause "Simplified" License which is an OSI approved license.
SharpLab Alternatives
-
Roslyn
The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
-
-
Scout APM
Scout APM - Leading-edge performance monitoring starting at $39/month. Scout APM uses tracing logic that ties bottlenecks to source code so you know the exact line of code causing performance issues and can get back to building a great product faster.
-
-
referencesource
Source from the Microsoft .NET Reference Source that represent a subset of the .NET Framework
-
ASP.NET Core
ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
-
Polly
Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. From version 6.0.1, Polly targets .NET Standard 1.1 and 2.0+.
-
-
-
-
-
Prism
Prism is a framework for building loosely coupled, maintainable, and testable XAML applications in WPF, Xamarin Forms, and Uno / Win UI Applications.. (by PrismLibrary)
-
-
AspNetCoreDiagnosticScenarios
This repository has examples of broken patterns in ASP.NET Core applications
-
-
-
Posts
-
Example from a freeBootCamp article showed as a valid example of good pratice.
A good example of a similar optimization I saw was in C#. It hardcodes a binary search tree into the program (I assume they avoided a dictionary because in C# that means heap allocations, even if it would give better time complexity).
-
Is return true; valid for an Async method?
Looks like it: https://sharplab.io/#v2:CYLg1APgAgTAjAWAFBQAwAIpwKwG5nJQDMmM6AwugN7Lp2YlQAcmAbADwBGA9twDYA+dAFkAFAEpqtejID0sqAE42AOgAiAUz4BDAJ6i4qVOPxIZMqAHZ0AFwBOAVw2mZAX2SugA
- C# 9 Pattern Matching
-
Thoughts on “and”, “or”, “not”, “is”
https://sharplab.io/#v2:EYLgtghglgdgPgAQEwEYCwAoBBmABM3AYVwG9NcL89gB7GgG1wFkAKWAF1ygEpcBeAHxcuAZ1wAWJLhoAnXCmzYA7AG5MAXyA===
-
Top-level Statements in C#
Using sharplab, we can see how the C# compiler transforms this code before it's compiled. Notice that the Program class and Main method are still getting generated behind the scenes, but you don't have to write them.
-
When Assigning Member Variables In a Single Statement (e.g. (Foo, Bar) = (foo, bar)), What Is Really Going On?
The IL is more complex, but asm ends up the same.
-
[Proposal] Introduce Date and Time only structs
https://sharplab.io/#v2:C4LghgzgtgPgAgJgIwFgBQcDMACCwBOArgMbDYAqApntgN7raPZbYCWAdmQGpgA2hlANwMmIxiyp4AFBzIA3PgEo62Hv0rYAvNgW9BAX3SG06FomwBhOmOY5iAe3Y1Z2ALIddAnNqQAGYWhMtsxIAGzY+JRgACaOvACebJxuHGoCWtj+NmZhSWTu7GmUCCoA5pRkmgB82H6C2PrY2ThwuZExcYmSZN1IAUE54d0U1MAltNjllTXslADuI9IArIoGNs15bkhSyvSBQUxwAOwphXwC/UzGQRsurgg71vsHzCcFRQiXjNeiz8F3mEeexe4jeHnOlEwXwa6z+LDuABYgTYBiduggAHRFaE/Ri3ZKuJbIv6oxbAJBYiE42EDHDDVyhYkg15kvo2XFNOF00ZuI5MkHHMmfdlGIA===
I believe they mean properties that return a constant value like this: https://sharplab.io/#v2:C4LghgzgtgPgAgJgIwFgBQcDMACR2DC2A3utmbjnEgGzYBOApmACYD2AdgDYCe2Alu2DYAsgIBqYTgFcG2ALzYADAG5S5LLhr9BI8ZJkJi2AOYMhcgHxLl2AL7Y1ZRxW1DhSABQBKYs/K4Adl12CWkGVTR/W2dnDQE3BG9fSP91INEQ/QYECKj0WyA==
-
Five secrets of .NET async await
If we look at IL code something like this -SharpLab , you can see it is creating a state machine and Task under the hood.
-
How do you turn syntactic sugar into low level compilable code?
I'm using SharpLab to see how this works behind the scenes:
-
What is your opinion on Rust from a C# dev's point of view?
As an aside, you can inline 'lambdas' in C# if you do something horrible like this, because the JIT knows the exact type of F it can devirt and inline the call to Invoke().
-
goto used in .NET sourcecode
Yes and no
-
Python Switch Statement
This is the bad part of Python's match, I don't understand why they want to do it this way - in neither Scala, Rust, F#, C# you'd would (AFAIK) hit such issue. For example C# example of both behaviors: https://sharplab.io/#v2:CYLg1APgAgTAjAWAFBQMwAJboMLoN7LpHoDG...
-
Is passing by reference a bad practice?
For anyone else who is still confused, here's a quick example. You'll notice that the two functions are basically the same, both when passing in a value type and a reference, except one uses the ref keyword. While it is true that the int value that is passed into the method is a value of an integer and that the List is a reference, they have different semantics.
-
FizzBuzz – SIMD Style
Good comment, however for a / 2 and other powers of two modern compilers are instead optimizing division into shifts and modulo into bitwise and. Both are very fast instructions, faster than integer multiplication.
Even JIT compilers do these optimizations: https://sharplab.io/#gist:ce7f7677cbb9f43efe74aeeadb75deb1