<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>What's up with this semicolon?</title><link>http://blogs.msdn.com/mfp/archive/2008/04/24/what-s-up-with-this-semicolon.aspx</link><description>The most visual idiosyncrasy in X++ is the dangling semicolon separating the variable declarations from the actual code. But why is it there and why is it needed? Best practices in X++ (as in most other modern languages) suggest using TitleCase when declaring</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: What's up with this semicolon?</title><link>http://blogs.msdn.com/mfp/archive/2008/04/24/what-s-up-with-this-semicolon.aspx#8435540</link><pubDate>Mon, 28 Apr 2008 18:26:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8435540</guid><dc:creator>Petur Snaeland</dc:creator><description>&lt;p&gt;Big news! I for one never bought the explanations that this was necessary. Actually, since Axapta 2.1 I &amp;nbsp;never had that problem because I grew up in C/C++ and chose to use descriptive variable names like &amp;quot;AccountNum nextCustomerId;&amp;quot; in X++, which happens to avoid the issue altogether AND leaves more readable code. I hope your good colleagues will bring this out in the next AX4 and AX3 service packs too. Great initiative Michael.&lt;/p&gt;
</description></item><item><title>re: What's up with this semicolon?</title><link>http://blogs.msdn.com/mfp/archive/2008/04/24/what-s-up-with-this-semicolon.aspx#8435939</link><pubDate>Mon, 28 Apr 2008 22:06:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8435939</guid><dc:creator>dewetha</dc:creator><description>&lt;p&gt;hopefully this makes the suppose best practice of placing a semi colon in methods above any code. including one without type declarations.&lt;/p&gt;
&lt;p&gt;i.e. best practice?:&lt;/p&gt;
&lt;p&gt;int addTwo( int _in)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;return _in + 2;&lt;/p&gt;
&lt;p&gt;} &lt;/p&gt;
&lt;p&gt;now can be:&lt;/p&gt;
&lt;p&gt;int addTwo( int _in)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;return _in + 2;&lt;/p&gt;
&lt;p&gt;} &lt;/p&gt;
&lt;p&gt;that will make teh confilct betwenn an accepted best practice and MBS layers the same.&lt;/p&gt;
</description></item><item><title>re: What's up with this semicolon?</title><link>http://blogs.msdn.com/mfp/archive/2008/04/24/what-s-up-with-this-semicolon.aspx#8436821</link><pubDate>Tue, 29 Apr 2008 12:14:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8436821</guid><dc:creator>Strider</dc:creator><description>&lt;p&gt;I've allways hated the practice of naming variables after their type using camel casing. You may argue that C/C++ developers have been doing this for ages, but C is case sensitive. X++ is not!&lt;/p&gt;
&lt;p&gt;I strongly beleive that variable names should describe their content and semantics and not their type. It makes code much more readable for human beings!&lt;/p&gt;
&lt;p&gt;It's a qood thing the semicolon is no longer necessary but apart from that you should really reconsider some of the X++ &amp;quot;best practices&amp;quot;!&lt;/p&gt;
</description></item><item><title>re: What's up with this semicolon?</title><link>http://blogs.msdn.com/mfp/archive/2008/04/24/what-s-up-with-this-semicolon.aspx#8436842</link><pubDate>Tue, 29 Apr 2008 12:32:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8436842</guid><dc:creator>Martin Olsson</dc:creator><description>&lt;p&gt;Great work! I really really appreciate that you took the time to fix this.&lt;/p&gt;
</description></item><item><title>re: What's up with this semicolon?</title><link>http://blogs.msdn.com/mfp/archive/2008/04/24/what-s-up-with-this-semicolon.aspx#8437071</link><pubDate>Tue, 29 Apr 2008 14:12:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8437071</guid><dc:creator>dewetha</dc:creator><description>&lt;p&gt;I like that fact that x++ is case insensitive. really, how big does a method/funtion need to be to have to start reusing names?&lt;/p&gt;
&lt;p&gt;I would like to see the old VB functionality that if I declare a variable and then in code,type it in lower case. it will then format it for me to what I declared. that is awesome for use guys that are lazy typists!&lt;/p&gt;
&lt;p&gt;i.e. declare:&lt;/p&gt;
&lt;p&gt;int FooBar;&lt;/p&gt;
&lt;p&gt;type: foobar = -1;&lt;/p&gt;
&lt;p&gt;compile makes it: FooBar = -1;&lt;/p&gt;
&lt;p&gt;since you are the GURU ;)&lt;/p&gt;
</description></item><item><title>re: What's up with this semicolon?</title><link>http://blogs.msdn.com/mfp/archive/2008/04/24/what-s-up-with-this-semicolon.aspx#8441716</link><pubDate>Wed, 30 Apr 2008 09:29:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8441716</guid><dc:creator>mfp</dc:creator><description>&lt;p&gt;The best practice in X++ for naming of variables can be seen here:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/aa892904.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa892904.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As can be read here, variables should always be named logically, ie. the name should describe the contents in the variable.&lt;/p&gt;
&lt;p&gt;However, as EDTs are also named logically there often are clashes. Sometimes a variable is just an accountnum, and then you shouldn't make up variable names like _accountNum, myAccountNum, etc.&lt;/p&gt;
&lt;p&gt;Regardless of how you name your variables the dangling semi-colon can still be an annoyance in methods without any variable declarations.&lt;/p&gt;
&lt;p&gt;void helloWorld()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;info(&amp;quot;Hello World&amp;quot;);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
</description></item><item><title>first command is static ??</title><link>http://blogs.msdn.com/mfp/archive/2008/04/24/what-s-up-with-this-semicolon.aspx#8890756</link><pubDate>Sat, 23 Aug 2008 23:42:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8890756</guid><dc:creator>Sebastian Draese</dc:creator><description>&lt;p&gt;the dangling semicolon is also needed, &lt;/p&gt;
&lt;p&gt;when the first command is an static-method call,&lt;/p&gt;
&lt;p&gt;void test()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;; // &amp;lt;--- you'll need this, because info() -&amp;gt; global::info()&lt;/p&gt;
&lt;p&gt; &amp;nbsp;info(&amp;quot;test&amp;quot;);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
</description></item><item><title>re: What's up with this semicolon?</title><link>http://blogs.msdn.com/mfp/archive/2008/04/24/what-s-up-with-this-semicolon.aspx#9286939</link><pubDate>Wed, 07 Jan 2009 10:04:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9286939</guid><dc:creator>Rakesh</dc:creator><description>&lt;p&gt;I come to AX from C# background and had always cursed X++ for the dangling semi-colon. Great to know that it won't be required in near future.&lt;/p&gt;
</description></item><item><title>re: What's up with this semicolon?</title><link>http://blogs.msdn.com/mfp/archive/2008/04/24/what-s-up-with-this-semicolon.aspx#9930157</link><pubDate>Mon, 30 Nov 2009 13:00:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9930157</guid><dc:creator>Carl S</dc:creator><description>&lt;p&gt;Sunday morning, so boring, what can I do...&lt;/p&gt;
&lt;p&gt;Ah! let's have a look at AX and make some changes in the X++ grammar...&lt;/p&gt;
</description></item></channel></rss>