<?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>LA.NET [EN] - All Comments</title><link>http://msmvps.com/blogs/luisabreu/default.aspx</link><description>Ramblings about C#, .NET and Programming</description><dc:language>en</dc:language><generator>CommunityServer 2008 SP1 (Build: 30619.63)</generator><item><title>re: C# style conventions: more religious wars coming!</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/07/15/c-style-conventions-more-religious-wars-coming.aspx#1641655</link><pubDate>Mon, 21 Jul 2008 19:47:55 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641655</guid><dc:creator>Paulo Morgado</dc:creator><description>&lt;p&gt;How do you name private static fields?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641655" width="1" height="1"&gt;</description></item><item><title>re: UpdatePanel: having fun with errors</title><link>http://msmvps.com/blogs/luisabreu/archive/2006/10/29/UpdatePanel_3A00_-having-fun-with-errors.aspx#1641599</link><pubDate>Mon, 21 Jul 2008 11:43:25 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641599</guid><dc:creator>Matt</dc:creator><description>&lt;p&gt;This is good - I don&amp;#39;t agree with the custom error page handling though. I see this a lot in examples and developers do not realize the effect this has on spiders:&lt;/p&gt;
&lt;p&gt;&amp;lt;error statusCode=&amp;quot;404&amp;quot; redirect =&amp;quot;error.aspx&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;If a spider gets this, it will punish or more likely remove the page from the search engine index. The default redirect for asp.net custom error pages should be statuscode 500, when spiders see this code they assume an error has occured and will come back later - as opposed to assuming the page is not there anymore. You should have a custom 404 page too, but this should be used automatically by .net when a page is not found or has moved - not for handling errors.&lt;/p&gt;
&lt;p&gt;I know this is not an seo asp.net article, but part of good error handling should take into account all kinds of visitors - spiders and humans. If a really important page gets dropped from Googles index due to a simple error, that won&amp;#39;t be nice.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641599" width="1" height="1"&gt;</description></item><item><title>re: C# style conventions: more religious wars coming!</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/07/15/c-style-conventions-more-religious-wars-coming.aspx#1641590</link><pubDate>Mon, 21 Jul 2008 09:18:45 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641590</guid><dc:creator>luisabreu</dc:creator><description>&lt;p&gt;(just noticed that the previous comment got published before I ended it)&lt;/p&gt;
&lt;p&gt;Regarding the parameter vs local variable thing, I haven&amp;#39;t found it important to make that distinction in the code I write. It&amp;#39;s not as important as seeing if you&amp;#39;re working with a field. Since I don&amp;#39;t like using the unecessary this prefix (btw, in these scenarios isn&amp;#39;t the &amp;quot;this.&amp;quot; really a &amp;quot;special&amp;quot; prefix?), I will keep using the _ to indicate a field.&lt;/p&gt;
&lt;p&gt;Regarding the m_ prefix, I believe that it exists for historical reasons. &lt;/p&gt;
&lt;p&gt;At the end of the day, it&amp;#39;s a matter of taste, so everyone is entitled to having his own style.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641590" width="1" height="1"&gt;</description></item><item><title>re: C# style conventions: more religious wars coming!</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/07/15/c-style-conventions-more-religious-wars-coming.aspx#1641588</link><pubDate>Mon, 21 Jul 2008 08:22:21 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641588</guid><dc:creator>luisabreu</dc:creator><description>&lt;p&gt;that question answers itselt. the _ is only applied to fields. parameters and local variables don&amp;#39;t have the prefix.&lt;/p&gt;
&lt;p&gt;btw, there is a place where some sort &amp;quot;hungarian&amp;quot; pays off: with controls on windows forms.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641588" width="1" height="1"&gt;</description></item><item><title>re: Calling your WCF web service from an ASP.NET AJAX page</title><link>http://msmvps.com/blogs/luisabreu/archive/2007/05/22/calling-your-wcf-web-service-from-an-asp-net-ajax-page.aspx#1641587</link><pubDate>Mon, 21 Jul 2008 07:58:19 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641587</guid><dc:creator>Suneel</dc:creator><description>&lt;p&gt;I am also getting the same error &amp;nbsp;Unrecognized attribute &amp;#39;messageEncoding&amp;#39;. Any update on this.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641587" width="1" height="1"&gt;</description></item><item><title>re: C# style conventions: more religious wars coming!</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/07/15/c-style-conventions-more-religious-wars-coming.aspx#1641562</link><pubDate>Sun, 20 Jul 2008 23:59:33 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641562</guid><dc:creator>Paulo Morgado</dc:creator><description>&lt;p&gt;For those who need _ to know that it&amp;#39;s a field, how do you know when you are accessing a local varible or a parameter?&lt;/p&gt;
&lt;p&gt;I really can&amp;#39;t understand the use of &amp;quot;m_&amp;quot; in .NET.&lt;/p&gt;
&lt;p&gt;If you need to prefix stuff, why nhot go all the way?&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msmvps.com/blogs/paulomorgado/archive/2007/05/20/naming-conventions-for-c.aspx"&gt;msmvps.com/.../naming-conventions-for-c.aspx&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641562" width="1" height="1"&gt;</description></item><item><title>re: C# style conventions: more religious wars coming!</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/07/15/c-style-conventions-more-religious-wars-coming.aspx#1641557</link><pubDate>Sun, 20 Jul 2008 21:30:37 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641557</guid><dc:creator>luisabreu</dc:creator><description>&lt;p&gt;I don&amp;#39;t use hungarian either (altough I think that &amp;nbsp;the definition of hungarian notation would be another interesting &amp;quot;religious war&amp;quot; post), but I prefer to use the _ convention to the this convention. As I said, it&amp;#39;s all about personal style :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641557" width="1" height="1"&gt;</description></item><item><title>re: C# style conventions: more religious wars coming!</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/07/15/c-style-conventions-more-religious-wars-coming.aspx#1641546</link><pubDate>Sun, 20 Jul 2008 14:51:46 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641546</guid><dc:creator>Giovanni Bassi</dc:creator><description>&lt;p&gt;Just as Le Roy said, I don&amp;#39;t like hungarian. I actually used it a lot before, but I have changed my mind, because the code gets less readable (in my opinion).&lt;/p&gt;
&lt;p&gt;Regarding &amp;quot;_&amp;quot;, I do use it, but I have also been using &amp;quot;this&amp;quot; to prefix the field names, just because it gets clearer. The same thing to point to class names outside the assembly: I use the &amp;quot;usings&amp;quot; directive quite carefully, because I want to know where that class comes from, most of the time. Unless the namespace is just really big, then an alias usually solves the problem.&lt;/p&gt;
&lt;p&gt;Now, with this post from StyleCop you pointed, I am considering dropping the &amp;quot;_&amp;quot;, because it makes sense if I am already using &amp;quot;this&amp;quot;, anyway. The problem is that I might forget to use &amp;quot;this&amp;quot; and end up with the wrong variable... but I think that would be very unlikely.&lt;/p&gt;
&lt;p&gt;And I don&amp;#39;t particularly like the &amp;quot;m_&amp;quot;. Its just ugly and makes the code less readable, just like hungarian (again, in my opinion). Anything that gets it more like human words and less like machine words is worth considering.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641546" width="1" height="1"&gt;</description></item><item><title>re: C# style conventions: more religious wars coming!</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/07/15/c-style-conventions-more-religious-wars-coming.aspx#1641367</link><pubDate>Fri, 18 Jul 2008 18:20:05 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641367</guid><dc:creator>Dave Reed</dc:creator><description>&lt;p&gt;Another reason I dislike NOT having &amp;quot;_&amp;quot; is that a property and its backing field may only differ by the capitalization of the first letter (e.g. Mode and mode). Then, whether or not you use &amp;quot;this&amp;quot;, its quite easy for statement completion to give you the wrong reference without you immediately realizing it, and it gets quite annoying dealing with that.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641367" width="1" height="1"&gt;</description></item><item><title>re: C# style conventions: more religious wars coming!</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/07/15/c-style-conventions-more-religious-wars-coming.aspx#1641334</link><pubDate>Fri, 18 Jul 2008 11:07:08 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641334</guid><dc:creator>luisabreu</dc:creator><description>&lt;p&gt;no comments on that :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641334" width="1" height="1"&gt;</description></item><item><title>re: C# style conventions: more religious wars coming!</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/07/15/c-style-conventions-more-religious-wars-coming.aspx#1641332</link><pubDate>Fri, 18 Jul 2008 10:50:46 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641332</guid><dc:creator>Ollie</dc:creator><description>&lt;p&gt;I bet you like &amp;#39;Regions&amp;#39; as well...&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641332" width="1" height="1"&gt;</description></item><item><title>re: MultiView control: should you use it?</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/02/20/multiview-control-should-you-use-it.aspx#1641219</link><pubDate>Thu, 17 Jul 2008 13:16:20 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641219</guid><dc:creator>luisabreu</dc:creator><description>&lt;p&gt;Again, it depends. suppose you have 2 views. view 1 has some code that hits the db (you&amp;#39;ve put the db cod on the load event of the page) and view 2 has a simple message. If you don&amp;#39;t take care, you&amp;#39;ll have a problem: even though you&amp;#39;re showing the view 2 with the message, the db code will still be run. that&amp;#39;s the problem with the multiview control. This might not be a problem, so, as I&amp;#39;ve said, it all depends on your scenario :) &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641219" width="1" height="1"&gt;</description></item><item><title>re: MultiView control: should you use it?</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/02/20/multiview-control-should-you-use-it.aspx#1641217</link><pubDate>Thu, 17 Jul 2008 13:07:54 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641217</guid><dc:creator>Waleed Eissa</dc:creator><description>&lt;p&gt;Sorry for spamming your blog :) but actually I wanted to say something about the MultiView control. Well, I say it still can be useful depending on how you use it. In my case (as I referred in my previous post) I was looking for a way to keep the markup in the .aspx file, I very often come across having to return some useful message to the user after some action (have a look on my post on asp.net at &lt;a rel="nofollow" target="_new" href="http://forums.asp.net/p/1287319/2490577.aspx"&gt;forums.asp.net/.../2490577.aspx&lt;/a&gt;). So, I say in this case I could put the controls needed for this action in a view and add another view for the success message, and instead of showing/hiding panels I just switch the view, seems good to me and it shouldn&amp;#39;t affect performance as the controls will be loaded anyway when getting and posting the page, what do you think?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641217" width="1" height="1"&gt;</description></item><item><title>re: MultiView control: should you use it?</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/02/20/multiview-control-should-you-use-it.aspx#1641216</link><pubDate>Thu, 17 Jul 2008 13:04:20 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641216</guid><dc:creator>luisabreu</dc:creator><description>&lt;p&gt;Hello again.&lt;/p&gt;
&lt;p&gt;well, you need to break up the views into several user controls. then you&amp;#39;ll be able to load only one view (ie, only one user control that has the html for the &amp;nbsp;view you want to render). do notice that it all depends on your objective. for instance, if your views don&amp;#39;t go to a database to fecth data, then you probably can keep using the multiview control without any problems.&lt;/p&gt;
&lt;p&gt;regarding the spam, I&amp;#39;m using community server which takes care of that for me.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641216" width="1" height="1"&gt;</description></item><item><title>re: MultiView control: should you use it?</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/02/20/multiview-control-should-you-use-it.aspx#1641215</link><pubDate>Thu, 17 Jul 2008 12:50:37 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641215</guid><dc:creator>Waleed Eissa</dc:creator><description>&lt;p&gt;Thanks a lot for your prompt reply but actually I&amp;#39;m not sure I get the answer. How can I load the current view only? Could you give more details please? Also, is there a way to keep the markup in the .aspx file without sacrificing performance?&lt;/p&gt;
&lt;p&gt;BTW, I know it&amp;#39;s completely unrelated to the post, so I&amp;#39;m sorry for asking this, but how do you keep spam out of your blog? I don&amp;#39;t see any captcha in here ..&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641215" width="1" height="1"&gt;</description></item><item><title>re: C# style conventions: more religious wars coming!</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/07/15/c-style-conventions-more-religious-wars-coming.aspx#1641009</link><pubDate>Wed, 16 Jul 2008 00:24:44 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641009</guid><dc:creator>Dave Ward</dc:creator><description>&lt;p&gt;Personally, I&amp;#39;m sticking with &amp;quot;_&amp;quot;. &amp;nbsp;I find that littering code with &amp;quot;this.&amp;quot; is very distracting.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641009" width="1" height="1"&gt;</description></item><item><title>re: MultiView control: should you use it?</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/02/20/multiview-control-should-you-use-it.aspx#1641005</link><pubDate>Tue, 15 Jul 2008 23:27:28 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1641005</guid><dc:creator>luisabreu</dc:creator><description>&lt;p&gt;Well, I&amp;#39;d say no. You&amp;#39;ll have serious problems with the multiview control specially if your views have controls that perform several database calls. in this case, it&amp;#39;s best to have several user controls and only load the current &amp;quot;view&amp;quot; that is shown to the user.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1641005" width="1" height="1"&gt;</description></item><item><title>re: C# style conventions: more religious wars coming!</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/07/15/c-style-conventions-more-religious-wars-coming.aspx#1640999</link><pubDate>Tue, 15 Jul 2008 22:48:01 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1640999</guid><dc:creator>Bertrand Le Roy</dc:creator><description>&lt;p&gt;You&amp;#39;re right that this rule is very debatable and as a matter of facts, our team (ASP.NET) always prefixes private fields (which pretty much maps to fields 1:1 nowadays) with an underscore.&lt;/p&gt;
&lt;p&gt;Now, the hungarian notation or m_, no way.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1640999" width="1" height="1"&gt;</description></item><item><title>re: How to see if a string contains another…</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/07/08/how-to-see-if-a-string-contains-another.aspx#1640945</link><pubDate>Tue, 15 Jul 2008 18:25:29 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1640945</guid><dc:creator>luisabreu</dc:creator><description>&lt;p&gt;hello.&lt;/p&gt;
&lt;p&gt;I love everything about C# 3.0 :) You&amp;#39;ll see that after using them, you cannot live without them. Linq To Objects is simply great, but let&amp;#39;s forget about it for a minute...let&amp;#39;s think about lambda expressions! with it I&amp;#39;m able to write a method in place and let the compiler infer types of parameters and return types. Just by using this expressions, you&amp;#39;ll end up with some pretty cool stuff.&lt;/p&gt;
&lt;p&gt;Do yourself a favor and start using C# 3.0 and then you&amp;#39;ll see what I mean :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1640945" width="1" height="1"&gt;</description></item><item><title>re: How to see if a string contains another…</title><link>http://msmvps.com/blogs/luisabreu/archive/2008/07/08/how-to-see-if-a-string-contains-another.aspx#1640900</link><pubDate>Tue, 15 Jul 2008 14:32:46 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1640900</guid><dc:creator>Waleed Eissa</dc:creator><description>&lt;p&gt;&amp;gt; you simply cannot live without Reflector and C# 3.0!&lt;/p&gt;
&lt;p&gt;I agree with the Reflector part but why C# 3.0? I use C# 2.0 and I&amp;#39;m very comfortable with it (planning to upgrade soon though) .. but initially I have read about the new features and I don&amp;#39;t find any of them really tempting esp. that it still uses CLR 2.0 (but probably I can&amp;#39;t judge correctly as I didn&amp;#39;t use it), so, what do you like about C# 3.0? (may be you&amp;#39;ll encourage me to upgrade even sooner :))&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1640900" width="1" height="1"&gt;</description></item></channel></rss>