Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to quickly code and run small C# code

There are times when I want to test new code from the forums or when I need to help my friends with specific C# problem. The problem is I don't want to create new "project" in Visual Studio each time just to code/run only this small code.

Java & Eclipse IDE comes up with "Scrapbook" feature which allows the execution of arbitrary Java expressions. What are the choices for C# programmers?

like image 406
Gant Avatar asked Dec 21 '08 18:12

Gant


1 Answers

Snippet Compiler is great for this.

LINQPad is also good for testing out all sorts of C#, F# or VB code, not just LINQ queries.


EDIT

I suppose it's time that I mention that Snippet Compiler hasn't been updated in over five years, and is therefore no longer the best option.

However, I undersold LINQPad originally. As Will Dean mentioned in the comments, LINQPad is excellent for all sorts of code, not just LINQ queries. In fact, it has become an indispensable tool for me. I use it daily, not only to quickly test out short snippets, but for relatively complex mini programs. Its advanced output formatting makes it extremely easy to quickly examine intermediate and final results.

like image 141
P Daddy Avatar answered Oct 06 '22 01:10

P Daddy