<?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>Maybe I'm just a little slow...</title><link>http://blogs.msdn.com/alexj/archive/2008/02/29/maybe-i-m-just-a-little-slow.aspx</link><description>But I only just realized that extension methods are cool for avoiding NullReferenceExceptions . We all know that if you have something like this: LicensePlate licensePlate = null ; Car car = licensePlate.Car; It will throw a NullReferenceException . However</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>BioSensorAB &amp;raquo; Maybe I&amp;#8217;m just a little slow&amp;#8230;</title><link>http://blogs.msdn.com/alexj/archive/2008/02/29/maybe-i-m-just-a-little-slow.aspx#7941886</link><pubDate>Fri, 29 Feb 2008 07:43:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7941886</guid><dc:creator>BioSensorAB » Maybe I’m just a little slow…</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.biosensorab.org/2008/02/28/maybe-im-just-a-little-slow/"&gt;http://www.biosensorab.org/2008/02/28/maybe-im-just-a-little-slow/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Maybe I'm just a little slow...</title><link>http://blogs.msdn.com/alexj/archive/2008/02/29/maybe-i-m-just-a-little-slow.aspx#7945277</link><pubDate>Fri, 29 Feb 2008 12:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7945277</guid><dc:creator>MatthieuMEZIL</dc:creator><description>&lt;p&gt;Hello Alex,&lt;/p&gt;
&lt;p&gt;I love it! :-)&lt;/p&gt;
&lt;p&gt;If I remember well, I have readen an article in which they say that in C#4, we will have an operator ?. which do what you do with extension methods.&lt;/p&gt;</description></item><item><title>if != null </title><link>http://blogs.msdn.com/alexj/archive/2008/02/29/maybe-i-m-just-a-little-slow.aspx#7945542</link><pubDate>Fri, 29 Feb 2008 13:15:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7945542</guid><dc:creator>Matthieu MEZIL</dc:creator><description>&lt;p&gt;Qui n'a jamais fait quelque chose comme &amp;#231;a: LicensePlate licensePlate = null ; // R&amp;#233;cup&amp;#233;rer une instance&lt;/p&gt;
</description></item><item><title>re: Maybe I'm just a little slow...</title><link>http://blogs.msdn.com/alexj/archive/2008/02/29/maybe-i-m-just-a-little-slow.aspx#7945786</link><pubDate>Fri, 29 Feb 2008 13:42:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7945786</guid><dc:creator>XIU</dc:creator><description>&lt;p&gt;I made the same method just a few days ago (just called it IfNotNull but Maybe actually sounds better :P). Only difference is that I didn't use the constraint on V.&lt;/p&gt;
&lt;p&gt;public static V Maybe&amp;lt;T, V&amp;gt;(this T t, Func&amp;lt;T, V&amp;gt; selector)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;where T : class&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return t != null ? selector(t) : default(V);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;</description></item><item><title>Vendredi c'est Expression Tree :)</title><link>http://blogs.msdn.com/alexj/archive/2008/02/29/maybe-i-m-just-a-little-slow.aspx#7948644</link><pubDate>Fri, 29 Feb 2008 18:18:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7948644</guid><dc:creator>Michel Perfetti [Miiitch]</dc:creator><description>&lt;p&gt;Que les puristes de la performance soient rassur&amp;#233;s, le reste du post n'est que pour le fun :) En discutant&lt;/p&gt;
</description></item><item><title>re: Maybe I'm just a little slow...</title><link>http://blogs.msdn.com/alexj/archive/2008/02/29/maybe-i-m-just-a-little-slow.aspx#8007504</link><pubDate>Mon, 03 Mar 2008 21:33:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8007504</guid><dc:creator>AlexJ</dc:creator><description>&lt;p&gt;@XUI: obviously great (excuse the self congratulation) minds think alike.&lt;/p&gt;
&lt;p&gt;@Michel: that is pretty cool. &lt;/p&gt;
</description></item><item><title>Maybe there is more</title><link>http://blogs.msdn.com/alexj/archive/2008/02/29/maybe-i-m-just-a-little-slow.aspx#8007706</link><pubDate>Mon, 03 Mar 2008 21:47:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8007706</guid><dc:creator>Meta-Me</dc:creator><description>&lt;p&gt;Michel Prefetti , has taken my little Maybe thingie and taken it a lot further , by using expression&lt;/p&gt;
</description></item><item><title>Maybe there is more</title><link>http://blogs.msdn.com/alexj/archive/2008/02/29/maybe-i-m-just-a-little-slow.aspx#8008030</link><pubDate>Mon, 03 Mar 2008 22:13:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8008030</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;Michel Prefetti , has taken my little Maybe thingie and gone a lot further , by using expression tree&lt;/p&gt;
</description></item><item><title>re: Maybe I'm just a little slow...</title><link>http://blogs.msdn.com/alexj/archive/2008/02/29/maybe-i-m-just-a-little-slow.aspx#8087333</link><pubDate>Fri, 07 Mar 2008 08:22:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8087333</guid><dc:creator>macsgold</dc:creator><description>&lt;p&gt;Eeek, changing the 'intuitive C# behavior' of code will get you into trouble sooner rather than later. &amp;nbsp;If 'acquired intuition' says that x.M() throws a Null ref if x==null then change this behavior at your own risk. &amp;nbsp;If I see a line x.M() I'd feel safe using &amp;quot;x.ToString()&amp;quot; on the next line but your way would make a fool out of me. &amp;nbsp;It should be a golden rule of extension methods: throw null ref if the object is null. &amp;nbsp;One day we may get 'not null object types' but extension are not the answer.&lt;/p&gt;</description></item></channel></rss>