Wednesday, March 14, 2012

LinqPad

I am really enjoying LinqPad.

It's not often that I find myself using an IDE outside of Visual Studio. If I do, it's almost always for necessity. VS is primarily geared for full-fledged application development with Microsoft-developed coding languages. There's very little (if any) support for other, open-source languages  like Python or Javascript.

VS is also cumbersome when all you need is just a quick, simple script to manipulate XML. VS requires a lot of boilerplate for even the simplest code to run.

After a while, using VS in my day job starts to feel like a repeated exercise in futile over-engineering.

Really unfortunate, since VS has many features that I've found indispensable when coding any language (auto-completion especially come to mind).

Linqpad turns out to be a solution to that. It's a best-of-both worlds compromise. And it's quickly becoming my preferred tool of choice for quick, simple scripting in C# (of which my job requires a lot).

It supports C#, the .NET framework, and Lamda expressions, which are extremely useful when using the System.XML.Linq assembly.

External assemblies are easy to reference (even easier than VS in some ways) and the full version provides auto-complete. You don't even need to create any solutions--perfect when all you need is a few lines of code.

If you're looking for some run-time debugging or testing support, Linqpad isn't really designed for that (and sometimes could really be useful--especially on those delegated MatchEvaluators!).


However, regexes are rarely the best answer for XML. It's usually faster and easier to use LinqPad with an XML DOM rather than contrive a regex for specific XML elements.

Microsoft gets credit for helping serious developers create serious applications. But LinqPad gets extra credit for giving us novice developers a leg up in doing our (hopefully temporary) day jobs well.

Thanks, LinqPad.

No comments: