.NET Fiddle

Having spent way more time, in recent years, in the frontend/JavaScript part of the world it has been quite fun to re-engage, or rather, reintensify the connection with the .NET world of things in my current assignment. Plenty of fun stuff with a CQRS-architecture, the Particular software suite + on top of that React/Redux or plenty of vanilla JavaScript, team DevOps responsibility with Team City, Octopus Deploy, PowerShell and… Ok, it was and still is fun. Back on topic.

The JavaScript world is crammed with REPL:s and, personally, I most of the time just go overboard with [Ctrl] + [Shift] + [J] in Chrome (Surprised? You are likely an [F12] type of person…or perhaps Chrome is not your browser of choice.)

The other day I bumped into .NET Fiddle which is a REPL for the .NET world. Supposedly it should work with F# too but it didn’t when I tried it briefly. Here is an example featuring old string formatting vs C# 6 string extrapolation:

using System;
					
public class Program
{
	public static void Main()
	{
		Console.WriteLine("Hello World!");

		var oldHello = "Howdy";
		var oldLocation = "Texas";
		var oldString = string.Format("{0} {1}!", oldHello, oldLocation);	
		Console.WriteLine(oldString);

		var newHello = "Tjenixen";
		var newLocation = "Marievik";
		var newString = $"{newHello} {newLocation}!";
		Console.WriteLine(newString);
	}
}

Be the first to comment

Leave a Reply

Your email address will not be published.


*