Wednesday, February 25, 2004 #

QuickCode.Net

I was listening to the Brian Noyes episode of DotNetRocks today and one of his recommended essential tools was QuickCode.Net, a Visual Studio addin for code expansion.

Essentially, this works like a macro that pastes in simple code templates based on a pattern. Make sense ? No, I didn't think so.

One of the default templates looks for a pattern like prop [datatype] [propertyname] and expands it to a public property.

If I type :

prop int foo

and hit Alt + Q, it automagically turns it into :

        /// <summary>
        /// Property Foo (int)
        /// </summary>
        public int Foo
        {
                get
                {
                        return this.foo;
                }
                set
                {
                        this.foo = value;
                }
        }

Another one is :

Class Yak

Turns into :

        /// <summary>
        /// Class Yak
        /// </summary>
        public class Yak
        {
                /// <summary>
                /// Default constructor
                /// </summary>
                public Yak()
                {
                        // TODO: insert constructor code here
                }
        }

 

Of course, my favourite code generation tool of all time CodeSmith does this and more, but it involves switching focus to a CodeSmith window, possibly loading a new template and running it. QuickCode does shorter, more commonly typed snippets with only a few keystrokes. At the grand total price of $30 a licence, a tool like this will pay for itself in no time at all. Awesome.

I have to agree with all the testimonials on their website, this thing rocks.

posted @ Wednesday, February 25, 2004 7:49 AM | Feedback (3)