﻿<feed version="0.3" xml:lang="en-US" xmlns="http://purl.org/atom/ns#" 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/"><title>www.AspNetResources.com</title><tagline>ASP.NET With Emphasis On Web Standards</tagline><link rel="alternate" type="text/html" href="http://www.aspnetresources.com" /><author><name>Milan Negovan</name><url>http://www.AspNetResources.com</url></author><modified>2008-04-27T18:35:21Z</modified><entry><title>New Approach to Usability: Annoy Users</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/new_approach_to_usability_annoy_users.aspx" /><id>http://www.aspnetresources.com/blog/new_approach_to_usability_annoy_users.aspx</id><created>2008-04-27T00:00:00Z</created><issued>2008-04-27T00:00:00Z</issued><modified>2008-04-27T18:35:21Z</modified><content type="text/html" mode="escaped">&lt;p&gt;When I saw this article, &lt;a href="http://www.crn.com/software/207100934?cid=CRNFeed"&gt;Microsoft Exec: UAC Designed To &amp;#8217;Annoy Users&amp;#8217;&lt;/a&gt;, (via &lt;a href="http://blogs.sqlxml.org/bryantlikes/archive/2008/04/24/don-t-tell-me-how-to-run-my-laptop.aspx"&gt;Bryant Likes&lt;/a&gt;), I thought, &amp;#8220;Nah, one of those April Fool&amp;#8217;s jokes.&amp;#8221; Then I looked at the date&amp;#8212;April 10&amp;#8212;and realized it wasn&amp;#8217;t a joke. In fact, David Cross is quoted saying:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&amp;#8220;The reason we put UAC into the platform was to annoy users. I&amp;#8217;m serious.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I was floored. First you create buggy operating systems for years and years, they expose people to all kinds of threats, and now you &amp;#8220;fix&amp;#8221; it by&amp;#8230; annoying them?&lt;/p&gt;

&lt;p&gt;Hey, Vista team, great job! I can express my annoyance with your product only in expletives.&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?577</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/577.aspx</trackback:ping><slash:comments>11</slash:comments></entry><entry><title>Communal Decision Making Sucks</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/communal_decision_making_sucks.aspx" /><id>http://www.aspnetresources.com/blog/communal_decision_making_sucks.aspx</id><created>2008-04-24T00:00:00Z</created><issued>2008-04-24T00:00:00Z</issued><modified>2008-04-24T20:17:01Z</modified><content type="text/html" mode="escaped">&lt;p&gt;Here&amp;#8217;s something revolting I&amp;#8217;ve experienced dealing with recently: board of directors. What comes to mind immediately is this excerpt from &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0452286751/aspnetresourc-20"&gt;The Fountainhead&lt;/a&gt;: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;Have you ever known a board to do anything? [&amp;#8230;] A board of directors is one or two ambitious men&amp;#8212;and a lot of ballast. I mean that groups of men are vacuums. Great big empty nothings. They say we can&amp;#8217;t visualize a total nothing. Hell, sit at any committee meeting. The point is only who chooses to fill that nothing.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Focus groups are that way. Committee meetings are that way.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;No work is ever done collectively, by a majority decision. Every creative job is achieved under the guidance of a single individual thought.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This isn&amp;#8217;t a warrant for lack of planning or development discipline. My point is, when you rely on communal decision making, what you get is a Frankendog&amp;#8212;an ugly creature made of patches.&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?576</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/576.aspx</trackback:ping><slash:comments>1</slash:comments></entry><entry><title>Bait Station Ahead</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/bait_station_ahead.aspx" /><id>http://www.aspnetresources.com/blog/bait_station_ahead.aspx</id><created>2008-04-13T00:00:00Z</created><issued>2008-04-13T00:00:00Z</issued><modified>2008-04-16T10:53:33Z</modified><content type="text/html" mode="escaped">&lt;p&gt;Rick is asking, &lt;a href="http://feeds.feedburner.com/~r/RickStrahl/~3/260658614/295840.aspx"&gt;What can you keep in your head?&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This isn&amp;#8217;t going to be &amp;#8220;an open letter to Rick.&amp;#8221; I have a ton of respect for Rick. He runs an honest, helpful blog which pulled me out of a hole on many occasions. His post got me to finally distill my observations and opinions for those who feel the same way. &lt;/p&gt;

&lt;p class="note"&gt;Disclaimer: it took me a day to write this post and two weeks to &amp;#8220;sleep on it.&amp;#8221; I&amp;#8217;m not naming names, pointing fingers, or settling score with anyone. These are general observations. Take them with a grain of salt.&lt;/p&gt;

&lt;h2&gt;What are your goals?&lt;/h2&gt;

&lt;p&gt;It all depends on what you want to do and where you want to be in the long run. In the words of &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0452286751/aspnetresourc-20"&gt;The Fountainhead&lt;/a&gt; protagonist (I will quote the book liberally here),&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;Most of the time will be spent working. I&amp;#8217;ve chosen the work I want to do. If I find no joy in it, then I&amp;#8217;m only condemning myself to sixty years of torture. And I can find the joy only if I do my work in the best way possible to me. But the best is a matter of standards&amp;#8212;and I set my own standards.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Time is a very limited resource. If you spend all your time chasing every technological fad, you&amp;#8217;ll end up nowhere. How do you decide what&amp;#8217;s worth pursuing? Read on.&lt;/p&gt;

&lt;h2&gt;Specialist or generalist?&lt;/h2&gt;

&lt;p&gt;It depends on your worldview. Do you want to be really good at one thing, or know a wide range of subjects in less depth? I prefer to be a generalist, although I know some things much deeper than others. However, it takes a substantial effort to be a generalist. You have to read a lot and keep your ear to the ground.&lt;/p&gt;

&lt;h2&gt;Basics don&amp;#8217;t change (that much)&lt;/h2&gt;

&lt;p&gt;The term &amp;#8220;bubble&amp;#8221; has existed in finances for at least a couple of &lt;strong&gt;centuries&lt;/strong&gt;. In the grand scheme of things, the latest dot-com bubble was nothing new. It had the same age-old mechanisms, and yet a lot of people made a trip to the loony bin.&lt;/p&gt;

&lt;p&gt;Compared to finance, the field of computing is &lt;strong&gt;very&lt;/strong&gt; young. Over the years, the same basic principles migrated from one language to another, yet they stayed mostly the same. If you read Steve McConnell&amp;#8217;s &lt;strong&gt;Code Complete&lt;/strong&gt; and look at the bibliographical references, some of them go way back. &lt;/p&gt;

&lt;p&gt;Knowing technology-agnostic principles of software construction is absolutely essential. The &lt;a href="http://www.nikhilk.net/Personas.aspx"&gt;Mort&lt;/a&gt; crowd doesn&amp;#8217;t get this. They focus on what&amp;#8217;s shiny. At the end of the day, the choice of technology
matters very little. You can do amazing things with Java, .NET, Ruby, Python, etc. Knowing the principles, you will be an outstanding developer regardless of the technological fads.&lt;/p&gt;

&lt;p&gt;A lot of people are stressed out over the torrential downpour of new technologies and tools. Do you have to know them all? No, of course not. What about all those alphas (euphemistically called &amp;#8220;CTPs&amp;#8221;) and betas? Ignore them. I see people who jump on the bandwagon early and rewrite their stuff over and over with each CTP release. If you&amp;#8217;re not yet sick of such a chaotic and unfocused life style&amp;#8212;fine. Otherwise tune out!&lt;/p&gt;

&lt;p&gt;Case in point: a good friend of mine was presenting at a Code Camp not long ago. He tried to explain the Singleton pattern and drew blank stares from the audience. Now, come. On! This is what the drag-and-drop mentality does to you: you miss the essentials.&lt;/p&gt;

&lt;h2&gt;&amp;#8220;Evangelists&amp;#8221; of various stripes and colors&lt;/h2&gt;

&lt;p&gt;The mission of Evangelists (pun fully inteded) is to sell you on some technology and its tooling. They are in the business of converting and bringing you into &amp;#8220;the fold&amp;#8221;. It&amp;#8217;s not about educating you. Have you ever heard an evangelist give a talk on object composition, separation of responsibilities, refactoring, inversion of control, and such? Not likely.&lt;/p&gt;

&lt;p&gt;Microsoft has plenty of marketing dollars to spend, and they do so by way of evangelists creating noise and pitching the latest shiny toy. It&amp;#8217;s marketing, not education. Next thing you know, &lt;a
href="http://weblogs.asp.net/bleroy/archive/2008/03/11/a-case-for-partial-rendering.aspx"&gt;Betrand laments&lt;/a&gt; that book authors badmouth &lt;code&gt;UpdatePanel&lt;/code&gt; for its abysmal performance and resource hogging. Bertrand, you never told us the whole story about its performance implications. You let the marketing gang do
the talking. But smart people filled in the blanks and got pissed off. Do you expect loyalty for sweeping crap under the carpet?&lt;/p&gt;

&lt;p&gt;Understand this relationship. Evangelists are good people, but their priorities are fundamentally different from yours. The better they do their job, the further they will advance within the Microsoft org chart.&lt;/p&gt;

&lt;p&gt;Think about it: you refuse to sign up for an extra credit card when a solicitor calls. But you keep imbibing everything evangelists serve you, whether you need it or not. Why?&lt;/p&gt;

&lt;p&gt;Case in point: Silverlight. In political terms, Microsoft is playing safe here by going to their base (that&amp;#8217;s you) instead of Rich Media professionals (the Flash/AIR crowd). The majority of developers don&amp;#8217;t work with Rich Media, so the bet is that &lt;em&gt;you&lt;/em&gt; &lt;strong&gt;&lt;/strong&gt;will peddle Silverlight in &lt;em&gt;your&lt;/em&gt; company.&lt;/p&gt;

&lt;p&gt;Understand that you&amp;#8217;re being pitched. If you need to master a specific technology, pursue it. Otherwise tune out!&lt;/p&gt;

&lt;h2&gt;Glory hounds&lt;/h2&gt;

&lt;p&gt;Recognize also that there will always be people proclaiming the virtues of a new technology or methodology at the top of their lungs. Not because it&amp;#8217;s good (it may as well be), but because it&amp;#8217;s new and shiny and because they need to generate consulting gigs. Recognize also what keeps them going:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;He&amp;#8217;d see that all his wishes, his efforts, his dreams, his ambitions are motivated by other men. He&amp;#8217;s not really struggling even for material wealth, but for the second-hander&amp;#8217;s delusion&amp;#8212;prestige. A stamp of approval, not his own.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Does it have to stress you out of your wits that there isn&amp;#8217;t enough time in the day to follow each loud voice? &lt;em&gt;I&lt;/em&gt; prefer to &amp;#8220;lead useful, active private [life] in public silence.&amp;#8221; This kind of stress doesn&amp;#8217;t get to me anymore.&lt;/p&gt;

&lt;h2&gt;Certifications&lt;/h2&gt;

&lt;p&gt;In my opinion, certs are meaningless. Don&amp;#8217;t kid yourself: certs do not intend to educate you. Prep books are intended to coach you how to pass exams. Of all geek literature, prep books are the most useless.&lt;/p&gt;

&lt;p&gt;If you ever come to an interview and all they want to see are your certifications, do yourself a favor and walk out. No need to swim in that cesspool.&lt;/p&gt;

&lt;h2&gt;Your name is your brand&lt;/h2&gt;

&lt;p&gt;In them ol&amp;#8217; days, a person could finish high school, go work at the same factory his entire adult life, retire and live on factory pension. Our generation doesn&amp;#8217;t get this luxury. Instead, too many employers of today bemoan the lack of &amp;#8220;loyalty.&amp;#8221; If they only saw their companies were stale and boring they wouldn&amp;#8217;t complain.&lt;/p&gt;

&lt;p&gt;In this day and age, &lt;strong&gt;your name is your brand&lt;/strong&gt;. You don&amp;#8217;t build this brand by joining a crowd of &lt;a href="http://www.nikhilk.net/Personas.aspx"&gt;Morts&lt;/a&gt;. You need to work on your brand. It takes time and effort.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;You know how most people are, they stick to the beaten path, they pay three times the price for the same thing, just to have the trademark. Courage [&amp;#8230;], they lack courage.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And again,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;It&amp;#8217;s the hardest thing in the world&amp;#8212;to do what we want. And it takes the greatest kind of courage.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is, by the way, one of the reasons I don&amp;#8217;t join &amp;#8220;blogging gangs&amp;#8221; (an ensemble of bloggers under one URL). I don&amp;#8217;t want to dilute my brand. Neither do I want to dilute that of others.&lt;/p&gt;

&lt;h2&gt;Where do I go from here?&lt;/h2&gt;

&lt;p&gt;Read good books and blogs. Go to user groups and Code Camps. Take paid training with a reputable company, if you can afford it. Find an angle you like (mine is web standards and usability) and work it. Develop your individuality and your own brand&amp;#8212;your name.&lt;/p&gt;

&lt;p&gt;If you have read to this point, congratulations! You now know what Morts never will.&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?575</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/575.aspx</trackback:ping><slash:comments>4</slash:comments></entry><entry><title>Slides from My Presentation on Usability</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/usability_presentation_slides.aspx" /><id>http://www.aspnetresources.com/blog/usability_presentation_slides.aspx</id><created>2008-04-13T00:00:00Z</created><issued>2008-04-13T00:00:00Z</issued><modified>2008-04-13T18:59:50Z</modified><content type="text/html" mode="escaped">&lt;p&gt;This is a presentation I gave back in March at the &lt;a
href="http://fairfieldwestchester.net/PreviousEvents/tabid/58/Default.aspx"&gt;Connecticut .NET User Group&lt;/a&gt;, and in April at the &lt;a href="http://groups.msn.com/lidotnetusersgroup/general.msnw?action=get_message&amp;amp;mview=0&amp;amp;ID_Message=211&amp;amp;LastModified=4675665030706009826"&gt;Long
Island .NET User Group&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Usability is a subject that is almost never discussed in the Microsoft community so obsessed with drag and drop. &lt;strong&gt;I intend to change this&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve been promoting web standards for the past four years, which led me to a much broader subject of usability. I see it an as umbrella over web standards, UI design, graphics design, copywriting, typography, etc.&lt;/p&gt;

&lt;p&gt;I intend to give this presentation at a couple of upcoming Code Camps. In the meantime, feel free to &lt;a href="http://aspnetresources.com/downloads/Usability%20presentation%20-%20web.pdf"&gt;grab the &amp;#8220;slide deck.&amp;#8221;&lt;/a&gt; I rolled it into a ~7Mb PDF so you wouldn&amp;#8217;t need PowerPoint.&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?574</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/574.aspx</trackback:ping><slash:comments>1</slash:comments></entry><entry><title>Read Good Books to Be a Better Developer</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/read_good_books.aspx" /><id>http://www.aspnetresources.com/blog/read_good_books.aspx</id><created>2008-04-03T00:00:00Z</created><issued>2008-04-03T00:00:00Z</issued><modified>2008-04-04T05:18:20Z</modified><content type="text/html" mode="escaped">&lt;p&gt;Oren has published a list of his &lt;a href="http://www.ayende.com/Blog/archive/2008/03/15/Recommended-Books.aspx"&gt;recommended
reading&lt;/a&gt; and it reminded I wanted to write a post about this for some time. At the bottom on his post, Oren points to an observation that almost none of his books are on a specific technology. Let me come back to this point in a second.&lt;/p&gt;

&lt;p&gt;Remember a &lt;a href="http://www.aspnetresources.com/blog/learning_curve_2.aspx"&gt;picture of my stack of books&lt;/a&gt; from three years ago? As I look at my bookshelf now, I see hardly any of them left. At one point, I simply threw away those huge ADO.NET and ASP.NET volumes. &lt;/p&gt;

&lt;p&gt;I have a nice library of the patterns books (GoF, Fowler, Kerievsky, Chen, etc), and a few MS AJAX books (gotta know your tools, after all). But the rest are along the lines of &lt;strong&gt;Don&amp;#8217;t Make Me Think&lt;/strong&gt;, &lt;a href="http://www.aspnetresources.com/blog/better_usability_with_silverlight_yeah_right.aspx"&gt;Prioritizing
Web Usability&lt;/a&gt;, &lt;a href="http://www.aspnetresources.com/blog/will_erlang_become_the_next_java.aspx"&gt;Programming Erlang&lt;/a&gt;, Code Complete, &lt;a href="http://awww.aspnetresources.com/blog/stop_stealing_sheep_book_review.aspx"&gt;Stop Stealing Sheep&lt;/a&gt;, &lt;a
href="http://www.aspnetresources.com/blog/peopleware_books_review.aspx"&gt;Peopleware&lt;/a&gt;, &lt;strong&gt;Release It!&lt;/strong&gt; (review coming), etc.&lt;/p&gt;

&lt;p&gt;The time came when I noticed I was switching my focus from web standards topics&amp;#8212;CSS, XHTML, JavaScript&amp;#8212;to a much broader topic of usability. Usability is not about how this or that technology functions. It&amp;#8217;s about how people function. The Microsoft camp pays little attention to the aspect of people. This is when I realized those thick volumes you see on the picture on the left weren&amp;#8217;t helpful. They were putting tooling first.&lt;/p&gt;

&lt;p&gt;That&amp;#8217;s just wrong.&lt;/p&gt;

&lt;p&gt;I also realized that to become a better developer you need to lay off of geek literature and read good books. Granted, you need to stay up to date. But try to strike up a conversation with a geek about anything outside of software. Seriously, try it.&lt;/p&gt;

&lt;p&gt;What&amp;#8217;s a good book? It depends on your mindset and world view. Read about typography&amp;#8212;it affects people in powerful ways. Read about accessibility&amp;#8212;gain appreciation for people with disabilities. Read about design&amp;#8212;it&amp;#8217;s about communication and problem solving. Read &lt;strong&gt;Peopleware&lt;/strong&gt; and &lt;strong&gt;Release It!&lt;/strong&gt;. Read &lt;strong&gt;Don&amp;#8217;t Make Me Think&lt;/strong&gt; so you don&amp;#8217;t start or get yourself involved in religious debates.&lt;/p&gt;

&lt;p&gt;My approach is to read one book pertaining to my industry, alternated with a non-geek title.&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?573</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/573.aspx</trackback:ping><slash:comments>4</slash:comments></entry><entry><title>The Best Design Coding Guidelines Ever</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/best_design_coding_guidelines_ever.aspx" /><id>http://www.aspnetresources.com/blog/best_design_coding_guidelines_ever.aspx</id><created>2008-03-30T00:00:00Z</created><issued>2008-03-30T00:00:00Z</issued><modified>2008-03-31T05:31:01Z</modified><content type="text/html" mode="escaped">&lt;p&gt;This must be &lt;a href="http://www.youtube.com/watch?v=a0qMe7Z3EYg"&gt;the best video presentation&lt;/a&gt; on web standards and SEO. If you are so astounded by the clarity of the material that you can&amp;#8217;t remember a thing, below are a few points to take away:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Do your layout with &lt;code&gt;div&lt;/code&gt;s&lt;/li&gt;
  &lt;li&gt;Please don&amp;#8217;t use tables even though they work fine&lt;/li&gt;
  &lt;li&gt;Describe the &lt;code&gt;DOCTYPE&lt;/code&gt; so the browser can relate&lt;/li&gt;
  &lt;li&gt;Check in all browsers&lt;/li&gt;
  &lt;li&gt;Title everything including links and images&lt;/li&gt;
  &lt;li&gt;Don&amp;#8217;t use &lt;code&gt;&amp;lt;b(old)&amp;gt;&lt;/code&gt;, please use &lt;code&gt;&amp;lt;strong&amp;gt;&lt;/code&gt; &amp;#8217;cause
    if you use &lt;code&gt;&amp;lt;b(old)&amp;gt;&lt;/code&gt; then it&amp;#8217;s all then wrong&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Go watch now and enjoy!&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?572</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/572.aspx</trackback:ping><slash:comments>5</slash:comments></entry><entry><title>How Does MS AJAX Manage to Crash Firefox?</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/ms_ajax_crashes_firefox.aspx" /><id>http://www.aspnetresources.com/blog/ms_ajax_crashes_firefox.aspx</id><created>2008-03-12T00:00:00Z</created><issued>2008-03-12T00:00:00Z</issued><modified>2008-03-13T05:22:13Z</modified><content type="text/html" mode="escaped">&lt;p&gt;Another day, another idiosyncrasy. I&amp;#8217;m implementing the
&lt;code&gt;IScriptControl&lt;/code&gt; interface and have the following line which crashes Firefox upon page unload:&lt;/p&gt;

&lt;pre class='coloredcode'&gt;&lt;span class='kwd'&gt;public&lt;/span&gt; IEnumerable&amp;lt;&lt;span class='gen'&gt;ScriptReference&lt;/span&gt;&amp;gt; GetScriptReferences ()
{
   &lt;span class='kwd'&gt;yield return new&lt;/span&gt; ScriptReference (
      &lt;span class='st'&gt;"MyNamespace.MyScriptControl.Panelbar.js"&lt;/span&gt;, 
      &lt;span class='kwd'&gt;this&lt;/span&gt;.GetType ().Asembly.FullName);
}&lt;/pre&gt;

&lt;p&gt;Firefox crashes cold with this:&lt;/p&gt;

&lt;p&gt;&lt;img alt="Microsoft AJAX crashing Firefox"
src="http://aspnetresources.com/images/ms_ajax_ff_crash.png" class="framed" /&gt;&lt;/p&gt;

&lt;p&gt;By trial and error, I figured that the following line &lt;strong&gt;does not&lt;/strong&gt; cause crashes:&lt;/p&gt;

&lt;pre class='coloredcode'&gt;&lt;span class='kwd'&gt;public&lt;/span&gt; IEnumerable&amp;lt;&lt;span class='gen'&gt;ScriptReference&lt;/span&gt;&amp;gt; GetScriptReferences ()
{
 &lt;span class='kwd'&gt;yield return new&lt;/span&gt; ScriptReference (
   Page.ClientScript.GetWebResourceUrl (
     &lt;span class='kwd'&gt;typeof&lt;/span&gt; (MyControl), &lt;span class='st'&gt;"MyNamespace.MyScriptControl.Panelbar.js"&lt;/span&gt;));
}&lt;/pre&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;Go figure. On a scale of 1 (a hiccup) to 10 (absolutely weird), this issue
scores a 10.&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?571</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/571.aspx</trackback:ping><slash:comments>5</slash:comments></entry><entry><title>Extender Control Just Won't Pick Up Localization</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/extender_wont_pick_up_localization.aspx" /><id>http://www.aspnetresources.com/blog/extender_wont_pick_up_localization.aspx</id><created>2008-02-24T00:00:00Z</created><issued>2008-02-24T00:00:00Z</issued><modified>2008-02-24T19:22:25Z</modified><content type="text/html" mode="escaped">&lt;p&gt;Imagine my surprise when, having gone through the &lt;a
href="http://www.asp.net/AJAX/Documentation/Live/overview/LocalizingResources.aspx"&gt;AJAX localization tutorial&lt;/a&gt; and &lt;a
href="http://msdn.microsoft.com/msdnmag/issues/08/01/InternationalizingASPNETAJAX/"&gt;this MSDN article&lt;/a&gt; up, down and sideways, I couldn&amp;#8217;t get my extender control to see resource strings on the client! &lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s the extender skeleton:&lt;/p&gt;

&lt;pre class='coloredcode'&gt;[assembly: WebResource (
    &lt;span class='st'&gt;"[blah].js"&lt;/span&gt;,
    &lt;span class='st'&gt;"text/javascript"&lt;/span&gt;)]

[assembly: ScriptResource (
    &lt;span class='st'&gt;"[blah].js"&lt;/span&gt;, 
    &lt;span class='st'&gt;"[blah recources]"&lt;/span&gt;, 
    &lt;span class='st'&gt;"ClientResources"&lt;/span&gt;]

&lt;span class='kwd'&gt;namespace&lt;/span&gt; MyControls
{
 &lt;span class='kwd'&gt;public class&lt;/span&gt; MyExtender : ExtenderControl
 {
  &lt;span class='cmt'&gt;// Lots of stuff skipped&lt;/span&gt;
  &lt;span class='kwd'&gt;protected 
      override&lt;/span&gt; IEnumerable&amp;lt;&lt;span class='gen'&gt;ScriptReference&lt;/span&gt;&amp;gt; GetScriptReferences()
  {
   &lt;span class='kwd'&gt;yield return new&lt;/span&gt; ScriptReference (
       Page.ClientScript.GetWebResourceUrl (
                 &lt;span class='kwd'&gt;typeof&lt;/span&gt; (MyExtender), &lt;span class='st'&gt;"[blah].js"&lt;/span&gt;)
    );
  }
 }
}&lt;/pre&gt;

&lt;p&gt;I don&amp;#8217;t remember why I chose &lt;code&gt;GetWebResourceUrl&lt;/code&gt;, but that&amp;#8217;s precisely where the problem lies. Change the line to this and everything magically works:&lt;/p&gt;

  &lt;pre class='coloredcode'&gt;&lt;span class='kwd'&gt;yield return new&lt;/span&gt; ScriptReference (&lt;span class='st'&gt;"[blah].js"&lt;/span&gt;,
                        &lt;span class='kwd'&gt;this&lt;/span&gt;.GetType ().Assembly.FullName);
&lt;/pre&gt;

&lt;p&gt;Gotta love obscure edge-cases.&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?570</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/570.aspx</trackback:ping><slash:comments>0</slash:comments></entry><entry><title>Usability Blooper: Dollar, You Ain't Helping</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/usability_blooper_dollar.aspx" /><id>http://www.aspnetresources.com/blog/usability_blooper_dollar.aspx</id><created>2008-02-24T00:00:00Z</created><issued>2008-02-24T00:00:00Z</issued><modified>2008-02-24T18:40:56Z</modified><content type="text/html" mode="escaped">&lt;p&gt;Here&amp;#8217;s an interesting screenie from &lt;a href="http://dollar.com"&gt;Dollar&lt;/a&gt; rent-a-car:&lt;/p&gt;

&lt;p&gt;&lt;img class="framed" alt="Dollar doesn't help with either the message or the interface" src="http://aspnetresources.com/images/dollar_rental_wtf.png" /&gt;&lt;/p&gt;

&lt;p&gt;Two issues jump out.&lt;/p&gt;

&lt;h2&gt;Poor copywriting&lt;/h2&gt;

&lt;p&gt;The message is clear as mud. Too wordy. Also, displaying internal error codes (&amp;#8220;Message Business100&amp;#8221;) is a sin unto death, figuratively speaking.&lt;/p&gt;

&lt;h2&gt;UI disconnect&lt;/h2&gt;

&lt;p&gt;The error message refers to something the UI doesn&amp;#8217;t actually display. There is &lt;strong&gt;no&lt;/strong&gt; list to select from. I can kinda-sorta quess I need to start typing because I&amp;#8217;m familiar with AJAXy auto-completes, but still&amp;#8230;&lt;/p&gt;

&lt;p&gt;&amp;#8220;Location&amp;#8221; up there is ambiguous because I don&amp;#8217;t know their location codes. &amp;#8220;Location&amp;#8221; is an implementation detail from the jargon of Dollar&amp;#8217;s IT peeps.&lt;/p&gt;

&lt;p&gt;If it were up to me, I&amp;#8217;d go with &amp;#8220;Type the city or airport where you&amp;#8217;d like to pick up the vehicle.&amp;#8221;&lt;/p&gt;

&lt;p&gt;Any favorite usability bloopers you&amp;#8217;d like to share?&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?569</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/569.aspx</trackback:ping><slash:comments>0</slash:comments></entry><entry><title>One Interesting Use of Explicitly Implemented Interfaces</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/one_interesting_use_of_explicitly_implemented_inte.aspx" /><id>http://www.aspnetresources.com/blog/one_interesting_use_of_explicitly_implemented_inte.aspx</id><created>2008-02-24T00:00:00Z</created><issued>2008-02-24T00:00:00Z</issued><modified>2008-02-24T18:10:52Z</modified><content type="text/html" mode="escaped">&lt;p&gt;When you see a discussion of &lt;a href="http://msdn2.microsoft.com/en-us/library/ms173157(vs.80).aspx"&gt;explicit
interfaces&lt;/a&gt;, it is usually about resolving clashes in their signatures (see &lt;a href="http://msdn2.microsoft.com/en-us/library/aa288461.aspx"&gt;Explicit Interface Implementation Tutorial&lt;/a&gt;). &lt;/p&gt;

&lt;p&gt;To rehash, you&amp;#8217;d implement an interface explicitly to&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;simulate variance (change parameters or return type in &amp;#8220;overridden&amp;#8221; methods);&lt;/li&gt;
  &lt;li&gt;hide a member and add an equivalent member with a better name;&lt;/li&gt;
  &lt;li&gt;force the client to call members only through the interface.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, here&amp;#8217;s another interesting use case very briefly mentioned in &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0321246756/aspnetresourc-20"&gt;Framework Design Guidelines&lt;/a&gt;. An explicit interface comes in handy when it &amp;#8220;includes mainly members supporting framework infrastructure, such as data binding or
serialization.&amp;#8221; A good example is an interface whose members are almost never accessed directly.&lt;/p&gt;

&lt;p&gt;This got me thinking. Recently, we had a discussion at work whether our domain classes should be aware of their caching environment. Should a domain class implement a (hypothetical) &lt;code&gt;ICacheable&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;In the Domain Driven Design canon, you don&amp;#8217;t mix persistence to the domain and thus keep it persistence-ignorant as much as possible. Caching is infrastructure, however, so it seems we can implement &lt;code&gt;ICacheable&lt;/code&gt; explicitly as a necessary evil and still feel good about it, eh? I don&amp;#8217;t know yet. I&amp;#8217;m curious how this is going to shape.&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?568</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/568.aspx</trackback:ping><slash:comments>3</slash:comments></entry><entry><title>Two Press Releases and Bad Copywriting</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/two_press_releases_and_bad_copywriting.aspx" /><id>http://www.aspnetresources.com/blog/two_press_releases_and_bad_copywriting.aspx</id><created>2008-02-22T00:00:00Z</created><issued>2008-02-22T00:00:00Z</issued><modified>2008-02-24T16:46:08Z</modified><content type="text/html" mode="escaped">&lt;p&gt;Compare these two artifacts that came from the gods of corporate communication:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;We strive to quickly leverage existing competitive data to allow us to interactively restore long-term high-impact opportunities to meet our customer&amp;#8217;s needs. The customer can count on us to interactively engineer cost effective information in order to seamlessly simplify high-quality data to set us apart from the competition.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;Microsoft today announced a set of broad-reaching changes to its technology and business practices to increase the openness of its products and drive greater interoperability, opportunity and choice. These changes are codified into four new interoperability principles and corresponding actions: 1) ensuring open connections; 2) promoting data portability; 3) enhancing support for industry standards; and 4) fostering more open engagement with
customers and the industry, including open source communities.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The former is from the Dilbert &lt;a href="http://www.dilbert.com/comics/dilbert/games/career/bin/ms.cgi"&gt;Mission Statement Generator&lt;/a&gt;, the latter&amp;#8212;&lt;a href="http://www.microsoft.com/presspass/presskits/interoperability/default.mspx"&gt;from Microsoft&lt;/a&gt; (hat tip to Bill Zack). I am thoroughly enlightened now.&lt;/p&gt;

&lt;p&gt;Will those people ever learn to speak like humans?&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?567</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/567.aspx</trackback:ping><slash:comments>0</slash:comments></entry><entry><title>Join the Dark Side</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/join_the_dark_side.aspx" /><id>http://www.aspnetresources.com/blog/join_the_dark_side.aspx</id><created>2008-02-17T00:00:00Z</created><issued>2008-02-17T00:00:00Z</issued><modified>2008-02-17T21:19:41Z</modified><content type="text/html" mode="escaped">&lt;p&gt;For months now I&amp;#8217;ve been using a dark theme for my Visual Studio, and I&amp;#8217;m loving it. To someone who spends days and days in front of a computer, a dark-grey &amp;#8220;canvas&amp;#8221; definitely puts less strain on the eyes.&lt;/p&gt;

&lt;p&gt;&lt;img alt="Dark Visual Studio theme" src="http://aspnetresources.com/images/dark_vs_theme.png" class="framed" /&gt;&lt;/p&gt;

&lt;p&gt;I don&amp;#8217;t remember where I found the original color scheme, but I modified it a bit for my liking. Ever since I started using &lt;a
href="http://www.aspnetresources.com/blog/new_font_on_the_block.aspx"&gt;Consolas&lt;/a&gt;, I just can&amp;#8217;t use any other font in Visual Studio.&lt;/p&gt;

&lt;p&gt;Feel free to &lt;a
href="http://aspnetresources.com/downloads/milan_color_scheme_vs_2005_and_2008.zip"&gt;grab
my Visual Studio 2005 and 2008 theme&lt;/a&gt;. Here&amp;#8217;s how you install it:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Copy the .vssettings file in My Documents. Visual Studio does some
    weird things if it can&amp;#8217;t find the settings file later, so keep it in My
    Docs.&lt;/li&gt;
  &lt;li&gt;In Visual Studio go to Tools | Import and Export Settings&amp;#8230;&lt;/li&gt;
  &lt;li&gt;Choose &amp;#8220;Import selected environment settings&amp;#8221;. Click Next.&lt;/li&gt;
  &lt;li&gt;Decide if you want to back up your settings (you probably should, in
    case you want to go back if you don&amp;#8217;t like the new syntax coloring) and
    click Next.&lt;/li&gt;
  &lt;li&gt;Click Browse and find the .vssettings file from step #1. Click
  Next.&lt;/li&gt;
  &lt;li&gt;Click Finish.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Oh, and if you haven&amp;#8217;t configured your Windows box to use ClearType, you&amp;#8217;re missing out a lot!&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?566</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/566.aspx</trackback:ping><slash:comments>5</slash:comments></entry><entry><title>Collection Interfaces Smell</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/collection_interfaces_smell.aspx" /><id>http://www.aspnetresources.com/blog/collection_interfaces_smell.aspx</id><created>2008-02-17T00:00:00Z</created><issued>2008-02-17T00:00:00Z</issued><modified>2008-02-17T20:52:35Z</modified><content type="text/html" mode="escaped">&lt;p&gt;Going back to &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0321246756/aspnetresourc-20"&gt;Framework Design Guidelines&lt;/a&gt;, here&amp;#8217;s a guideline pertaining to collections that I disagree with:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.3.1. Collection Parameters&lt;/strong&gt;&lt;/p&gt;

&lt;p class="note"&gt;&amp;#8220;&amp;#x2713; &lt;strong&gt;DO&lt;/strong&gt; use the least specialized type possible as a parameter type. Most members taking collections as parameters use the &lt;code&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt; interface.&amp;#8221;&lt;/p&gt;

&lt;pre class='coloredcode'&gt;&lt;span class='kwd'&gt;public void&lt;/span&gt; PrintNames (IEnumerable&lt;&lt;span class='kwd'&gt;string&lt;/span&gt;&gt; names) {
   &lt;span class='kwd'&gt;foreach&lt;/span&gt; (&lt;span class='kwd'&gt;string&lt;/span&gt; name &lt;span class='kwd'&gt;in&lt;/span&gt; names)
      Console.Write (name);
}&lt;/pre&gt;

&lt;p&gt;My grievance with this advice is &lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;it leads to code maintenance nightmare;&lt;/li&gt;
  &lt;li&gt;it has bad smell of a leaked implementation detail;&lt;/li&gt;
  &lt;li&gt;it can lead to poor performance of LINQ queries.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;Maintenance&lt;/h2&gt;

&lt;p&gt;I&amp;#8217;m a big believer in programming against interfaces instead of concrete implementations. However, when it comes to collections, developers tend to get confused which &amp;#8220;least derived&amp;#8221; interface (or collection) should do the job. You see &lt;code&gt;IList&amp;lt;T&amp;gt;&lt;/code&gt;, &lt;code&gt;List&amp;lt;T&amp;gt;&lt;/code&gt;, &lt;code&gt;ICollection&amp;lt;T&amp;gt;&lt;/code&gt;, &lt;code&gt;Collection&amp;lt;T&amp;gt;&lt;/code&gt;, &lt;code&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt; all used without consistency. Mainintaining this is next to a nightmare.&lt;/p&gt;

&lt;h2&gt;Implementation leakage&lt;/h2&gt;

&lt;p&gt;Honestly, I don&amp;#8217;t want to care what kind of collection a return type is. Dealing with a specific interface puts me in the wrong frame of mind when consuming the API.&lt;/p&gt;

&lt;h2&gt;Performance of LINQ queries&lt;/h2&gt;

&lt;p&gt;Let&amp;#8217;s look at a simple operator, such as &lt;a href="http://msdn2.microsoft.com/en-us/library/system.linq.enumerable.last.aspx"&gt;Last&lt;/a&gt; (&lt;a href="http://www.aspnetresources.com/sourcecode/linq/LinqLastOperator.cs.aspx"&gt;see ripped source&lt;/a&gt;). If the &lt;code&gt;source&lt;/code&gt; parameter is an &lt;code&gt;IList&amp;lt;T&amp;gt;&lt;/code&gt;, the operator simply returns its &lt;code&gt;Count&lt;/code&gt; property. If &lt;code&gt;source&lt;/code&gt; implements the vanilla &lt;code&gt;IEnumerator&amp;lt;T&amp;gt;&lt;/code&gt;, the code iterates over the entire collection to arrive at the last item. Not too performant, and it&amp;#8217;s a simple case!&lt;/p&gt;

&lt;h2&gt;Using subclasses of generic collections instead&lt;/h2&gt;

&lt;p&gt;Luckily, the same section in &lt;strong&gt;Framework Design Guidelines&lt;/strong&gt; has the following guideline:&lt;/p&gt;

&lt;p class="note"&gt;&lt;strong&gt;&amp;#8220;&amp;#x2713;CONSIDER&lt;/strong&gt; using subclasses of generic base collections instead of using the collections directly. This allows for a better name and for adding helper methods that are not present on the base collection types. This is especially applicable to high-level APIs.&amp;#8221;&lt;/p&gt;

&lt;p&gt;Collection inheritance is a whole different subject, so I won&amp;#8217;t go there. I like the idea of abstracting away from the underlying type, even if it&amp;#8217;s as simple as:&lt;/p&gt;

&lt;pre class='coloredcode'&gt;&lt;span class='kwd'&gt;public&lt;/span&gt; CustomerCollection : Collection&amp;lt;&lt;span class='gen'&gt;Customer&lt;/span&gt;&amp;gt; {}&lt;/pre&gt;

&lt;h2&gt;LINQ-ifying custom collections&lt;/h2&gt;

&lt;p&gt;While we&amp;#8217;re on the subject of custom collections, here&amp;#8217;s my approach to making them &amp;#8220;LINQ-ready&amp;#8221; (same &lt;a href="http://www.aspnetresources.com/blog/philly_code_camp_2008_1_samples.aspx"&gt;code I demoed&lt;/a&gt; at my Philly Code camp LINQ talk):&lt;/p&gt;

&lt;pre class='coloredcode'&gt;&lt;span class='kwd'&gt;class&lt;/span&gt; CustomerCollection : Collection&amp;lt;&lt;span class='gen'&gt;Customer&lt;/span&gt;&amp;gt;
{
    &lt;span class='kwd'&gt;public&lt;/span&gt; CustomerCollection () { }
    &lt;span class='kwd'&gt;public&lt;/span&gt; CustomerCollection (IList&amp;lt;&lt;span class='gen'&gt;Customer&lt;/span&gt;&amp;gt; customers) : 
           &lt;span class='kwd'&gt;base&lt;/span&gt; (customers) { }

    &lt;span class='kwd'&gt;public static implicit operator
         &lt;/span&gt; CustomerCollection (List&amp;lt;&lt;span class='gen'&gt;Customer&lt;/span&gt;&amp;gt; customers)
    {
        &lt;span class='kwd'&gt;return new&lt;/span&gt; CustomerCollection (customers);
    }
}&lt;/pre&gt;

&lt;p&gt;They key here is the implicit conversion operator which takes a list of customers and feeds it to a corresponding constructor. Here&amp;#8217;s how to use it in real life:&lt;/p&gt;

&lt;pre&gt;CustomerCollection result = customers
   .Where ([lambda expression])
   .ToList ();&lt;/pre&gt;

&lt;p&gt;Nice and concise. Otherwise you&amp;#8217;d have to wrap the result with an explicit constructor invocation which gets ugly fast.&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?565</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/565.aspx</trackback:ping><slash:comments>1</slash:comments></entry><entry><title>Scenario-Driven Design Violated To the Utmost</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/scenario_driven_design_violated_to_the_utmost.aspx" /><id>http://www.aspnetresources.com/blog/scenario_driven_design_violated_to_the_utmost.aspx</id><created>2008-02-11T00:00:00Z</created><issued>2008-02-11T00:00:00Z</issued><modified>2008-02-12T06:19:05Z</modified><content type="text/html" mode="escaped">&lt;p&gt;I like &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0321246756/aspnetresourc-20"&gt;Framework
Design Guidelines&lt;/a&gt;. It&amp;#8217;s a nice guidebook on how to get everyone on your team on the same page and establish common coding practices. While re-reading it, I came across &lt;strong&gt;the principle of Scenario-Driven Design&lt;/strong&gt; (sec 2.2.1) which states the following:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;Framework design should be focused around a set of common scenarios to the point where design process is scenario-driven. We recommend that framework designers first write code that the users of the framework will have to write in main scenarios, and then design the object model to support these code samples.&lt;/p&gt;

&lt;p&gt;[&amp;#8230;] When designing a framework, you should start with producing a scenario-driven API specification.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you subscribe to the Xxxx-Driven Design fashion of the day, you will recognize this advice as the core idea of your methodology. There&amp;#8217;s nothing wrong with it. It&amp;#8217;s a great idea: put yourself in the shoes of other developers and see how it feels to be them.&lt;/p&gt;

&lt;p&gt;Krzysztof (coolest Scrabble name ever!) goes on to say, &amp;#8220;There is simply no other way to design a great framework.&amp;#8221;&lt;/p&gt;

&lt;h2&gt;JSON serialization in 2.0&lt;/h2&gt;

&lt;p&gt;The 2.0 runtime had this handy class &lt;code&gt;JavaScriptSerializer&lt;/code&gt;. You could throw anything at it (even anonymous types in 3.5), and it would produce a JSON string out of it with a single line of code!&lt;/p&gt;

&lt;pre class='coloredcode'&gt;&lt;span class='kwd'&gt;string&lt;/span&gt; json = &lt;span class='kwd'&gt;new&lt;/span&gt; JavaScriptSerializer().Serialize (blah);&lt;/pre&gt;

&lt;h2&gt;JSON Serialization in 3.5&lt;/h2&gt;

&lt;p&gt;Once you upgrade to the 3.5 runtime, all of a sudden you get compiler warnings that &lt;code&gt;JavaScriptSerializer&lt;/code&gt; has been deprecated in favor of its older brother, &lt;code&gt;DataContractJsonSerializer&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m going to lift &lt;a
href="http://www.west-wind.com/WebLog/posts/218001.aspx"&gt;a snip from Rick&amp;#8217;s blog&lt;/a&gt; just to show the contrast:&lt;/p&gt;

&lt;pre class='coloredcode'&gt;DataContractJsonSerializer ser = 
   &lt;span class='kwd'&gt;new&lt;/span&gt; DataContractJsonSerializer(&lt;span class='kwd'&gt;typeof&lt;/span&gt;(Customer));

MemoryStream ms = &lt;span class='kwd'&gt;new&lt;/span&gt; MemoryStream();
ser.WriteObject(ms, person);
&lt;span class='kwd'&gt;string&lt;/span&gt; json = Encoding.Default.GetString(ms.ToArray());
ms.Close();&lt;/pre&gt;

&lt;p&gt;All traces of scenario-driven design are gone. This is an example of a typical overengineered Microsoft monstrocity, and we&amp;#8217;re not even done yet. You have to go your domain model and decorate classes with &lt;code&gt;[DataContract]&lt;/code&gt;, and their members&amp;#8212;with &lt;code&gt;[DataMember]&lt;/code&gt;. All this pollutes your domain model with crap big time.&lt;/p&gt;

&lt;p&gt;*sigh* It&amp;#8217;s beyond me how someone thought this was acceptable.&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?564</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/564.aspx</trackback:ping><slash:comments>2</slash:comments></entry><entry><title>Achieving Code Symmetry</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/achieving_code_symmetry.aspx" /><id>http://www.aspnetresources.com/blog/achieving_code_symmetry.aspx</id><created>2008-01-28T00:00:00Z</created><issued>2008-01-28T00:00:00Z</issued><modified>2008-01-28T19:38:14Z</modified><content type="text/html" mode="escaped">&lt;p&gt;In my review of Kent Beck&amp;#8217;s latest book, &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0321413091/aspnetresourc-20"&gt;Implementation Patterns&lt;/a&gt;, I didn&amp;#8217;t mean to present it as completely useless. It has some great points sprinkled throughout. It&amp;#8217;s just that they are buried in trivialities. Still, one valuable concept Beck talks about in his book is that of &lt;strong&gt;code symmetry&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;Symmetry in code is where the same idea is expressed the same way everywhere it appears.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Beck gives the following example:&lt;/p&gt;

&lt;pre&gt;void process () {
  input ();
  count++;
  output ();
}&lt;/pre&gt;

&lt;p&gt;The second statement is an implementation detail. It&amp;#8217;s the &lt;em&gt;how&lt;/em&gt;, not the &lt;em&gt;why&lt;/em&gt;. For better symmetry, you can rewrite it as follows:&lt;/p&gt;

&lt;pre&gt;void process () {
  input ();
  incrementCount ();
  output ();
}&lt;/pre&gt;

&lt;p&gt;A little better. Whereas &lt;code&gt;input()&lt;/code&gt; and  &lt;code&gt;output()&lt;/code&gt; are named after intentions (the &lt;em&gt;why&lt;/em&gt;), &lt;code&gt;incrementCount()&lt;/code&gt; is named after an implementation (the &lt;em&gt;how&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;An even better rewrite would yield this:&lt;/p&gt;

&lt;pre&gt;void process() {
  input ();
  tally ();
  output ();
}&lt;/pre&gt;

&lt;p&gt;Another problem with the first sample is that it jumps from one
abstraction level to another.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;Code like this is jarring to the reader. Code is easier to understand when it flows, and abruptly shifting abstraction levels breaks flow. What is that bit twiddling in there? [&amp;#8230;] What does it mean?&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;Explaining messages&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Explaining message&lt;/strong&gt; is a &amp;#8220;pattern&amp;#8221; in Beck&amp;#8217;s book that is similar to the principle of code symmetry. He cites the following Smalltalk example:&lt;/p&gt;

&lt;pre&gt;highlight (Rectangle area) {
  reverse (area);
}&lt;/pre&gt;

&lt;p&gt;Come to think of it, the name &lt;code&gt;highlight&lt;/code&gt; expresses the &lt;em&gt;intention&lt;/em&gt; while &lt;code&gt;reverse&lt;/code&gt; expresses the &lt;em&gt;mechanics&lt;/em&gt;. Why does this matter?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;The distinction between intention and implementation has always been important in software development. It is what allows you to understand a computation first in essence and later, if necessary, in detail. You can use messages to make this distinction by sending a message named after the problem you are solving which in turn sends a message named after how the problem is to be solved.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The &lt;code&gt;highlight&lt;/code&gt; method above is an example of an &lt;em&gt;explaining message&lt;/em&gt;. Even if it&amp;#8217;s a one-liner, the &amp;#8220;main purpose in invoking an explaining message is to communicate my intention more clearly.&amp;#8221;&lt;/p&gt;

&lt;p&gt;After all, the compiler doesn&amp;#8217;t care how you name methods or format code. You&amp;#8217;re writing it to communicate with other people. And that&amp;#8217;s what Beck&amp;#8217;s book is about.&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?563</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/563.aspx</trackback:ping><slash:comments>1</slash:comments></entry><entry><title>Sleek Use of a Lambda Expression</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/sleek_lambda_expression.aspx" /><id>http://www.aspnetresources.com/blog/sleek_lambda_expression.aspx</id><created>2008-01-24T00:00:00Z</created><issued>2008-01-24T00:00:00Z</issued><modified>2008-01-24T07:56:03Z</modified><content type="text/html" mode="escaped">&lt;p&gt;I can&amp;#8217;t recall where I found it, but here&amp;#39;s a sleek way to employ a lambda expression:&lt;/p&gt;

&lt;pre&gt;SomeButton.Click += (sender, e) =&amp;gt; { .... };&lt;/pre&gt;

&lt;p&gt;I&amp;#8217;s one of those moments when you say to yourself, &amp;#8220;But of course!&amp;#8221;&lt;/p&gt;

&lt;p&gt;Then there&amp;#8217;s also &lt;a href="http://aspnetresources.com/blog/shortest_event_handler_syntax.aspx"&gt;this really short&lt;/a&gt; event handler syntax.&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?562</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/562.aspx</trackback:ping><slash:comments>0</slash:comments></entry><entry><title>Where Is C# Heading?</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/where_is_cs_heading.aspx" /><id>http://www.aspnetresources.com/blog/where_is_cs_heading.aspx</id><created>2008-01-23T00:00:00Z</created><issued>2008-01-23T00:00:00Z</issued><modified>2008-01-23T19:09:13Z</modified><content type="text/html" mode="escaped">&lt;p&gt;A friend of mine (let&amp;#8217;s call him Morpheus to conceal his identity) and I had a lovely chat about &lt;a href="http://weblogs.asp.net/bleroy/archive/2008/01/16/immutability-in-c.aspx"&gt;this helpful linkfest&lt;/a&gt; on immutability in C# (great posts there, btw!).&lt;/p&gt;

&lt;pre&gt;
&lt;strong&gt;Morpheus&lt;/strong&gt;: yeah it is the F# folks moving some of its concepts to C# 
&lt;strong&gt;Me&lt;/strong&gt;: Yeah, I noticed. Good stuff. 
&lt;strong&gt;Me&lt;/strong&gt;: Wonder what a hodge-podge C# will become soon :D 
&lt;strong&gt;Morpheus&lt;/strong&gt;: just like VB 
&lt;strong&gt;Me&lt;/strong&gt;: Aaaah, who cares about VB :D 
&lt;strong&gt;Me&lt;/strong&gt;: People will still name classes clsXxxxxx :D 
&lt;strong&gt;Morpheus&lt;/strong&gt;: well, if C# gets as convoluted (sp) as VB, then 
what's the difference? 
&lt;/pre&gt;

&lt;p&gt;(Morpheus wins this round)&lt;/p&gt;

&lt;p&gt;I will leave it up to you to come up with a good answer.&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?561</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/561.aspx</trackback:ping><slash:comments>13</slash:comments></entry><entry><title>Creepy Implicitness</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/creepy_implicitness.aspx" /><id>http://www.aspnetresources.com/blog/creepy_implicitness.aspx</id><created>2008-01-23T00:00:00Z</created><issued>2008-01-23T00:00:00Z</issued><modified>2008-01-23T18:44:20Z</modified><content type="text/html" mode="escaped">&lt;p&gt;Generally, I&amp;#8217;m not against &lt;a href="http://msdn2.microsoft.com/en-us/library/z5z9kes2(VS.80).aspx"&gt;implicit operators&lt;/a&gt;, but this LINQ/XML syntax gives me creeps:&lt;/p&gt;

&lt;pre class='coloredcode'&gt;&lt;span class='kwd'&gt;new&lt;/span&gt; XAttribute (XNamespace.Xmlns + &lt;span class='st'&gt;"foo"&lt;/span&gt;, &lt;span class='st'&gt;"bar"&lt;/span&gt;)&lt;/pre&gt;

&lt;p&gt;Took me a while to understand that &lt;code&gt;XNamespace&lt;/code&gt; has an implicit operator which allows this string &amp;#8220;concatenation.&amp;#8221;&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?560</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/560.aspx</trackback:ping><slash:comments>1</slash:comments></entry><entry><title>Book Review: Implementation Patterns</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/implementation_patterns_book_review.aspx" /><id>http://www.aspnetresources.com/blog/implementation_patterns_book_review.aspx</id><created>2008-01-20T00:00:00Z</created><issued>2008-01-20T00:00:00Z</issued><modified>2008-01-20T21:04:40Z</modified><content type="text/html" mode="escaped">&lt;p&gt;When I saw &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0321413091/aspnetresourc-20"&gt;Implementation Patterns&lt;/a&gt; by Kent Beck due for publication, I thought: &amp;#8220;Kent Beck&amp;#8212;yay! Patterns&amp;#8212;yay! Famed Addison-Wesley signature series&amp;#8212;yay!&amp;#8221; I snatched a copy as soon as it came out. In retrospect, this book is nothing what I expected it to be.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://aspnetresources.com/images/books/0321413091_500.jpg" alt="" class="framed" style="float: right; margin: 5px 0 5px 5px;" /&gt;Quite simply, I don&amp;#8217;t understand its purpose. The book is only 143 pages long and is too brief to enlighten beginners and too shallow for advanced developers.&lt;/p&gt;

&lt;p&gt;&amp;#8220;Patterns&amp;#8221; in the title is a misnomer. These aren&amp;#8217;t patterns the GoF or Fowler style. They are principles of code construction. This subject is covered way better in Steve McConnell&amp;#8217;s &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0735619670/aspnetresourc-20"&gt;Code Complete&lt;/a&gt; which, in my opinion, is a must read for everyone who wants to graduate from a closet hacker to a real software developer. In fact, 
&lt;strong&gt;Implementation Patterns&lt;/strong&gt; covers the exact same ground (in Java) in far less detail. It is, essentially, a mini-Code Complete.&lt;/p&gt;

&lt;p&gt;It does contain a quick rehash of some general OO principles, patterns and refactorings, e.g. class, interface, subclass, inner class, conditional, delegation, value object; field, collecting parameter, parameter object, eager and lazy initialization, etc. However, It&amp;#8217;s much more a philosophical book than a how-to. &lt;/p&gt;

&lt;h2&gt;The grand theme of Implementation Patterns&lt;/h2&gt;

&lt;p&gt;It&amp;#8217;s this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&amp;#8220;The goal of this book is to help you communicate your intensions through your code. [&amp;#8230;] Throughout, the book is focused on programming techniques that enhance communication.&amp;#8221;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It&amp;#8217;s really about &lt;strong&gt;communication&lt;/strong&gt; (e.g., &amp;#8220;Communication with people is the purpose of class names.&amp;#8221;) It&amp;#8217;s about how to write code, expressive and robust enough for other people to understand; how to code in terms of &lt;em&gt;intension&lt;/em&gt;, rather than &lt;em&gt;implementation&lt;/em&gt; (McConnell covers this subject very well), etc.&lt;/p&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;I don&amp;#8217;t understand who this book was written for and why. There are plenty of great books for Java and non-Java developers. Besides, since it&amp;#8217;s an AW signature series book, it&amp;#8217;s way overpriced. If I knew better, I would have passed it up.&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?559</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/559.aspx</trackback:ping><slash:comments>0</slash:comments></entry><entry><title>Philly Code Camp Sample Code</title><link rel="alternate" type="text/html" href="http://www.aspnetresources.com/blog/philly_code_camp_2008_1_samples.aspx" /><id>http://www.aspnetresources.com/blog/philly_code_camp_2008_1_samples.aspx</id><created>2008-01-20T00:00:00Z</created><issued>2008-01-20T00:00:00Z</issued><modified>2008-01-20T20:18:28Z</modified><content type="text/html" mode="escaped">&lt;p&gt;I&amp;#8217;d like to give very belated thanks to everyone who helped put together this year&amp;#8217;s first Philadelphia Code Camp, which took place last Saturday. I also want to thank those of you who attended my LINQ presentation, &lt;strong&gt;Can we LINQ it? Yes, we can!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Somehow, my talk abstract was not published, so I assume you came on blind faith. I have a conspiracy theory that I got censored due to a reference to communism (just kidding). Here it is in its original wording:&lt;/p&gt;

&lt;hr /&gt;
&lt;p&gt;&amp;#8220;With the advent of LINQ, we have so many ways to query, filter and transform data collections. In this session we&amp;#8217;ll go over all of the Standard Query Operators and see how they work.&lt;/p&gt;

&lt;p&gt;Does &amp;#8220;lambda function&amp;#8221; represent the point of union of the lambdoid and sagittal sutures of the cranium? Does &lt;code&gt;GroupJoin&lt;/code&gt; impart the wisdom of crowds? Does &lt;code&gt;EqualAll&lt;/code&gt; usher in an era of communism? Come and find out!&lt;/p&gt;

&lt;p&gt;Please note: we will not talk about Visual Studio; LINQ to SQL, LINQ to XML, etc in particular, but queryable data sources in general.&amp;#8221;&lt;/p&gt;
&lt;hr /&gt;

&lt;p&gt;Feel free to download and poke around &lt;a href="http://aspnetresources.com/downloads/PhillyCodeCamp_sample_code.zip"&gt;the sample code&lt;/a&gt; I demoed off of. If I were to summarize LINQ, it would be this: &lt;strong&gt;LINQ == anonymous methods on steroids&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img class="framed" alt="Barry Bonds -- the role model for steroid abuse" src="http://aspnetresources.com/images/barry_bonds.jpg" /&gt;&lt;/p&gt;

&lt;h2&gt;As if getting from Long Island to Fort Washington, PA weren&amp;#8217;t a long hike&amp;#8230;&lt;/h2&gt;

&lt;p&gt;I got to meet &lt;a href="http://channel9.msdn.com/ShowPost.aspx?PostID=345905"&gt;Mark Pollack&lt;/a&gt; of the &lt;a href="http://springframework.net/"&gt;Spring.NET&lt;/a&gt; fame who reawakened my interest to Spring. If you never met Mark, he&amp;#8217;s a great guy. We took a train from NYC and got so carried away with the conversation that missed Philly. Check this out:&lt;/p&gt;

&lt;p&gt;&lt;img class="framed" alt="Philly ticket" src="http://aspnetresources.com/images/Philly-ticket.jpg" /&gt;&lt;/p&gt;

&lt;p&gt;In case you can&amp;#8217;t decipher, it says: &amp;#8220;Allow return. Missed stop.&amp;#8221; Thank goodness the next stop wasn&amp;#8217;t D.C. Aaaah, good times.&lt;/p&gt;</content><wfw:commentRss>http://www.aspnetresources.com/blog/postcomments.aspx?558</wfw:commentRss><trackback:ping>http://www.aspnetresources.com/blog/trackback/558.aspx</trackback:ping><slash:comments>0</slash:comments></entry></feed>