As a developer, sometimes we want to try something out quickly, to see if our idea works as a proof of concept. In the .Net environment this leads many times to many solutions on the desktop named ConsoleApplication1 and ConsoleApplication2, or WinformApplication1, with a form containing only one big button with the text Run! on it.
It is much more convenient to have something like Python has, where one can simply insert the code one line at a time, and see what the output is. This is known as REPL, which stands for Read-Eval-Print-Loop.
There are two ways which I know of how this can be achieved.
The first one is by means of PowerShell. This gives you the option of typing in C# code, and getting results immediately. The problem with this approach is that the code can loook quite different, where DateTime.Now can become [DateTime]::Now.
The second way is by making use of the wonderful tool which is part of the Mono Project. Mono is an open source implementation of the .Net framework, and it can run on multiple operating systems.
This tool, called GSharp, can be found in the Mono Command Prompt. Simply type in csharp, and you are good to go. Typing in DateTime.Now, now works.
No comments:
Post a Comment