views:

111

answers:

6

For those of you that are quick to answer some questions, with code snippets. I must say that I have been beaten to the punch a few times because loading up Visual Studio, File -> New Project... does take some time. Does anyone out there - particularly for those that are contributing answers here - have a good quick editor on Windows that allows you to enter some c# code, compile-it? Basically - what's the fastest way of writing sample code for you?

+4  A: 

Enough familiarity with the language concepts to write snippets without the help of Visual Studio -- right in the markdown editor. And you get the 5-minute grace period for free edits when you realize you made a mistake!

Chris Farmer
Agree with this. Anything up to 20 lines I'll often write up in the comment box and eyeball for correctness. Usually I can tell if my code is too hairy to verify by sight alone.
John Kugelman
+1  A: 

I usually have Visual Studio open with the project "Test" already loaded.

If I'm pretty sure about the code I can post it first, then try to compile it to see if there is any minor adjustments needed to make it run.

Guffa
+6  A: 

Yes.

LINQPad.

Typing a piece of code into LINQPad is much faster than creating a Visual Studio project, and its object graph is more usable than Visual Studio's Watch window.

I find LINQPad extremely useful for answering on StackOverflow.

SLaks
+1. LINQPad is obscenely cool.
Chris Farmer
It can even do P/Invoke.
SLaks
LINQPad is the shiznat
Muad'Dib
I don't think that using LinqPad to make some quick snippet code makes someone any worse at c#, this is a great tool!
cbkadel
A: 

I don't use an IDE for writing my code snippets here. Straight in the markdown box. Lack of tabs is annoying (I'm considering writing up a greasemonkey script to try and alleviate that - haven't got around to it so far), but it's not exactly hard.

If you want to check for syntax errors, you could just use notepad and csc.

Anon.
+3  A: 

I usually keep VS open all the time, but as an alternative, this program is interesting (and lighter weight): Snippet Compiler

Ken
I loved the Snippet Compiler idea when I first heard about it on Scott Hanselman's tools list a couple years back, but I thought its startup time was actually pretty bad for something that was supposed to be lightweight.
Chris Farmer
A: 

If it's a fairly easy question, I'll write it all from memory straight in the markdown editor without opening anything else.

Otherwise I make use of the Snippet Compiler.

Agent_9191