A Kilo of Days Ground
So The Daily Grind is just about set to celebrate it's 1000th edition! Mike Gunderloy is an industry legend. If you want to feel that you're keeping up with the vast amount of new stuff that the programming world keeps throwing at you, all you need to do is visit the Daily Grind, daily. Here's looking forward to another 1000! You don't need to subscribe to any blogs. Check the Daily Grind every day, and you're up to date. Anything you subscribe to beyond that is purely for entertainment.
Well, here's a bunch of stuff. I can't really say what ties it together -- it's largely code generator type stuff that's been taking background braincycles away from me lately. Mostly stuff I found thanks to Larkware.
Somethings gonna happen here. Something... else... altogether.
- SubSonic -- 'the Zero Code DAL' -- a ruby on rails inspired code generator for asp.net, that presents a clever compromise between ORM and 'code generator overdose'.
- ActiveWriter -- entity modelling tool, that creates .Net classes with ActiveRecord attributes (used by Castle Project).
- NextGeneration -- a code generator app by some clever Australian. Not a lot written about it that I could find. My experience with it was mixed. I'd say 'has potential'.
- Web Client Software Factory -- guidance from the patterns n practices gang at MS. Haven't even looked at this yet.
- protara -- seems to be an entire language and development platform. Worked for me, though i'm not sure what i'd use it for, or who would be the real target audience for it. (Wow -- seems to be Australian too. I only wish I got the point of it.)
- Aptana -- brilliant javascript IDE. Javscript intellisense, integration with popular web frameworks... incredible app. So useable.
'WaterBreath' on Wed, 18 Oct 2006 21:16:02 GMT, sez: Today's Daily Grind has a link to a code generator called CodeSmith which appears to have a quite interesting feature called ActiveSnippets...
If I'm reading it correctly, they sound quite reminiscnet of macros in LISP, as far as purpose and functionality.
I can imagine a few great time-saving uses for this right off the bat. For example generating property gets and sets, including empty string checks, null object checks, etc. Just by calling an ActiveSnippet and passing in a type and a member name.
I wonder if that's how they really work.
'lb' on Wed, 18 Oct 2006 21:21:19 GMT, sez: from the sound of it, these activesnippets are like the snippets we get in visual studio 2005 already -- though i imagine they've put the idea on steroids and allowed you to hook them up to databases or something like that.
regarding snippets in visual studio 2005... if you haven't seen them try this:
prop[tab]
it gets expanded into something a bit like this:
private [int] [myVar];
public [int] [MyProperty]
{
get { return [myVar];}
set { [myVar] = value;}
}
where you can quickly change the type (from int to whatever you want) and the private variable from 'myVar' to whatever you want, and 'MyProperty' to whatever you want.
you can edit these too. THis is just an out of the box feature in visual studio 2005, but not one you're likely to discover by accident.
'WaterBreath' on Thu, 19 Oct 2006 14:18:12 GMT, sez: Thanks for the info on snippets, which I hadn't made use of yet. I looked into them a bit more. It seems like snippets bring the advantages of C++ macros into the other .NET languages, but improve on them in the process. The difference being inherent support for robust snippet documentation, as well as eliminating the need to explicitly define or import the definition in every program where you want to use it. It's a great addition to the development environment. But let's not forget that it's still essentially text-replacement, and that limits the complexity of the code we can "generate" with them.
The difference is that CodeSmith's ActiveSnippets are, as you noted, _actual parmaterized scripts_ that can generate code dynamically and conditionally, based on the arguments that you pass in. If I've understood correctly, it's a step up from macros and snippets in that you can write the script to actually check and manipulate the "parameters" being given to the snippet. The samples shown on the site don't seem to restrict the generation functionality to being tied to a database or XML data source.
This gives the ActiveSnippet the ability to generate _different code_ depending on what parameters are given to it. So, for your example, say you want an ActiveSnippet for generating a single property, but you don't want to have to call a separate ActiveSnippet if you want emtpy-string checks or null object checks. You can write the ActiveSnippet script to check the type that is passed, and recognize when a non-reference type or a string is specified. Then it can stick a null check into the property-set, if it's a non-reference type, and an empty-string check if it's a string type. And you could even, I presume, have an override parameter on the ActiveSnippet to force it not to do this in cases where you want to accept nulls or empty strings.
Like I said in my last post, this is a step closer to LISP's macros, because it actually introduces a whole other compile step into the process, where code is actually generated dynamically. Granted, it's not as elegant as LISP, because LISP macros are actually written in the same language and syntax as the rest of the code, and their handling is built into the compiler.
It's a pretty sweet idea. But I'm not likely to pay $100 (assuming the "regular" license even supports that feature) just to use it.
|