<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Template Languages and "Nearly VB"</title><link>http://msmvps.com/blogs/kathleen/archive/2008/02/25/template-languages-and-quot-nearly-vb-quot.aspx</link><description>The templates I’ve been talking about require very specific language features of the VB compiler and language neutral templates do not allow any ambiguity in the code output in the initial template. The template itself must be in VB because it’s required</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>re: Template Languages and "Nearly VB"</title><link>http://msmvps.com/blogs/kathleen/archive/2008/02/25/template-languages-and-quot-nearly-vb-quot.aspx#1524496</link><pubDate>Tue, 26 Feb 2008 01:51:26 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1524496</guid><dc:creator>bill</dc:creator><description>&lt;p&gt;So why not use VB for the templates but C# for the initial output rather than some &amp;quot;Nearly VB&amp;quot; . Doesn't C# address every issue you've raised ?&lt;/p&gt;
&lt;p&gt;But I am curious as to what about issues that are language specific, such as declerative event wiring, optional parameters etc ?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1524496" width="1" height="1"&gt;</description></item><item><title>re: Template Languages and "Nearly VB"</title><link>http://msmvps.com/blogs/kathleen/archive/2008/02/25/template-languages-and-quot-nearly-vb-quot.aspx#1524191</link><pubDate>Mon, 25 Feb 2008 17:42:07 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1524191</guid><dc:creator>Kathleen</dc:creator><description>&lt;p&gt;Almost,&lt;/p&gt;
&lt;p&gt;The infrastructure of the template itself outputs the VB code, so no translation is needed to output the VB code, thus 1.2 and 2.2 in your list do not occur. You just run the original template. This also makes 4.2 slightly misleading as there is no template preprocessor for VB. &lt;/p&gt;
&lt;p&gt;For 3.2, you do need the preprocessor - I think the preprocessor name is confusing here but I haven't come up with better semantics yet. &lt;/p&gt;
&lt;p&gt;Scenario 5 is well supported beause of the three pronged nature of the conversion. Writing C# templates is as easy as wriitng VB templates, you have the full support of the infrastrucutre methods such as OutputFunction and some of the semi-colon management if you want it, because that's the way it happens to work. &lt;/p&gt;
&lt;p&gt;You do, however, have to use VB for the XML literals. If you want to write only C# and do not want to use XML literals, you are probably better off sticking with the ASP.NET style template languages including CodeSmith, MyGeneration, CodeBreeze, and T4 from Microsoft (free).&lt;/p&gt;
&lt;p&gt;For complex templates you can still use XSLT, however why would you? You have to learn a secodn language (either VB or XSLT) and VB is way closer to C# than XSLT. &lt;/p&gt;
&lt;p&gt;Thanks for the summary Baxter!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1524191" width="1" height="1"&gt;</description></item><item><title>re: Template Languages and "Nearly VB"</title><link>http://msmvps.com/blogs/kathleen/archive/2008/02/25/template-languages-and-quot-nearly-vb-quot.aspx#1524150</link><pubDate>Mon, 25 Feb 2008 16:17:17 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1524150</guid><dc:creator>Baxter Lane</dc:creator><description>&lt;p&gt;So this adds an extra step to the previously blogged about template preprocessor. You would always have to run the preprocessor, even if you were just generating VB code since the templates are no longer &amp;quot;legal&amp;quot; vb.net code. &lt;/p&gt;
&lt;p&gt;As I see your proposal we have the below five usage scenarios.&lt;/p&gt;
&lt;p&gt;1.	You want to generate both C# and VB.Net out of the gate&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 1.1.	You create your templates in the “Nearly VB” template language&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 1.2.	The preprocessor has to run before your two templates are usable&lt;/p&gt;
&lt;p&gt;2.	You are currently only going to generate vb.net code but you want to support generating c# from your templates , just in case the need arises&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 2.1.	You create your templates in the “Nearly VB” template language&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 2.2.	The preprocessor has to run before your template is usable&lt;/p&gt;
&lt;p&gt;3.	You are currently only going to generate c# code but you want to support generating vb.net from your templates, just in case the need arises&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 3.1.	You create your templates in the “Nearly VB” template language&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 3.2.	The preprocessor has to run before your template is usable&lt;/p&gt;
&lt;p&gt;4.	You could not care less about c# and only want your template creators to have to know valid vb.net code&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 4.1.	You create your templates to output legal VB.Net (which should be slightly easier for your vb.Net guys)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 4.2.	The preprocessor does not ever run against your template&lt;/p&gt;
&lt;p&gt;5.	You could not care less about vb.net and only want your template creators to have to know c#&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 5.1.	Not possible with this product since we require the XML literals but…&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 5.2.	You create their template output using legal c# and never have to worry about the “Nearly VB” syntax&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 5.3.	The preprocessor does not ever run against your template &lt;/p&gt;
&lt;p&gt;If the application has this flexibility I think it sounds great. If we are talking about limiting people I think we are going to scare off some who could otherwise greatly benefit from this tool.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1524150" width="1" height="1"&gt;</description></item></channel></rss>