I’m excited to present C# Pad, an interactive web based C# REPL.
Have you ever wanted to quickly evaluate an expression or test some code, like say try out different DateTime string formats or test a method or clear up some confusion (like what’s the difference between Uri.EscapeDataString and Uri.EscapeUriString or what new Random().Next(0) returns), or decode some string in Base64 or some other format?
C# Pad lets you easily do all those things and a whole lot more.
Do you see the embedded code pad below? Go ahead and hit the Go button.
That’s because C# Pad is a REPL. Objects in previous submissions are visible and accessible from the current one.
( Did you also notice the cool code completion? :) )
You don’t need to call Console.WriteLine to display results. Simply type the variable name (without a semicolon) in the last line of a code submission and the string representation of the variable’s value will be displayed.
For example, type
greetingin the same code pad and hit Go to see its value.
You can use C# Pad to write complex code, define classes and methods and evaluate all kinds of expressions ranging from simple mathematical expressions like
60 * 60 * 24or
Math.Sin((30 * Math.PI)/ 180)to LINQ expressions.
You can embed interactive code pads in your blog, website or any site you can edit, just like I have in this blog post. You can even select a theme that matches your site.
Yes, this means you can now create a C# playground anywhere. Simply visit csharppad.com, compose the code you’d like to embed, click the embed button and follow the instructions.
You can also load and save Github Gists.
To load a Gist, open csharppad.com/gist/_gist_owner_/_gist_id or simply csharppad.com/gist/_gist_id
As examples, the links below open up Gists in C# Pad.
The awesome Math.Net Numerics library is bundled with C# Pad, which makes working on complex math and statistics problems a breeze.
C# Pad is the first and only (as of this writing) web based interactive C# REPL, with code completion, diagnostics, themes, embeddability, timing information, Gist support and more features to come.
I hope you find C# Pad useful and delightful. Drop me a line or use the help link on the site to provide feedback on feature suggestions, bug reports and other kinds of feedback
Now that's pretty damn cool... Editing code is a little bit of a pain, as code seems to be highlighted often (so keying replaces the highlighted block), and tab doesn't selected the intellisense like hints, but this is still some awesome coding... :)