﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
  <channel>
    <title>AspNetResources.com articles, news and updates</title>
    <description>Stay tuned for AspNetResources.com updates</description>
    <link>http://aspnetresources.com</link>
    <item>
      <title>Eyes Bigger Than Stomachs</title>
      <link>http://aspnetresources.com/blog/eyes_bigger_than_stomachs.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/eyes_bigger_than_stomachs.aspx</guid>
      <pubDate>Sun, 04 Jan 2009 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;Money has a peculiar property: if you don&amp;#8217;t want or know how to manage it, somebody else will happily to do it for you and play you for fool along the way. As if there was a shortage of Wall Street scandals last year, there&amp;#8217;s always room for one more. I&amp;#8217;m referring to the freshly baked ordeal with Bernard Madoff and his clever scheme of siphoning off billions of dollars.&lt;/p&gt;

&lt;p&gt;In the earlier scandals and the subsequent socialist-style bailouts of financial institutions, stupidity, greed, arrogance, etc, were the token accusations. True, banks are not there for you, only for themselves. However, here&amp;#8217;s something that caught my attention in a recent WaPo article, &lt;a href="http://www.washingtonpost.com/wp-dyn/content/article/2008/12/18/AR2008121804201.html?hpid=topnews"&gt;Madoff Case &amp;#8217;Failures&amp;#8217; Put SEC in Spotlight&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Madoff attracted investors by promising steady returns with almost no risk of losses. He quoted a long-term average return of 1 percent a month and 12 percent a year, according to materials distributed to his clients.&lt;/p&gt;

  &lt;p&gt;It was a spectacular and improbable track record. Measured by a Wall Street ratio that compares risk and reward to evaluate hedge funds, investing with Madoff was more than a sixfold improvement over simply investing in the broad-based Standard &amp;amp; Poor&amp;#8217;s 500-stock index.&lt;/p&gt;

  &lt;p&gt;Michael S. Meade, chief executive of Lampost Financial Group, a
  brokerage and hedge-fund manager, said one client who had invested with Madoff asked him for an evaluation. He investigated, then cautioned the client, saying the results were implausible. The investor remained with Madoff.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Fantastic returns, promises of improbable returns, a warning of a
hedge-fund manager&amp;#8212;and yet people stayed. Eyes bigger than stomachs. Those who ignored big red flags deserve what came to them.&lt;/p&gt;

&lt;p&gt;For hundreds of years, since the &lt;a
href="http://en.wikipedia.org/wiki/Tulip_bubble"&gt;tulip mania&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/South_sea_bubble"&gt;South Sea bubble&lt;/a&gt;, investors have been acting the exact same way. Yet they still fail to understand that nobody is able to predict the future, nobody has consistently produced such improbable returns over a long period of time (Peter Lynch quit too soon to tell), and that there is no such thing as low risk and high return.&lt;/p&gt;

&lt;h2&gt;Become an educated investor&lt;/h2&gt;

&lt;p&gt;Pardon my insistence, but I&amp;#8217;d like to very strongly recommend a couple of outstanding personal finance books. They don&amp;#8217;t contain mysteries of get-rich-quick investments (there aren&amp;#8217;t any); they don&amp;#8217;t list &amp;#8220;10 easy steps&amp;#8221; to comfortable wealth. What they teach you is how the system works and how it&amp;#8217;s been playing you so far.&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;a
    href="http://www.amazon.com/Four-Pillars-Investing-Building-Portfolio/dp/0071385290/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1229827962&amp;amp;sr=8-1"&gt;The
    Four Pillars of Investing&lt;/a&gt; by William Bernstein. Of all personal
    finance books, this one is my favorite. Easy to digest. Balanced on the
    history of investment mood swings throughout history, discussion of risk
    tolerance, and various financial &amp;#8220;vehicles&amp;#8221; at your disposal. A great
    place to start!&lt;/li&gt;
  &lt;li&gt;&lt;a
    href="http://www.amazon.com/Random-Walk-Down-Wall-Street/dp/0393330338/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1229828126&amp;amp;sr=1-1"&gt;A
    Random Walk Down Wall Street&lt;/a&gt; by Burton Malkiel. Once you&amp;#8217;re done with
    the &lt;em&gt;Four Pillars&lt;/em&gt;, put &lt;em&gt;Random Walk&lt;/em&gt; on your reading list.
    It&amp;#8217;s a very thorough look at the financial industry, lots of studies of
    historic performances of various investing strategies, and a lengthier
    overview of securities you can invest in.&lt;/li&gt;
  &lt;li&gt;&lt;a
    href="http://www.amazon.com/Total-Money-Makeover-Financial-Fitness/dp/0785289089/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1229828282&amp;amp;sr=1-1"&gt;The
    Total Money Makeover&lt;/a&gt; by Dave Ramsey. I&amp;#8217;ve listened to Dave Ramsey&amp;#8217;s
    &lt;em&gt;Financial Peace University&lt;/em&gt; live recordings and learned quite a
    bit. I do get annoyed with his motivational speaker style of presenting
    and constant references to The Bible, but I&amp;#8217;m willing to cut him some
    slack: the guy genuinely tries to help.&lt;/li&gt;
  &lt;li&gt;&lt;a
    href="http://www.amazon.com/Fooled-Randomness-Hidden-Chance-Markets/dp/0812975219/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1229828475&amp;amp;sr=1-1"&gt;Fooled
    by Randomness&lt;/a&gt; by Nassim Nicholas Taleb. You can find &lt;a
    href="http://www.aspnetresources.com/blog/strategy_for_discoverers_and_entrepreneurs.aspx"&gt;my
    review of this title here&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Be the master of your own money, or somebody else will. &lt;/p&gt;

&lt;p&gt;Good luck!&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/eyes_bigger_than_stomachs.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?610</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/610.aspx</trackback:ping>
      <slash:comments>0</slash:comments>
    </item>
    <item>
      <title>Book Review: Gotcha Capitalism</title>
      <link>http://aspnetresources.com/blog/gotcha_capitalism_book_review.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/gotcha_capitalism_book_review.aspx</guid>
      <pubDate>Sun, 04 Jan 2009 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;Bob Sullivan&amp;#8217;s &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0345496132/aspnetresourc-20"&gt;Gotcha
Capitalism&lt;/a&gt; begins with an entertaining story of being ripped off by a hot dog vendor in mid-town New York. Having been charged $3, he mentions he works right around the corner at which point the street vendor forks over the rest of the change and apologizes profusely for mistaking him for a tourist.&lt;/p&gt;

&lt;p&gt;I work in NYC and can almost hear their conversation in my head. Next time I wear a &lt;a
href="http://www.nbc.com/Saturday_Night_Live/video/clips/coat-store/805602/"&gt;Beirhoff Bros&lt;/a&gt; ski jacket, perhaps I need to actually count the change.&lt;/p&gt;

&lt;h2&gt;We&amp;#8217;re all tourists&lt;/h2&gt;

&lt;p&gt;We&amp;#8217;re all tourists, every single day. Instead of hot dog vendors, we get ripped off by car rental outlets, banks, insurance companies, airlines, grocery stores, gyms, cell phone and cable companies, etc. An unexpected charge here and there doesn&amp;#8217;t seem like much, but they add up. Some charges,
such as your first cell phone or cable bill, actually cause &lt;em&gt;bottom-line shock&lt;/em&gt;. This is &lt;em&gt;gotcha capitalism&lt;/em&gt; in action:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;An unfair, lawless playing field that&amp;#8217;s replaced American&amp;#8217;s former economic system, the market economy. Hidden fees are its most recognizable characteristic. The system rewards the sneakiest companies, rather than the most efficient companies with the best products.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Airlines. Besides Jet Blue and Southwest, the Deltas of America neither innovate nor improve their horrible service and are hamstrung by antiquated union obligations. The only recourse they see is to levy charges on everything under the sun, all the while providing inferior service. The same goes for U.S. auto makers.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;In the age of the Internet, just-in-time manufacturing, and
  globalization, companies find themselves fighting to keep prices low like
  never before. Their response, almost universally, has been to compensate by
  lying about the true price of things. They&amp;#8217;ve systematically dismantled
  other important market pressures, too, by tricking consumers into long-term
  contracts that virtually end real competition. [&amp;#8230;] They&amp;#8217;ve abandoned
  old-fashioned ideas about consumer loyalty and actually set out to drive
  away consumers their computers identify as less profitable. And they&amp;#8217;ve
  created contracts with typography so small that they&amp;#8217;ve had to make up a
  word&amp;#8212;mouseprint&amp;#8212;to describe it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src="http://aspnetresources.com/images/books/gotcha_cap_cover.jpg" alt="Gotch capitalism" class="framed rai" /&gt;&amp;#8220;Mouseprint&amp;#8221; is where gotchas usually hide. Or the scam is hidden behind cryptic fees. For example, when you shop for mutual funds to invest with for retirement, pay attention to &lt;em&gt;expense ratios&lt;/em&gt;. Even a single percentage point can make a huge difference! The higher the expense ratio, the more active the fund, the more you get ripped off. On these management fees alone Wall Street can pocket 80% of your money; you get only 20%. How&amp;#8217;s that for a fair game?&lt;/p&gt;

&lt;h2&gt;Surrender of privacy&lt;/h2&gt;

&lt;p&gt;One insidious side-effect of various rip-off schemes is your surrender of privacy. While you&amp;#8217;re salivating over a new gizmo, they stuffed the purchase agreement with goodies to rob you of legal options and serve you a rotten deal.&lt;/p&gt;

&lt;p&gt;Bob cites grocery &amp;#8220;loyalty cards&amp;#8221; as one of the effective scams. To sign up for one, you fork over personal information in exchange for savings which don&amp;#8217;t save you anything! As Bob brilliantly puts it, &amp;#8220;No one can tell you
what the future cost will be for the surrender of privacy today.&amp;#8221;&lt;/p&gt;

&lt;h2&gt;The takeaway&lt;/h2&gt;

&lt;p&gt;The book covers a wide range of other ripoff avenues. Even though Bob Sullivan puts a host of disgusting schemes in the spotlight, more are invented every day. With this come a couple of valuable lessons:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Stay free agent&lt;/strong&gt;! This is how I like to roll. I abhor debt and lock-ins. Per author&amp;#8217;s advice, &amp;#8220;avoid long-term contracts as much as possible. Always opt for the shortest contract [when purchasing goods and services]. Companies want to tie you up and then take advantage of you; don&amp;#8217;t let them.&amp;#8221;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Complain&lt;/strong&gt;. The book has sample letters to companies, if you dispute issues directly with them, as well as federal agencies when nothing else works. You need to learn how to complain effectively and whether it makes sense to complain at all. In some cases, you bring doom upon yourself by being inattentive, so even your state Attorney General office won&amp;#8217;t help you. Educate yourself how the system you&amp;#8217;re up against works.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The cover of the book irks me a little. &amp;#8220;Learn how to save $1,000!&amp;#8221; can be easily construed as a false statement. You &lt;strong&gt;will&lt;/strong&gt; save money by staying vigilant, but your mileage will vary.&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/gotcha_capitalism_book_review.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?609</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/609.aspx</trackback:ping>
      <slash:comments>0</slash:comments>
    </item>
    <item>
      <title>Happy Holidays!</title>
      <link>http://aspnetresources.com/blog/happy_holidays_2008.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/happy_holidays_2008.aspx</guid>
      <pubDate>Thu, 25 Dec 2008 19:08:11 GMT</pubDate>
      <description>&lt;p&gt;Whether you put &lt;em&gt;Christ&lt;/em&gt; in Christmas or prefer to think of December 25 as the Roman festival of &lt;a
href="http://www.answers.com/preempt"&gt;Sol Invictus&lt;/a&gt;, I&amp;#8217;d like to wish you happy holidays and the best of luck in the year 2009!&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/happy_holidays_2008.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?608</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/608.aspx</trackback:ping>
      <slash:comments>0</slash:comments>
    </item>
    <item>
      <title>I Swear I Didn't Know I Could Do This!</title>
      <link>http://aspnetresources.com/blog/setting_httpcontext_current_works.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/setting_httpcontext_current_works.aspx</guid>
      <pubDate>Sun, 07 Dec 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;I&amp;#8217;m a big fan of &lt;code&gt;HttpModule&lt;/code&gt;s and &lt;code&gt;HttpHandler&lt;/code&gt;s. Hey, I even created &lt;a
href="http://www.aspnetresources.com/tools/pipeline.aspx"&gt;a tool to
code-gen&lt;/a&gt; those for you! &lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s one gotcha with &lt;code&gt;HttpModule&lt;/code&gt;s: if you invoke code which relies on &lt;code&gt;HttpContext.Current&lt;/code&gt;, it may be null, as in the case of kicking off a timer which lives on its own, separate thread.&lt;/p&gt;

&lt;p&gt;I dug into &lt;code&gt;HttpContext&lt;/code&gt; with Reflector and noticed that the &lt;code&gt;HttpContext.Current&lt;/code&gt; property had a setter. Imagine my surprise when I did the following, and it worked!&lt;/p&gt;

&lt;pre class='coloredcode'&gt;&lt;span class='kwd'&gt;private void&lt;/span&gt; ScheduleCallback (&lt;span class='kwd'&gt;object&lt;/span&gt; state)
{
    &lt;span class='cmt'&gt;// ...&lt;/span&gt;
    HttpContext.Current = state &lt;span class='kwd'&gt;as&lt;/span&gt; HttpContext;
    &lt;span class='cmt'&gt;// ...&lt;/span&gt;
}&lt;/pre&gt;

&lt;p&gt;I don&amp;#8217;t know if I&amp;#8217;m violating anything here, but it functions just fine. I&amp;#8217;ll take that.&lt;/p&gt;

&lt;p&gt;Btw, &lt;a href="http://www.aspnetresources.com/blog/count_your_visitors.aspx"&gt;this post&lt;/a&gt; clarifies what that &lt;code&gt;state&lt;/code&gt; is.&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/setting_httpcontext_current_works.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?607</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/607.aspx</trackback:ping>
      <slash:comments>0</slash:comments>
    </item>
    <item>
      <title>Another (New) Book Is Here!</title>
      <link>http://aspnetresources.com/blog/another_new_book_is_here.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/another_new_book_is_here.aspx</guid>
      <pubDate>Sun, 07 Dec 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;No, I still refuse to undertake writing a book&amp;#8212;takes too long, becomes obsolete too fast, no money in it, etc, etc. But! If you follow this blog on a regular basis, you know what a voracious reader I am.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://aspnetresources.com/images/books/0735625913.jpg" alt="" class="rai framed" /&gt;A few months ago I received an email from Dan Larson (aka &amp;#8220;Father of VI&amp;#8221;) who was writing a book with Microsoft Press. He got excited about the MS AJAX &lt;a href="http://www.aspnetresources.com/blog/ms_ajax_templates_for_codesmith.aspx"&gt;templates
I wrote for CodeSmith&lt;/a&gt; back in November of 2007 (there&amp;#8217;s even &lt;a href="http://www.aspnetresources.com/downloads/Microsoft_AJAX_templates_overview/"&gt;a fancy video&lt;/a&gt;) and fired off an introduction.&lt;/p&gt;

&lt;p&gt;Sometime last week I received a printed copy of Daniel&amp;#8217;s book, &lt;a
href="http://www.amazon.com/exec/obidos/ASIN/0735625913/aspnetresourc-20"&gt;Developing Service-Oriented AJAX Applications on the Microsoft® Platform&lt;/a&gt;. I&amp;#8217;m psyched even though I neither wrote it nor even tech-reviewed it. Just good to know I had some sort of a positive influence.&lt;/p&gt;

&lt;p&gt;And so reading commenseth&amp;#8230;&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/another_new_book_is_here.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?606</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/606.aspx</trackback:ping>
      <slash:comments>0</slash:comments>
    </item>
    <item>
      <title>A Friendly Reminder to Quit Using Method Parameters As Local Variables</title>
      <link>http://aspnetresources.com/blog/method_parameters_as_local_variables.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/method_parameters_as_local_variables.aspx</guid>
      <pubDate>Fri, 28 Nov 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;I see this aberration quote often when I refactor code. I noticed Steve McConnell has it down as a rule in &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0735619670/aspnetresourc-20"&gt;Code Complete&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;It&amp;#39;s dangerous to use parameters passed to a routine as working variables. Use local variables instead.&lt;/blockquote&gt;
&lt;p&gt;Take a look at the following contrived example:&lt;/p&gt;

&lt;pre class='coloredcode'&gt;&lt;span class='kwd'&gt;public int&lt;/span&gt; Sample (&lt;span class='kwd'&gt;int&lt;/span&gt; inputVal)
{
  inputVal = inputVal + GetCurrentMultiplier (inputVal);
  &lt;span class='cmt'&gt;// ...&lt;/span&gt;
  &lt;span class='kwd'&gt;return&lt;/span&gt; inputVal;
}&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;inputVal&lt;/code&gt; parameter loses its meaning and purpose as soon as it&amp;#39;s used (and abused) as a local variable. Refactoring code this like can quickly become a nightmare. A more politically correct way is to actually use a local variable:&lt;/p&gt;

&lt;pre class='coloredcode'&gt;&lt;span class='kwd'&gt;public int&lt;/span&gt; Sample (&lt;span class='kwd'&gt;int&lt;/span&gt; inputVal)
{
  &lt;span class='kwd'&gt;int&lt;/span&gt; workingVal = inputVal;
  workingVal = workingVal + GetCurrentMultiplier (workingVal);
  &lt;span class='cmt'&gt;// ...&lt;/span&gt;
  &lt;span class='kwd'&gt;return&lt;/span&gt; workingVal;
}&lt;/pre&gt;

&lt;blockquote&gt;Assigning the input value to a working variable emphasizes where the value comes from. It eliminates the possibility that a variable from the parameter list will be modified accidentally.&lt;/blockquote&gt;

&lt;p class="note"&gt;I&amp;#39;ll use McConnell&amp;#39;s own excuse here that &lt;code&gt;inputVal&lt;/code&gt; and &lt;code&gt;workingVal&lt;/code&gt; are 
actually terrible names. This is only a drill.&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/method_parameters_as_local_variables.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?605</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/605.aspx</trackback:ping>
      <slash:comments>3</slash:comments>
    </item>
    <item>
      <title>This Must Be the Worst Scrum Book</title>
      <link>http://aspnetresources.com/blog/the_worst_scrum_book.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/the_worst_scrum_book.aspx</guid>
      <pubDate>Fri, 28 Nov 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;Being a very curious person, and to keep up with jargon explosion, I came across &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0735623376/aspnetresourc-20"&gt;The Enterprise and Scrum&lt;/a&gt; 
by Microsoft Press. Picking up bits and pieces on Scrum over the past year, I took this book for a  definitive authority on Scrum education, especially so because it was written by a recognized Scrum expert.&lt;/p&gt;

&lt;p&gt;The sad story about &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0735623376/aspnetresourc-20"&gt;The Enterprise and Scrum&lt;/a&gt; is that the author knows the subject well, but can&amp;#39;t get it across in an intelligible way. This happens often with geek titles.&lt;/p&gt;

&lt;p&gt;The book is more of an endless gallery of success stories of how great Scrum is (and it may as well be). The author jumps right to slinging jargon, drawing tables, presenting diagrams which leaves me merely scratching my head and mumbling in bewilderment, &amp;quot;So what is Scrum and how can I have one of &amp;#39;em kool success stories with it?&amp;quot; Then more success stories with a happy ending, more tables and diagrams&amp;#8230;&lt;/p&gt;

&lt;p&gt;And thus the quest for Scrum enlightenment continues. Can anyone suggest a good, down-to-earth Scrum book?&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/the_worst_scrum_book.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?604</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/604.aspx</trackback:ping>
      <slash:comments>0</slash:comments>
    </item>
    <item>
      <title>The American Flag As Seen By People with Color Blindness</title>
      <link>http://aspnetresources.com/blog/american_flag_color_blindness_simulation.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/american_flag_color_blindness_simulation.aspx</guid>
      <pubDate>Fri, 28 Nov 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;I am a sucker for clever, visual ways of presenting information. Take a look at this combined simulation of color blindness applied to the American flag:&lt;/p&gt;

&lt;p&gt;
&lt;img src="http://aspnetresources.com/images/354px-US_Flag_color_blind.jpg" alt="Color blidness simulation of the US flag" class="framed" /&gt;&lt;/p&gt;

&lt;p&gt;This poster dates back to 1895!&lt;/p&gt;

&lt;p class="note"&gt;Copyright note: the image appears to be in public domain within the Unites States.&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/american_flag_color_blindness_simulation.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?603</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/603.aspx</trackback:ping>
      <slash:comments>1</slash:comments>
    </item>
    <item>
      <title>Color Blindness Simulator Revamped</title>
      <link>http://aspnetresources.com/blog/color_blindness_simulator_revamped.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/color_blindness_simulator_revamped.aspx</guid>
      <pubDate>Fri, 28 Nov 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;It&amp;#8217;s been a while since I touched my online &lt;a
href="http://aspnetresources.com/tools/colorblindness.aspx"&gt;color blindness simulator&lt;/a&gt; (read &lt;a href="http://www.aspnetresources.com/blog/color_blidness_simulator_announced.aspx"&gt;this post from 2005&lt;/a&gt; for an overview of types of color blindness my tool supports and the algorithms behind it). Unfortunately, an elusive bug lurked in the
calculations: once in a blue moon the tool would throw an exception on an integer overflow. I could never reproduce it or find the flaw in calculations.&lt;/p&gt;

&lt;p&gt;Two readers of my blog asked to share the simulator as a stand-alone component. This prompted me to hunt down a more correct algorithm which is actually used in &lt;a href="http://www.gimp.org/"&gt;GIMP&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As an added benefit, the color blindness module I ported from GIMP also handles &lt;strong&gt;tritanopia&lt;/strong&gt; (inability to discern blue and yellow). While at it, I heavily refactored my old, procedural code and extracted the simulator into a component of it own, as my readers requested. Feel free to grab &lt;a href="http://aspnetresources.com/downloads/Color_blindness_simulator.zip"&gt;the source code here&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Take a look at the output of two sample simulations of Toyota Matrix and Denver Airport produced by the new tool:&lt;/p&gt;

&lt;p&gt;&lt;img alt="Color blindness sumilation of Toyota Matrix" src="http://aspnetresources.com/images/Matrices_simulation.jpg" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img alt="Color blindness simulation of the Denver Airport" src="http://aspnetresources.com/images/Denver_airport_simulation.jpg" /&gt;&lt;/p&gt;

&lt;p&gt;Looking forward to your feedback!&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/color_blindness_simulator_revamped.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?602</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/602.aspx</trackback:ping>
      <slash:comments>2</slash:comments>
    </item>
    <item>
      <title>A Tale of Two Page Hits</title>
      <link>http://aspnetresources.com/blog/a_tale_of_two_page_hits.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/a_tale_of_two_page_hits.aspx</guid>
      <pubDate>Thu, 20 Nov 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;I keep falling into this trap. If you see the phenomenon of a page being hit twice on a single request, read the following:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://aspnetresources.com/blog/page_events_raised_twice.aspx"&gt;Page Events Raised Twice&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="http://www.aspnetresources.com/blog/wap_resets_autoeventwireup.aspx"&gt;Conversion to Web Application Project Resets AutoEventWireup&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the same vein: &lt;a href="http://www.aspnetresources.com/articles/event_handlers_in_global_asax.aspx"&gt;Session_Start or Session_OnStart?&lt;/a&gt;.&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/a_tale_of_two_page_hits.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?601</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/601.aspx</trackback:ping>
      <slash:comments>0</slash:comments>
    </item>
    <item>
      <title>More On Singletons, Locking, and Thread Safety</title>
      <link>http://aspnetresources.com/blog/More On Singletons, Locking, and Thread Safety.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/More On Singletons, Locking, and Thread Safety.aspx</guid>
      <pubDate>Wed, 19 Nov 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;Old &lt;a href="http://www.aspnetresources.com/blog/ms_pag_still_doesnt_understand_singleton.aspx"&gt;P&amp;amp;P&lt;/a&gt; documentation on singletons used to have an example along these lines:&lt;/p&gt;

&lt;pre class='coloredcode'&gt;&lt;span class='kwd'&gt;public sealed class&lt;/span&gt; Singleton
{
    &lt;span class='kwd'&gt;private static&lt;/span&gt; Singleton instance;

    &lt;span class='kwd'&gt;private&lt;/span&gt; Singleton () { }

    &lt;span class='kwd'&gt;public static&lt;/span&gt; Singleton GetInstance ()
    {
        &lt;span class='kwd'&gt;lock&lt;/span&gt; (&lt;span class='kwd'&gt;typeof&lt;/span&gt; (Singleton))
        {
            &lt;span class='kwd'&gt;if&lt;/span&gt; (instance == &lt;span class='kwd'&gt;null&lt;/span&gt;)
                instance = &lt;span class='kwd'&gt;new&lt;/span&gt; Singleton ();
        }
        &lt;span class='kwd'&gt;return&lt;/span&gt; instance;
    }
}
&lt;/pre&gt;

&lt;p&gt;Bill Wagner, in his excellent book &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0321485890/aspnetresourc-20"&gt;More Effective C#&lt;/a&gt;, has a code snip which exhibits a similar issue:&lt;/p&gt;

&lt;pre class='coloredcode'&gt;&lt;span class='kwd'&gt;public class&lt;/span&gt; LockingExample
{
    &lt;span class='kwd'&gt;public void&lt;/span&gt; MyMethod()
    {
        &lt;span class='kwd'&gt;lock&lt;/span&gt; (&lt;span class='kwd'&gt;this&lt;/span&gt;)
        {
            &lt;span class='cmt'&gt;// ... do work ...&lt;/span&gt;
        }
    }
}&lt;/pre&gt;


&lt;p&gt;The trouble here comes from locking on &lt;code&gt;this&lt;/code&gt; or
&lt;code&gt;typeof (Singleton)&lt;/code&gt;. Eons ago, &lt;a href="http://www.aspnetresources.com/blog/jeffrey_richter_training2.aspx"&gt;Jeffrey
Richter&lt;/a&gt; (whom I admire greatly) wrote an epic article on &lt;a
href="http://msdn.microsoft.com/en-us/magazine/cc188793.aspx"&gt;safe thread synchronization&lt;/a&gt; which describes in great detail what exactly the trouble is and how to circumvent it. Pay close attention to sections &lt;strong&gt;Synchronizing Static Members the Microsoft Way&lt;/strong&gt; and &lt;strong&gt;Why the Great Idea isn&amp;#8217;t So Great&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Something very wicked happens when you lock on a value type
(&lt;code&gt;bool&lt;/code&gt;, &lt;code&gt;int&lt;/code&gt;, etc): it gets boxed! This leads to all kinds of trouble dissected in section &lt;strong&gt;Unboxed Instances of Value Types&lt;/strong&gt;.&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/More On Singletons, Locking, and Thread Safety.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?600</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/600.aspx</trackback:ping>
      <slash:comments>3</slash:comments>
    </item>
    <item>
      <title>A Funny Exchange</title>
      <link>http://aspnetresources.com/blog/a_funny_exchange.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/a_funny_exchange.aspx</guid>
      <pubDate>Wed, 19 Nov 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;Many places around New York City require you to sign in and present a photo ID to walk past the front desk. Here&amp;#8217;s a conversation I witnessed recently.&lt;/p&gt;

&lt;div&gt;
&lt;p&gt;&lt;cite&gt;Delivery guy&lt;/cite&gt;: Cookie?&lt;/p&gt;
&lt;p&gt;&lt;cite&gt;Security guy&lt;/cite&gt;: Huh?&lt;/p&gt;
&lt;p&gt;&lt;cite&gt;Delivery guy&lt;/cite&gt;: Cookie?&lt;/p&gt;
&lt;p&gt;&lt;cite&gt;Security guy&lt;/cite&gt;: Whaaat?&lt;/p&gt;
&lt;p&gt;&lt;cite&gt;Delivery guy&lt;/cite&gt;: Is your name Cookie?&lt;/p&gt;
&lt;p&gt;&lt;cite&gt;Security guy&lt;/cite&gt;: No! My name is Kofi.&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Picture the delivery guy&amp;#8217;s face. I could barely hold my laughter.&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/a_funny_exchange.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?599</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/599.aspx</trackback:ping>
      <slash:comments>1</slash:comments>
    </item>
    <item>
      <title>jQuery(Sulky)</title>
      <link>http://aspnetresources.com/blog/jquery_sulky.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/jquery_sulky.aspx</guid>
      <pubDate>Wed, 19 Nov 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;You know how you find a nice, secluded, family beach/park/etc&amp;#8230;&lt;/p&gt;

&lt;p&gt;And then a local reporter stumbles upon and writes an article about it&amp;#8230;&lt;/p&gt;

&lt;p&gt;And then the beach/park gets crowded and littered and loses its nice, secluded feel?&lt;/p&gt;

&lt;p&gt;This is how I feel about &lt;a href="http://www.aspnetresources.com/blog/choosing_a_toolkit_for_serious_dom_manipulation.aspx" title="Choosing a toolkit for serious DOM manipulation"&gt;jQuery&lt;/a&gt; right now. *sigh*&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/jquery_sulky.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?598</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/598.aspx</trackback:ping>
      <slash:comments>3</slash:comments>
    </item>
    <item>
      <title>Microsoft PAG Still Doesn't Understand Singleton</title>
      <link>http://aspnetresources.com/blog/ms_pag_still_doesnt_understand_singleton.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/ms_pag_still_doesnt_understand_singleton.aspx</guid>
      <pubDate>Tue, 18 Nov 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;When I was starting out in .NET a while ago, I used to read architectural &amp;#8220;guidance&amp;#8221; put out by Microsoft&amp;#8217;s very own Patterns &amp;amp; Practices group. Back then, the guidance was sound enough because we were all in the same boat. However, as years went by, the proverbial &amp;#8220;community&amp;#8221; took the lead on architectural innovation, and P&amp;amp;P has been playing lame catch ever since.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s one thing I clearly remember from old P&amp;amp;P documentation: they never understood the &lt;a href="http://en.wikipedia.org/wiki/Singleton_pattern"&gt;Singleton
pattern&lt;/a&gt;. Really, there&amp;#8217;s nothing extremely complicated about Singleton, but the big gotcha is &lt;strong&gt;thread safety&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;Via the mighty &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/11/06/nov-6th-links-asp-net-asp-net-ajax-jquery-asp-net-mvc-silverlight-and-wpf.aspx"&gt;ScottGu&lt;/a&gt;
cometh think link: &lt;a href="http://www.developerfusion.com/article/8307/aspnet-patterns-every-developer-should-know/"&gt;ASP.NET Patterns Developers Should Know&lt;/a&gt; by Alex Homer from the Patterns and Practices (PAG) team at Microsoft. Take a look at the implementation of the &lt;a href="http://www.developerfusion.com/article/8307/aspnet-patterns-every-developer-should-know/2/"&gt;Singleton pattern&lt;/a&gt;. As my good friend Don the &lt;del&gt;Plumber&lt;/del&gt; XML points out, IT&amp;#8217;S NOT THREAD SAFE.&lt;/p&gt;

&lt;p&gt;Amazing that PAG still doesn&amp;#8217;t get it. Wait, no, they kind of do if you look at &lt;a href="http://msdn.microsoft.com/en-us/library/ms998558.aspx"&gt;this code&lt;/a&gt; on the PAG site. Or at least they get double-locking, but don&amp;#8217;t list &lt;a href="http://www.yoda.arachsys.com/csharp/singleton.html"&gt;two other
important implementations&lt;/a&gt;. Can you, guys, talk to each other before you write something as embarrassing?&lt;/p&gt;

&lt;p&gt;Normally, I would quietly refactor into a proper singleton and put a
comment upon check-in, but when this snake oil is presented for sound guidance I have issues with that.&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/ms_pag_still_doesnt_understand_singleton.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?597</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/597.aspx</trackback:ping>
      <slash:comments>1</slash:comments>
    </item>
    <item>
      <title>Managed Extensions Framework (MEF) Looks Interesting</title>
      <link>http://aspnetresources.com/blog/mef_looks_interesting.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/mef_looks_interesting.aspx</guid>
      <pubDate>Mon, 17 Nov 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;When Brad Abrams posted a &lt;a href="http://blogs.msdn.com/brada/archive/2008/09/29/simple-introduction-to-composite-applications-with-the-managed-extensions-framework.aspx"&gt;Simple
Introduction to Extensible Applications with the Managed Extensions
Framework&lt;/a&gt;, I read it and thought, &amp;#8220;What a monstrosity.&amp;#8221; &lt;/p&gt;

&lt;p&gt;Then I read it again, and it made more sense. &lt;/p&gt;

&lt;p&gt;Then I watched a recording of Glenn Block&amp;#8217;s &lt;a
href="http://channel9.msdn.com/pdc2008/TL33/"&gt;MEF talk at PDC 2008&lt;/a&gt;, and it made even more sense.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/brada/archive/2008/11/07/managed-extensibility-framework-mef-demo.aspx"&gt;Brad also points&lt;/a&gt; to ScottGu&amp;#8217;s MEF keynote from PDC, which I haven&amp;#8217;t seen yet, but all this whets my appetite in a big way. I don&amp;#8217;t think we&amp;#8217;re going to see a mega-battle of &lt;a
href="http://martinfowler.com/articles/injection.html"&gt;IoC (Inversion of
Control) containers&lt;/a&gt;, though, because MEF is a different beast.&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/mef_looks_interesting.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?596</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/596.aspx</trackback:ping>
      <slash:comments>0</slash:comments>
    </item>
    <item>
      <title>The Very Handy "Using" Statement</title>
      <link>http://aspnetresources.com/blog/the_very_handy_using_statement.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/the_very_handy_using_statement.aspx</guid>
      <pubDate>Mon, 17 Nov 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;I&amp;#8217;ve lost count how many times I had to refactor code that looks like this:&lt;/p&gt;

&lt;pre class='coloredcode'&gt;SqlConnection conn = &lt;span class='kwd'&gt;new&lt;/span&gt; SqlConnection (...);
SqlCommand cmd = &lt;span class='kwd'&gt;new&lt;/span&gt; SqlCommand (...);
&lt;span class='cmt'&gt;// ...&lt;/span&gt; 
conn.Open();
cmd.ExecuteNonQuery ();
&lt;span class='cmt'&gt;// ...&lt;/span&gt;
&lt;/pre&gt; 

&lt;p&gt;I rejoice if such code has &lt;code&gt;conn.Close()&lt;/code&gt; at the end. What happens if an exception is thrown in &lt;code&gt;ExecuteNonQuery()&lt;/code&gt;, for example? Your database connection stays open for a while because, well, nothing closed it. Keep doing this, and you exhaust SQL Server&amp;#8217;s connection
pool. Besides leaking resources, your application becomes unresponsive.&lt;/p&gt;

&lt;p&gt;There&amp;#8217;s an easy way out: the &lt;code&gt;using&lt;/code&gt; statement (&lt;a href="http://msdn.microsoft.com/en-us/library/yh598w02.aspx"&gt;MSDN&lt;/a&gt;):&lt;/p&gt;

&lt;pre class='coloredcode'&gt;&lt;span class='kwd'&gt;using&lt;/span&gt; (SqlConnection conn = &lt;span class='kwd'&gt;new&lt;/span&gt; SqlConnection (...))
&lt;span class='kwd'&gt;using&lt;/span&gt; (SqlCommand cmd = &lt;span class='kwd'&gt;new&lt;/span&gt; SqlCommand (...))
{
    &lt;span class='cmt'&gt;// ...&lt;/span&gt; 
    conn.Open();
    cmd.ExecuteNonQuery ();
    &lt;span class='cmt'&gt;// ...&lt;/span&gt; 
}&lt;/pre&gt; 

&lt;p&gt;The code above expands into something like this (&amp;#8220;note the extra curly braces to create the limited scope for the object&amp;#8221;):&lt;/p&gt;

&lt;pre class='coloredcode'&gt;{
    SqlConnection conn = &lt;span class='kwd'&gt;new&lt;/span&gt; SqlConnection (...);
    &lt;span class='kwd'&gt;try&lt;/span&gt; 
    {
        SqlCommand cmd = &lt;span class='kwd'&gt;new&lt;/span&gt; SqlCommand (...);
        &lt;span class='kwd'&gt;try&lt;/span&gt; 
        {
            conn.Open();
            cmd.ExecuteNonQuery();
        }
        &lt;span class='kwd'&gt;finally&lt;/span&gt; 
        {
          &lt;span class='kwd'&gt;if&lt;/span&gt; (cmd != &lt;span class='kwd'&gt;null&lt;/span&gt;)
              cmd.Dispose ();
        }
    }
    &lt;span class='kwd'&gt;finally&lt;/span&gt; 
    {
      &lt;span class='kwd'&gt;if&lt;/span&gt; (conn != &lt;span class='kwd'&gt;null&lt;/span&gt;)
          conn.Dispose ();
    }
}&lt;/pre&gt;

&lt;p&gt;In other words, you get a &lt;code&gt;try-finally&lt;/code&gt; block for free. You still end up with an exception (notice the lack of &lt;code&gt;catch&lt;/code&gt; there?), but the &lt;code&gt;finally&lt;/code&gt; clause is guaranteed to dispose of expensive resources properly. &lt;/p&gt;

&lt;p class="note"&gt;Naturally, this trick works only with classes which implement
&lt;code&gt;IDisposable&lt;/code&gt;. However, &lt;code&gt;IDisposable&lt;/code&gt; comes with a lot of baggage, so don&amp;#8217;t rush to implement it all over the place.&lt;/p&gt;

&lt;p&gt;As a side benefit, calling &lt;code&gt;Dispose()&lt;/code&gt; on
&lt;code&gt;SqlConnection&lt;/code&gt; also closes it.&lt;/p&gt;

&lt;p&gt;To me, this is unwelcome coupling because it exposes me to the inner workings of the &lt;code&gt;SqlConnection&lt;/code&gt; class&amp;#8212;something I shouldn&amp;#8217;t worry about. If I call a method, thinking, &amp;#8220;Oh, and it also calls Xxxxx() inside&amp;#8221;, I see it as bad API design.&lt;/p&gt;

&lt;h2&gt;A neat trick&lt;/h2&gt;

&lt;p&gt;Here&amp;#8217;s a neat trick I picked up from Bill Wagner&amp;#8217;s &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0321485890/aspnetresourc-20"&gt;More Effective C#&lt;/a&gt;. Look at this code:&lt;/p&gt;

&lt;pre class='coloredcode'&gt;&lt;span class='kwd'&gt;public void&lt;/span&gt; GetThingsDone ()
{
  T driver = &lt;span class='kwd'&gt;new&lt;/span&gt; T();
  &lt;span class='kwd'&gt;using&lt;/span&gt; (driver &lt;span class='kwd'&gt;as&lt;/span&gt; IDisposable)
  {
     driver.DoWork();
  }
}&lt;/pre&gt;

&lt;p&gt;In Bill&amp;#8217;s words:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The compiler creates a hidden local variable that stores a reference to the driver cast as an &lt;code&gt;IDisposable&lt;/code&gt;. If &lt;code&gt;T&lt;/code&gt; does not implement &lt;code&gt;IDisposable&lt;/code&gt;, then the value of the local variable is null. In those cases, the compiler does not call &lt;code&gt;Dispose()&lt;/code&gt;, because it checks against null before doing extra work. However, in all cases
where &lt;code&gt;T&lt;/code&gt; implements &lt;code&gt;IDisposable&lt;/code&gt;, the compiler generates a call to the &lt;code&gt;Dispose()&lt;/code&gt; method upon exiting the &lt;code&gt;using&lt;/code&gt; block.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We saw the null check in &lt;code&gt;finally&lt;/code&gt; above, but the interesting point here is that if a soft cast of &lt;code&gt;IDisposable&lt;/code&gt; produces a null, the compiler just bails. Pretty cool!&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/the_very_handy_using_statement.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?595</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/595.aspx</trackback:ping>
      <slash:comments>3</slash:comments>
    </item>
    <item>
      <title>Book Review: Clean Code</title>
      <link>http://aspnetresources.com/blog/clean_code_book_review.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/clean_code_book_review.aspx</guid>
      <pubDate>Sun, 12 Oct 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;The latest book by Bob Martin, &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0132350882/aspnetresourc-20"&gt;Clean
Code&lt;/a&gt;, is a cross between Steve McConnell&amp;#8217;s &lt;a
href="http://www.amazon.com/exec/obidos/ASIN/0735619670/aspnetresourc-20"&gt;Code Complete&lt;/a&gt;, Martin Fowler&amp;#8217;s &lt;a
href="http://www.aspnetresources.com/blog/refactoring_book_review.aspx"&gt;Refactoring&lt;/a&gt;,
Joshua Kerievsky&amp;#8217;s &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0321213351/aspnetresourc-20"&gt;Refactoring
to Patterns&lt;/a&gt;, with some tidbits of Kent Beck&amp;#8217;s &lt;a
href="http://aspnetresources.com/blog/implementation_patterns_book_review.aspx"&gt;Implementation
Patterns&lt;/a&gt;. About a year ago I reviewed another book my Bob Martin, &lt;a href="http://aspnetresources.com/blog/agile_principles_book_review.aspx"&gt;Agile Software Development, Principles, Patterns, and Practices&lt;/a&gt; which goes over
such important concepts as SRP, OCP, the Liskov Substitution  Principle, IoC. You meet these usual suspects again in &lt;strong&gt;Clean Code&lt;/strong&gt;, so it really helps to know them. You can &lt;a
href="http://www.objectmentor.com/resources/articles/Principles_and_Patterns.pdf"&gt;read up on them here&lt;/a&gt; (PDF).&lt;/p&gt;

&lt;h2&gt;The good stuff&lt;/h2&gt;

&lt;p&gt;The book starts off with a philosophical discourse about what clean code &lt;em&gt;is&lt;/em&gt;, the benefits of maintaining such code, its power to communicate, etc. The book tries to answer such tough perennial questions as, &lt;em&gt;How do you name a method, class, variable, etc?&lt;/em&gt; I don&amp;#8217;t know anyone who doesn&amp;#8217;t struggle with this. The guidance is presented forcefully, with no excuses&amp;#8212;take it or
leave it, and feel free to disagree (I did, at times).&lt;/p&gt;

&lt;p&gt;Here are some key points that resonated with me the most:&lt;/p&gt;

&lt;h3&gt;Command query separation (Chapter 3)&lt;/h3&gt;

&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Command_query_separation"&gt;This rule states&lt;/a&gt; that &amp;#8220;every method should either be a command that performs an action, or a query that returns data to the caller, but not both.&amp;#8221; Or, as the author puts it, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;Functions should either do something or answer something, but not both. Either your function should change the state of an object, or it should return some information about that object. Doing both often leads to confusion.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For example, if a &lt;code&gt;SetXxxx&lt;/code&gt; method on a class returns something, what is that return value? Can you easily tell? And why is there a return value at all? Is the method performing one too many actions? I&amp;#8217;ve seen too many APIs which I had to look up in the docs because the signature was both a command and a query.&lt;/p&gt;

&lt;h3&gt;Have no side effects (Chapter 3)&lt;/h3&gt;

&lt;p&gt;Bob Martin puts it very succinctly: &amp;#8220;Side effects are lies.&amp;#8221; Indeed, &lt;a href="http://en.wikipedia.org/wiki/Side_effect_(computer_science)"&gt;side effects&lt;/a&gt; are insidious. &amp;#8220;Uncle Bob&amp;#8221; cites an example of a &lt;code&gt;checkPassword&lt;/code&gt; method which is supposed to validate user credentials. Upon successful validation, though, the method also initializes a user session! Now, two problems: 1) the method is unfocused, and 2) the signature does not advertise the side effect (it other words, it&amp;#8217;s lying).&lt;/p&gt;

&lt;h3&gt;Prefer exceptions to returning error codes (Chapters 3 and 7)&lt;/h3&gt;

&lt;p&gt;Here&amp;#8217;s an interesting angle I&amp;#8217;ve never thought of before:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;Returning error codes from command functions is a subtle violation of command query separation. It promotes commands being used as expressions in the predicates of &lt;code&gt;if&lt;/code&gt; statements:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;if (deletePage (page) == E_OK)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This does not suffer from verb/adjective confusion but does lead to deeply nested structures. When you return an error code, you create the problem that the caller must deal with the error immediately.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I agree. &lt;code&gt;Try/catch&lt;/code&gt; blocks can get ugly and clutter code, as &amp;#8220;Uncle Bob&amp;#8221; rightfully points out. Therefore it makes sense to extract code inside &lt;code&gt;try/catch&lt;/code&gt; blocks into methods of their own.&lt;/p&gt;

&lt;p&gt;As a bonus, Michael Feathers delivers an authoritative opinion against checked exceptions in Java.&lt;/p&gt;

&lt;h3&gt;Comments do not make up for bad code (Chapter 4)&lt;/h3&gt;

&lt;p&gt;Generally, your code should explain itself. The majority of comments are poisonous refuse and clutter. The discussion in this chapter goes above and beyond this soundbite.&lt;/p&gt;

&lt;h2&gt;The fluff&lt;/h2&gt;

&lt;p&gt;Bob Martin doesn&amp;#8217;t seem to know when to stop. &lt;strong&gt;Clean Code&lt;/strong&gt; has too much dead weight for my taste. &lt;a href="http://aspnetresources.com/blog/agile_principles_book_review.aspx"&gt;His other book&lt;/a&gt; I mentioned was like that, too. The sample code is all Java. There is a chapter on JUnit internals, which I found boring to tears. &lt;/p&gt;

&lt;p&gt;Then, there&amp;#8217;s a chapter on step-by-step refactoring of a
&lt;code&gt;SerialDate&lt;/code&gt; class. The entire listing is printed in the back of the book, in small font, with tests and everything. Now, come on! Have trouble sleeping? Here, read the listing.&lt;/p&gt;

&lt;p&gt;Finally, there&amp;#8217;s a chapter and an appendix on concurrency. These two have nothing to do with the scope of the book itself. It beats me why they have been included. Wait&amp;#8230; Say what? The publisher wanted padding? That explains
it.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Overall, this is a good book. Poor typography, awful drawings, and typos aside, I&amp;#8217;ve found some good ideas in there. The book is unfocused, though, so your mileage may vary.&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/clean_code_book_review.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?594</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/594.aspx</trackback:ping>
      <slash:comments>1</slash:comments>
    </item>
    <item>
      <title>In Love With Complexity</title>
      <link>http://aspnetresources.com/blog/in_love_with_complexity.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/in_love_with_complexity.aspx</guid>
      <pubDate>Sun, 05 Oct 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;I have just finished reading &lt;a href="http://www.amazon.com/exec/obidos/ASIN/1401303013/aspnetresourc-20"&gt;Simplexity&lt;/a&gt;
by Jeffrey Kluger, a senior editor and writer for &lt;em&gt;Time&lt;/em&gt; magazine. The full title of the book is &lt;strong&gt;Simplexity: Why Simple Things Become Complex (and How Complex Things Can Be Made Simple)&lt;/strong&gt;. This is precisely the kind of question that&amp;#8217;s been on my mind for a long time.&lt;/p&gt;

&lt;p&gt;One of the arguments I&amp;#8217;ve heard against offering simple solutions is that simple is not &amp;#8220;professional.&amp;#8221; The UI has to look sophisticated, rugged. With lots of buttons to click. The customer wants it, the claim goes.&lt;/p&gt;

&lt;p&gt;Really? I have yet to bump into someone who&amp;#8217;d say, &amp;#8220;Thank you so much for making my life and job more complicated. I really enjoy feeling overwhelmed. Your product gives me all the worry I&amp;#8217;ve hoped for.&amp;#8221;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&amp;#8220;Of course, it&amp;#8217;s not just in the service of customers who ask for
  features that companies keep things complex. It&amp;#8217;s in the service of the balance sheet too.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is what I see happen in the Microsoft world. I tend to agree with people who call Microsoft &amp;#8220;complexity merchants.&amp;#8221; Where simple solutions would&amp;#8217;ve worked, Microsoft produced unwieldy monstrosities that require armies of people to maintain.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.aspnetresources.com/blog/learning_curve_2.aspx"&gt;Same story with books&lt;/a&gt;. Publishers prefer (or some used to, for sure) bigger, thicker books because they seem to convey more value. Never mind it&amp;#8217;s futile to cover every nook and cranny of ASP.NET. Even in 2,000 pages you&amp;#8217;re still only scratching the surface. That&amp;#8217;s not the story a publisher would tell you because it&amp;#8217;s not in the interest of their anonymous, faceless
&amp;#8220;shareholders.&amp;#8221;&lt;/p&gt;

&lt;p&gt;Retailers are this way, too.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&amp;#8220;Many electronics retailers have an understandable interest in telling you, &amp;#8217;The world is too complicated. We&amp;#8217;ll manage all of this for you. [&amp;#8230;] If a line of products came out that didn&amp;#8217;t require professional assistance, you wouldn&amp;#8217;t have to go to the store that said it had the best.&lt;/p&gt;

  &lt;p&gt;[&amp;#8230;] There&amp;#8217;s this whole business built around complexity. It&amp;#8217;s like
  selling something dangerous and then selling the service that makes it less dangerous.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;How simple is simple enough, then?&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&amp;#8220;The design irony, of course, is that if any products ought to confer status, it&amp;#8217;s often not the most complex-looking ones, but the
  simplest-looking ones&amp;#8212;those with their features artfully integrated into the whole rather than stamped and studded all over the outside.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;iPod is cited as an example of such a device. &lt;strong&gt;Simple does not mean primittive.&lt;/strong&gt; I&amp;#8217;m sure iPod is far from primitive on the inside, but it does a good job of hiding complexity from spilling outside.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This&lt;/em&gt;, to me, is pretty close to the Holy Grail of interface design.&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/in_love_with_complexity.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?593</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/593.aspx</trackback:ping>
      <slash:comments>7</slash:comments>
    </item>
    <item>
      <title>Sweet Denial on Wall Street</title>
      <link>http://aspnetresources.com/blog/sweet_denial_on_wall_street.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/sweet_denial_on_wall_street.aspx</guid>
      <pubDate>Mon, 22 Sep 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;Living in close proximity to New York City, you get to see, hear and feel the aftershock of the recent collapse of several financial giants. And while talking heads on financial news networks rant against greed, lack of foresight, deception (look who&amp;#8217;s talking!), I keep thinking of this excerpt from Sh&amp;#x14d;gun:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;How baffling it was that even the most cunning and clever people would frequently see only what they wanted to see, and would rarely look beyond the thinnest of facades. Or they would ignore reality, dismissing it as the facade. And then, when their whole world fell to pieces and they were on their knees &lt;a href="http://en.wikipedia.org/wiki/Seppuku"&gt;slitting their bellies&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/Jigai"&gt;cutting their throats&lt;/a&gt;, or cast out into the freezing world, they would tear their &lt;a href="http://en.wikipedia.org/wiki/Chonmage"&gt;topknots&lt;/a&gt; or rend their clothes and bewail their &lt;em&gt;karma&lt;/em&gt;, blaming gods or &lt;em&gt;&lt;a
href="http://en.wikipedia.org/wiki/Kami"&gt;kami&lt;/a&gt;&lt;/em&gt; or luck or their lords or husbands or vassals&amp;#8212;anything or anyone&amp;#8212;but never themselves.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;</description>
      <comments>http://aspnetresources.com/blog/sweet_denial_on_wall_street.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?592</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/592.aspx</trackback:ping>
      <slash:comments>1</slash:comments>
    </item>
    <item>
      <title>Are you building something awesome and hiring?</title>
      <link>http://aspnetresources.com/blog/are_you_building_something_awesome_and_hiring.aspx</link>
      <guid isPermaLink="true">http://aspnetresources.com/blog/are_you_building_something_awesome_and_hiring.aspx</guid>
      <pubDate>Wed, 03 Sep 2008 00:00:00 GMT</pubDate>
      <description>&lt;p&gt;You are building something awesome. You take pride in your product or service. You hire only the best people you can find. The thought of nine-to-five cubicle life gives you cold sweat. Writing software is a lifestyle but you do have a life outside of office.&lt;/p&gt;

&lt;p&gt;If this is you &lt;em&gt;&lt;strong&gt;and&lt;/strong&gt;&lt;/em&gt; you are hiring, I’d love to hear from you: &lt;a href="mailto:milan@aspnetresources.com"&gt;milan@aspnetresources.com&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/blog/are_you_building_something_awesome_and_hiring.aspx#comments</comments>
      <wfw:commentRss>http://aspnetresources.com/blog/postcomments.aspx?591</wfw:commentRss>
      <trackback:ping>http://aspnetresources.com/blog/trackback/591.aspx</trackback:ping>
      <slash:comments>0</slash:comments>
    </item>
    <item>
      <title>Keeping Pulse on Your Site With ASP.NET 2.0 Health Monitoring</title>
      <link>http://aspnetresources.com/articles/aspnet_2_0_health_monitoring.aspx</link>
      <pubDate>Fri, 23 Mar 2007 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/aspnet_2_0_health_monitoring.aspx</guid>
      <description>One of the best, yet often overlooked, features of ASP.NET 2.0 is &lt;a href="TemplatedMailWebEventProvider"&gt;health monitoring&lt;/a&gt;. I believe it is absolutely essential to be notified of any problems with your web application, and this is where health monitoring comes in handy. A few years ago I wrote an article about &lt;a
href="http://www.aspnetresources.com/articles/CustomErrorPages.aspx"&gt;custom error pages&lt;/a&gt; and demonstrated various ways to tap into error details. Health Monitoring is a natural progression of that approach.</description>
      <comments>http://aspnetresources.com/articles/discuss/aspnet_2_0_health_monitoring.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?121</wfw:commentRss>
    </item>
    <item>
      <title>The Dark Side of File Uploads</title>
      <link>http://aspnetresources.com/articles/dark_side_of_file_uploads.aspx</link>
      <pubDate>Thu, 12 Jan 2006 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/dark_side_of_file_uploads.aspx</guid>
      <description>I saw a December MSDN article, entitled &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/UploadASP2.asp"&gt;Uploading Files in ASP.NET 2.0&lt;/a&gt;, and wanted to offer my comments on some gotchas with uploading files. I&amp;#8217;ve spent countless hours and tried numerous hacks to tame file uploading and have enough bruses from hitting my head against the wall (figuratively speaking).</description>
      <comments>http://aspnetresources.com/articles/discuss/dark_side_of_file_uploads.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?119</wfw:commentRss>
    </item>
    <item>
      <title>Session_Start or Session_OnStart?</title>
      <link>http://aspnetresources.com/articles/event_handlers_in_global_asax.aspx</link>
      <pubDate>Sun, 18 Dec 2005 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/event_handlers_in_global_asax.aspx</guid>
      <description>Ever since I started to develop with ASP.NET, I&amp;#8217;ve been wondering why &lt;strong&gt;global.asa&lt;/strong&gt; from the ASP days quietly moved over to ASP.NET as &lt;strong&gt;global.asax&lt;/strong&gt;. When you look at it, it just feels so outdated, so VBScript-ish, so loosely&amp;#8211;typed. And what is the right way to name event handlers?</description>
      <comments>http://aspnetresources.com/articles/discuss/event_handlers_in_global_asax.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?117</wfw:commentRss>
    </item>
    <item>
      <title>Crafting Lightweight Page Templates with CSS</title>
      <link>http://aspnetresources.com/articles/css_templates.aspx</link>
      <pubDate>Sun, 19 Sep 2004 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/css_templates.aspx</guid>
      <description>Giving your web application a consistent look and feel is a task of paramount importance. Yet, templating in ASP.NET has been complicated, to say the least. Learn how you can craft lightweight, efficient page templates with CSS.</description>
      <comments>http://aspnetresources.com/articles/discuss/css_templates.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?116</wfw:commentRss>
    </item>
    <item>
      <title>Weather Custom Server Control</title>
      <link>http://aspnetresources.com/articles/weather_server_control.aspx</link>
      <pubDate>Sat, 11 Sep 2004 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/weather_server_control.aspx</guid>
      <description>Need a quick and easy way to display weather on your site? Templated custom server controls to the rescue!</description>
      <comments>http://aspnetresources.com/articles/discuss/weather_server_control.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?115</wfw:commentRss>
    </item>
    <item>
      <title>Adding Variables To Style Sheets</title>
      <link>http://aspnetresources.com/articles/variables_in_css.aspx</link>
      <pubDate>Thu, 08 Jul 2004 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/variables_in_css.aspx</guid>
      <description>Even though the spec defines CSS as a style sheet language, this language is missing one of the essential features: variables. Every time I've seen people in newsgroups ask how to implement variables in CSS a typical advice was to build the style sheet on the server. Luckily, it is easy to do in ASP.NET with the help of HTTP Handlers.</description>
      <comments>http://aspnetresources.com/articles/discuss/variables_in_css.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?113</wfw:commentRss>
    </item>
    <item>
      <title>Building Dazzling Charts With Office Web Components</title>
      <link>http://aspnetresources.com/articles/office_web_components.aspx</link>
      <pubDate>Tue, 08 Jun 2004 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/office_web_components.aspx</guid>
      <description>Need to create eye-popping charts in real time and do it at no cost at all? Give Microsoft Office Web Components a try.</description>
      <comments>http://aspnetresources.com/articles/discuss/office_web_components.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?112</wfw:commentRss>
    </item>
    <item>
      <title>Make Every Web Page Printer-Friendly</title>
      <link>http://aspnetresources.com/articles/printer_friendly.aspx</link>
      <pubDate>Wed, 02 Jun 2004 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/printer_friendly.aspx</guid>
      <description>You found an article online and want to print it to nicely punch thee holes on the side and store it with other useful stuff. Almost every site nowadays provides a printer-friendly page of this and that, but some sites don't and you're still stuck with staring at their printed navigation bar, footer, ads, etc, for ever and ever. All this online decor means nothing on paper. How do you strip page parts that are irrelevant for print?</description>
      <comments>http://aspnetresources.com/articles/discuss/printer_friendly.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?111</wfw:commentRss>
    </item>
    <item>
      <title>Beware Of Deploying Debug Code In Production</title>
      <link>http://aspnetresources.com/articles/debug_code_in_production.aspx</link>
      <pubDate>Wed, 05 May 2004 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/debug_code_in_production.aspx</guid>
      <description>You have spent several months developing a killer web application (a web site, perhaps) and the long anticipated release day has come. You deploy the application and take it for a test drive. As you navigate from page to page you notice that each page “thinks” before rendering. What’s going on? Didn’t Microsoft folks promise code compilation and ultra fast execution? Isn’t it why we beat ASP, Java and PHP by such a wide margin?</description>
      <comments>http://aspnetresources.com/articles/discuss/debug_code_in_production.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?109</wfw:commentRss>
    </item>
    <item>
      <title>Bringing CSS2 to Visual Studio.NET</title>
      <link>http://aspnetresources.com/articles/css2_in_vsnet.aspx</link>
      <pubDate>Tue, 27 Apr 2004 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/css2_in_vsnet.aspx</guid>
      <description>Even though the CSS2 Specification has been around since 1998 its support in the Visual Studio line of products has been rather weak. In this article you’ll learn how to enhance IntelliSense in Visual Studio.NET to display CSS2 properties.</description>
      <comments>http://aspnetresources.com/articles/discuss/css2_in_vsnet.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?108</wfw:commentRss>
    </item>
    <item>
      <title>Remastering Web Form Templates</title>
      <link>http://aspnetresources.com/articles/remastering_web_templates.aspx</link>
      <pubDate>Sun, 18 Apr 2004 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/remastering_web_templates.aspx</guid>
      <description>Visual Studio.NET comes with a number of templates for all kinds of coding occasions. The one I'm going to talk about in this article is the one you probably use most often (provided you are an ASP.NET developer): the Web Form template. Default templates suffer from being stuffed with needless markup. In this article we'll analyze what is supposed to be there and learn how to clean them up.</description>
      <comments>http://aspnetresources.com/articles/discuss/remastering_web_templates.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?107</wfw:commentRss>
    </item>
    <item>
      <title>What&amp;#39;s In Your DOCTYPE?</title>
      <link>http://aspnetresources.com/articles/doctype.aspx</link>
      <pubDate>Tue, 13 Apr 2004 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/doctype.aspx</guid>
      <description>&lt;p&gt;When you create a web form in Visual Studio.NET using the canned "Web Form" template you might ask yourself, "What is this DOCTYPE declaration about?"&lt;/p&gt;

&lt;pre&gt;
&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" &amp;gt;
&lt;/pre&gt;

&lt;p&gt;What is this strange-looking beast?&lt;/p&gt;</description>
      <comments>http://aspnetresources.com/articles/discuss/doctype.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?106</wfw:commentRss>
    </item>
    <item>
      <title>ASP.NET State Management: View State</title>
      <link>http://aspnetresources.com/articles/ViewState.aspx</link>
      <pubDate>Sun, 14 Mar 2004 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/ViewState.aspx</guid>
      <description>ASP.NET view state is a great feature and an essential tool for web development of today. It maintains the state of a page as it travels back and forth. There is no more need to worry about restoring values of page controls between postbacks. In this article you will get an in-depth perspective on view state. We will talk about ways of reducing unnecessary payload and protecting view state from prying eyes.</description>
      <comments>http://aspnetresources.com/articles/discuss/ViewState.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?105</wfw:commentRss>
    </item>
    <item>
      <title>Skinning Web Applications with CSS</title>
      <link>http://aspnetresources.com/articles/SkinningWithCSS.aspx</link>
      <pubDate>Sun, 22 Feb 2004 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/SkinningWithCSS.aspx</guid>
      <description>The common approach to skinning web applications lies in reshuffling controls on a page. Traditionally developers define templates with different color schemes and/or control positioning, tables and inline font tags. While this used to be a perfectly viable solution the overhead of run-time application of these skins is staggering. A much better way is to separate skin structure from presentation and let CSS take care of the layout and typography.</description>
      <comments>http://aspnetresources.com/articles/discuss/SkinningWithCSS.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?104</wfw:commentRss>
    </item>
    <item>
      <title>Producing XHTML-Compliant Pages With Response Filters</title>
      <link>http://aspnetresources.com/articles/HttpFilters.aspx</link>
      <pubDate>Fri, 13 Feb 2004 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/HttpFilters.aspx</guid>
      <description>Programming with web standards in mind, although vastly ignored, is becoming more and more important. It almost seems it took too long to promote ASP.NET. Now that we're over the hill and "this stuff works" it is about time to start paying attention to web standards. In this article you will learn how to implement a response filter and plug it into the ASP.NET pipeline. The filter will transform outgoing HTML into XHTML 1.0-compliant markup.</description>
      <comments>http://aspnetresources.com/articles/discuss/HttpFilters.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?101</wfw:commentRss>
    </item>
    <item>
      <title>ASP.NET Custom Error Pages</title>
      <link>http://aspnetresources.com/articles/CustomErrorPages.aspx</link>
      <pubDate>Sun, 01 Feb 2004 00:00:00 GMT</pubDate>
      <guid isPermaLink="true">http://aspnetresources.com/articles/CustomErrorPages.aspx</guid>
      <description>ASP.NET provides a simple yet powerful way to deal with errors that occur in your web applications. We will look at several ways to trap errors and display friendly meaningful messages to users. We will then take the discussion a step further and learn how to be instantly notified about problems so you can cope with them right away. As a geek touch we will also track the path 404's travel.</description>
      <comments>http://aspnetresources.com/articles/discuss/CustomErrorPages.aspx</comments>
      <wfw:commentRss>http://aspnetresources.com/articles/artcomments.aspx?100</wfw:commentRss>
    </item>
  </channel>
</rss>