<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-12703226</id><updated>2012-02-16T07:39:58.599-08:00</updated><category term='codecamp srp ocp dependencyinjection'/><title type='text'>Stuff by the Way</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://stuffbytheway.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://stuffbytheway.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Charles Crary</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-12703226.post-2565674131828208887</id><published>2009-02-12T08:02:00.001-08:00</published><updated>2010-02-11T19:20:14.804-08:00</updated><title type='text'>Prefer IEnumerable&lt;T&gt; to IList&lt;T&gt; for Public Members</title><content type='html'>&lt;p&gt;A coworker of mine knew vaguely of my preference for IEnumerable&amp;lt;T&amp;gt; over IList&amp;lt;T&amp;gt; for exposing collection members of a class. He needed to expose a collection and its count somehow, and asked me what I thought. Here it is:&lt;/p&gt;&lt;p&gt;I prefer IEnumerable&amp;lt;T&amp;gt; to IList&amp;lt;T&amp;gt; for the following reasons.&lt;/p&gt;&lt;p&gt;IEnumerable&amp;lt;T&amp;gt; is the lowest common denominator of collections, but still very useful as it is foreachable.&lt;/p&gt;&lt;p&gt;Because it is the lowest common denominator, my backing collection can be any number of specific collection types, including an array.&lt;/p&gt;&lt;p&gt;It is easy to return an empty, &lt;i&gt;ad hoc&lt;/i&gt;, 'light-weight' enumeration: Enumerable.Empty&amp;lt;T&amp;gt;().&lt;/p&gt;&lt;p&gt;I can even not have a backing collection, and instead implement the enumeration in code using the yield keyword.&lt;/p&gt;&lt;p&gt;IList&amp;lt;T&amp;gt; has methods like Add() and Insert() and in most API situations I &lt;b&gt;don't&lt;/b&gt; want clients adding members to my collection - IEnumerable&amp;lt;T&amp;gt; is immutable.&lt;/p&gt;&lt;p&gt;IEnumerable&amp;lt;T&amp;gt; is easily managed by Linq extension methods, &lt;i&gt;e.g.&lt;/i&gt;&lt;/p&gt;&lt;pre class="csharpcode"&gt;IEnumerable&amp;lt;IWidget&amp;gt; widgets = someObject.GetWidgets();&lt;br /&gt;&lt;span class="kwrd"&gt;int&lt;/span&gt; count = widgets.Count();&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Note that Count() is a method, not a property. It is an extension method (C# 3.0) that you have access to when you use System.Linq. The implementation, which you can see in Reflector, amounts to foreaching over the enumeration and incrementing a counter. It is efficient as it can be and we don't have to write it over and over.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;It is simple to get an IEnumerable&amp;lt;T&amp;gt; into a List&amp;lt;T&amp;gt;:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;List&amp;lt;IWidget&amp;gt; widgetList = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;IWidget&amp;gt;();&lt;br /&gt;widgetList.AddRange(widgets);&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt&lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;IEnumerable&amp;lt;T&amp;gt; is very composable - the new Linq extension methods allow you to do all sorts of magic with them - filtering, sorting, grouping, aggregation all chained together in a single line of code. IList&amp;lt;T&amp;gt; gets that too because it descends from IEnumerable&amp;lt;T&amp;gt;, but its pretty cool that the lowest common denominator collection gets this stuff.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The most persuasive argument is the one regarding clarity of the API. In every case I can think of, a collection property should present immutable interface, and IList&amp;lt;T&amp;gt; is mutable. If I thought I had a scenario where the client &lt;i&gt;should&lt;/i&gt; be able to futz with my internal collection, I'd revisit my design because I probably have it wrong. IEnumerable&amp;lt;T&amp;gt; wins because it is clearly immutable.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;There are alternatives that permit an IList&amp;lt;T&amp;gt; implementation that doesn't permit appending or inserting, but they're liars. For example List&amp;lt;T&amp;gt;.AsReadOnly() returns a ReadOnlyCollection, which implements IList&amp;lt;T&amp;gt;. But it lies. It has Add() and Insert() methods, but they always throw NotSupportedException. For me, it's a non-starter because the interface is misleading.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;You could also just return a copy of your internal collection, something like this:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; IList&amp;lt;IWidget&amp;gt; Widgets&lt;br /&gt;{&lt;br /&gt;    get&lt;br /&gt;    {&lt;br /&gt;        IList&amp;lt;IWidget&amp;gt; temp = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;IWidget&amp;gt;();&lt;br /&gt;        temp.AddRange(_widgets);&lt;br /&gt;        &lt;span class="kwrd"&gt;return&lt;/span&gt; temp;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;But I think this is just as misleading. Sure, you can honestly add and remove items, but it implies that it is the internal collection when it really isn't. Again, IEnumerable&amp;lt;T&amp;gt; wins because it makes the API clearer.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;You may have a nagging concern that you are getting your Count by iterating through the enumerations rather than having and storing it somewhere. I wouldn't worry about it. It all the cases I can think of, this is trading cycles for clarity in the API. Clarity always trumps performance until we &lt;i&gt;know&lt;/i&gt; or at least have a realistic expectation of a performance issue.  &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;But even then, you needn't worry.  Because wherever possible, these extension methods on IEnumerable&amp;lt;T&amp;gt; try cast it to a higher level collection to optimize the code.  So the Count() extension method tries to cast the target to ICollection&amp;lt;T&amp;gt; so it can use the Count property.  Only if it can't do that does it actually iterate through the enumerable to get the count.  Check it out in Reflector.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;IEnumerable&amp;lt;T&amp;gt; is a clear first class citizen with the addition of all those nifty new extension methods in System.Linq. And even without those, it should be the first choice for exposing an immutable collection.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12703226-2565674131828208887?l=stuffbytheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffbytheway.blogspot.com/feeds/2565674131828208887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12703226&amp;postID=2565674131828208887' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/2565674131828208887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/2565674131828208887'/><link rel='alternate' type='text/html' href='http://stuffbytheway.blogspot.com/2009/02/prefer-ienumerable-to-ilist-for-public.html' title='Prefer IEnumerable&amp;lt;T&amp;gt; to IList&amp;lt;T&amp;gt; for Public Members'/><author><name>Charles Crary</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12703226.post-7366220812899300625</id><published>2009-01-29T19:10:00.001-08:00</published><updated>2009-01-29T19:10:21.850-08:00</updated><title type='text'>Clean Code</title><content type='html'>&lt;p&gt;One of my refrain's at the recent SoCal Code Camp was &amp;quot;Simple Code.&amp;quot;&amp;#160; I was inspired by Scott Bellware's recent appearance on &lt;a href="http://www.hanselminutes.com/default.aspx?showID=164" target="_blank"&gt;Hanselminutes&lt;/a&gt; where he equated simplicity with &lt;em&gt;easy&lt;/em&gt; testability.&amp;#160; It is a great podcast, and highly recommended.&amp;#160; Ultimately the point is that we want the code we touch to become more simple.&amp;#160; That is, more easy to understand, more easy to explain, more easy to change and more easy to test.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_JmjRBmeYuxo/SYJvm2BZcYI/AAAAAAAAAB4/VoDrrIJjQ7Y/s1600-h/CleanCode%5B8%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; margin: 0px 15px 0px 0px; border-left: 0px; border-bottom: 0px" height="134" alt="CleanCode" src="http://lh3.ggpht.com/_JmjRBmeYuxo/SYJvnH2sWlI/AAAAAAAAAB8/8-FUHgJrFC8/CleanCode_thumb%5B4%5D.jpg?imgmax=800" width="102" align="left" border="0" /&gt;&lt;/a&gt;&amp;#160; Well, Robert C. Martin (Uncle Bob) recently published a new book called &lt;a href="http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1233283118&amp;amp;sr=8-1" target="_blank"&gt;Clean Code: A Handbook of Agile Software Craftsmanship&lt;/a&gt; which seems to be concerned with similar themes.&amp;#160; I'd had it on my radar since Uncle Bob did a &lt;a href="http://www.dotnetrocks.com/default.aspx?showNum=388" target="_blank"&gt;.NET Rocks&lt;/a&gt; a few months ago but hadn't gotten a copy yet.&amp;#160; There's always more books than I have time for, particularly lately.&lt;/p&gt;  &lt;p&gt;But after my code camp sessions, Vladimir mentioned that he was participating in a study group going through &lt;a href="http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1233283118&amp;amp;sr=8-1" target="_blank"&gt;Clean Code&lt;/a&gt;.&amp;#160; I had never heard of programmers doing such a thing, but it sounded great.&amp;#160; I liked the notion of the added accountability that comes of joining a group project.&amp;#160; &amp;quot;Hmmm,&amp;quot; I thought, &amp;quot;that might be a great way to really learn a book.&amp;quot;&amp;#160; &lt;/p&gt;  &lt;p&gt;A couple of days later when I asked Vladimir to let me know how the study group went, he surprised me with an invitation to join.&amp;#160; So I went out and got a copy and started in on it.&amp;#160; &lt;/p&gt;  &lt;p&gt;My first 'meeting' was today, over the phone.&amp;#160; And it was great.&amp;#160; The whole conference call thing isn't real high on my list, but the book is solid and the discussion really added to it.&amp;#160; &lt;/p&gt;  &lt;p&gt;One meeting down and I think this has real promise.&amp;#160; Uncle Bob is great, but Uncle Bob supplemented by a roomful of experienced software developers is a real treasure.&lt;/p&gt;  &lt;p&gt;So I'll be attending, every Thursday at noon.&amp;#160; Since I want to make sure I keep up my end of the discussion, I'll be taking copious notes as well.&amp;#160; I'd like to find some way to turn them into blog posts too.&amp;#160; so stay tuned and see what unfolds.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12703226-7366220812899300625?l=stuffbytheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffbytheway.blogspot.com/feeds/7366220812899300625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12703226&amp;postID=7366220812899300625' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/7366220812899300625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/7366220812899300625'/><link rel='alternate' type='text/html' href='http://stuffbytheway.blogspot.com/2009/01/clean-code.html' title='Clean Code'/><author><name>Charles Crary</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_JmjRBmeYuxo/SYJvnH2sWlI/AAAAAAAAAB8/8-FUHgJrFC8/s72-c/CleanCode_thumb%5B4%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12703226.post-7957014492582130308</id><published>2009-01-26T07:57:00.001-08:00</published><updated>2009-01-26T07:57:05.742-08:00</updated><title type='text'>SoCal Rock and Roll Code Camp 01/2009</title><content type='html'>&lt;p&gt;Thanks to all of you who made it to my Dependency Injection sessions at the code camp.&amp;#160; I really enjoyed doing the presentation.&amp;#160; This was the third time I've presented this stuff and I've finally got the content into the neighborhood of where I want it, so I'm particularly satisfied.&amp;#160; &lt;/p&gt;  &lt;p&gt;I've gotten my slides cleaned up and saved off my sample code so I can post it on the code camp website.&amp;#160; You can download slides and sample code for each session from its page.&amp;#160; Here they are: &lt;a href="http://www.socalcodecamp.com/session.aspx?sid=5c9c7223-af4d-47e2-a0c0-196ec29ad632" target="_blank"&gt;Dependency Injection - Why Bother&lt;/a&gt; and &lt;a href="http://www.socalcodecamp.com/session.aspx?sid=08778421-38b6-41ea-bb4b-66dff2770f46" target="_blank"&gt;Fun with Dependency Injection Containers&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I promised some links as well.&amp;#160; Here they are:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://googletesting.blogspot.com/" target="_blank"&gt;Google Testing Blog&lt;/a&gt; - This is a great blog with vast amounts of solid practical advice.&amp;#160; It is focused on Java rather than C#, but in most cases that won't be a problem.&amp;#160; The principles are pretty much the same.&amp;#160; &lt;/p&gt;  &lt;p&gt;Particularly recommended here is the &lt;a href="http://misko.hevery.com/code-reviewers-guide/" target="_blank"&gt;Guide: Writing Testable Code&lt;/a&gt; which appears to be the standards Google uses in code reviews.&amp;#160; It is full of specific guidance and before and after examples both of code and unit tests.&amp;#160; Again, mostly Java, but for the most part it shouldn't be a problem for C# developers.&lt;/p&gt;  &lt;p&gt;The &lt;a href="http://structuremap.sourceforge.net/Default.htm" target="_blank"&gt;StructureMap&lt;/a&gt; site is full of good guidance on Dependency Injection Containers in general as well as StructureMap in particular.&lt;/p&gt;  &lt;p&gt;You can find more about &lt;a href="http://code.google.com/p/autofac/" target="_blank"&gt;Autofac&lt;/a&gt; at Google Code.&amp;#160; The wiki is a good source of guidance for Autofac's various features.&amp;#160; Assuming the lambda syntax doesn't still make your brain hurt the samples are pretty easy to comprehend.&lt;/p&gt;  &lt;p&gt;Don't forget &lt;a href="http://www.castleproject.org/container/" target="_blank"&gt;Castle Windsor&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I spent a lot of time on the Single Responsibility Principle and the Open/Closed Principle.&amp;#160; Robert C. Martin's (Uncle Bob) original articles are available from his web site:&amp;#160; &lt;a href="http://www.objectmentor.com/resources/articles/srp.pdf" target="_blank"&gt;SRP&lt;/a&gt; and &lt;a href="http://www.objectmentor.com/resources/articles/ocp.pdf" target="_blank"&gt;OCP&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Finally, a few great books:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://www.amazon.com/Principles-Patterns-Practices-Robert-Martin/dp/0131857258/ref=pd_bbs_sr_3?ie=UTF8&amp;amp;s=books&amp;amp;qid=1232985182&amp;amp;sr=8-3" target="_blank"&gt;Agile Principles, Patterns, and Practices in C#&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=pd_bbs_sr_4?ie=UTF8&amp;amp;s=books&amp;amp;qid=1232985182&amp;amp;sr=8-4" target="_blank"&gt;Working Effectively with Legacy Code&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://www.amazon.com/Refactoring-Improving-Existing-Addison-Wesley-Technology/dp/0201485672/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1232985282&amp;amp;sr=1-1" target="_blank"&gt;Refactoring: Improving the Design of Existing Code&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;As I said in the sessions, feel free to contact me if you have a question you think I can help you with.&amp;#160; It is a big topic.&lt;/p&gt;  &lt;p&gt;Thank you again for attending.&amp;#160; I had a lot of fun.&amp;#160; &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12703226-7957014492582130308?l=stuffbytheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffbytheway.blogspot.com/feeds/7957014492582130308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12703226&amp;postID=7957014492582130308' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/7957014492582130308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/7957014492582130308'/><link rel='alternate' type='text/html' href='http://stuffbytheway.blogspot.com/2009/01/socal-rock-and-roll-code-camp-012009.html' title='SoCal Rock and Roll Code Camp 01/2009'/><author><name>Charles Crary</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12703226.post-4120299826923746543</id><published>2008-10-28T11:09:00.001-07:00</published><updated>2008-10-28T11:10:56.942-07:00</updated><title type='text'>LA Code Camp Materials - They're Here!</title><content type='html'>&lt;p&gt;Okay, the Code Camp site is back up and I've been able to upload my code and slides.&amp;#160; If you need a hand with any of it let me know.&amp;#160; Here are direct links to each session's page.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.socalcodecamp.com/session.aspx?sid=f7755cee-3245-4284-beeb-e62643acea06"&gt;Dependency Injection - Why Bother?&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.socalcodecamp.com/session.aspx?sid=0affe799-a38f-4ab1-96bc-eca7fe9018e8"&gt;Fun with Dependency Injection Containers&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In addition to the materials, there is a feedback button.&amp;#160; I'd really appreciate it if you'd give it a click and fill it out - it won't take more than a minute.&lt;/p&gt;  &lt;p&gt;Thanks again.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12703226-4120299826923746543?l=stuffbytheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffbytheway.blogspot.com/feeds/4120299826923746543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12703226&amp;postID=4120299826923746543' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/4120299826923746543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/4120299826923746543'/><link rel='alternate' type='text/html' href='http://stuffbytheway.blogspot.com/2008/10/la-code-camp-materials-they-here.html' title='LA Code Camp Materials - They&amp;#39;re Here!'/><author><name>Charles Crary</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12703226.post-6020669551795177932</id><published>2008-10-28T08:25:00.001-07:00</published><updated>2008-10-28T08:25:49.000-07:00</updated><title type='text'>LA Code Camp Materials Part II</title><content type='html'>&lt;p&gt;You're probably thinking that this is the post where I say I've finally posted the sample code and slides.&amp;#160; From the Code Camp last weekend.&amp;#160; And maybe ask you to complete the evaluations online?&amp;#160; &lt;/p&gt;  &lt;p&gt;I thought it was too, until I discovered that the Code Camp site was down.&lt;/p&gt;  &lt;p&gt;So maybe Tuesday isn't in the cards.&amp;#160; Wednesday perhaps?&lt;/p&gt;  &lt;p&gt;If anyone is desperate for the materials (which would be surprisingly nice) leave a comment and we'll figure something out.&amp;#160; &lt;/p&gt;  &lt;p&gt;But don't leave an email address unless you have a really good spam filter.&lt;/p&gt;  &lt;p&gt;I'll try again later today.&amp;#160; Thanks for your attendance and your patience.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12703226-6020669551795177932?l=stuffbytheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffbytheway.blogspot.com/feeds/6020669551795177932/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12703226&amp;postID=6020669551795177932' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/6020669551795177932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/6020669551795177932'/><link rel='alternate' type='text/html' href='http://stuffbytheway.blogspot.com/2008/10/la-code-camp-materials-part-ii.html' title='LA Code Camp Materials Part II'/><author><name>Charles Crary</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12703226.post-4984751804794320710</id><published>2008-10-27T12:24:00.001-07:00</published><updated>2008-10-27T12:24:38.112-07:00</updated><title type='text'>LA Code Camp Materials</title><content type='html'>&lt;p&gt;Thanks again to all of you who attended my sessions at the Code Camp over the weekend.&amp;#160; I had fun giving it - and the discussion was great.&lt;/p&gt;  &lt;p&gt;I'll be posting slides and sample code on the Code Camp web site sometime on Tuesday - sorry about the delay.&lt;/p&gt;  &lt;p&gt;Thanks again.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12703226-4984751804794320710?l=stuffbytheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffbytheway.blogspot.com/feeds/4984751804794320710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12703226&amp;postID=4984751804794320710' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/4984751804794320710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/4984751804794320710'/><link rel='alternate' type='text/html' href='http://stuffbytheway.blogspot.com/2008/10/la-code-camp-materials.html' title='LA Code Camp Materials'/><author><name>Charles Crary</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12703226.post-8474057255548118525</id><published>2008-07-23T07:45:00.001-07:00</published><updated>2008-07-23T07:45:34.202-07:00</updated><title type='text'>TDD Guidelines</title><content type='html'>&lt;p&gt;Heard a nice short &lt;a href="http://www.netobjectives.com/blogs/overcoming-impediments-to-tdd-test-driven-development"&gt;podcast&lt;/a&gt; from &lt;a href="http://www.netobjectives.com/"&gt;NetObjectives&lt;/a&gt; on impediments to TDD this morning.&amp;#160; I had to register to get to it, but it doesn't cost anything.&lt;/p&gt;  &lt;p&gt;They considered the problems associated with TDD adoption.&amp;#160; One which struck me in particular is the problem of many tests breaking when a minor change has been made.&amp;#160; This tends to push developers to 'temporarily' ignore tests so they can get their work done.&amp;#160; Which often becomes more than temporary.&amp;#160; I know I've built up a test maintenance burden this way.&lt;/p&gt;  &lt;p&gt;They addressed this by defining a &amp;quot;good&amp;quot; unit test as follows:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;A unit test should fail always for a well understood reason. &lt;/li&gt;    &lt;li&gt;A unit test should never ever fail for any other reason. &lt;/li&gt;    &lt;li&gt;No other unit test should fail for that reason. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Well, I'm guilty.&amp;#160; &lt;/p&gt;  &lt;p&gt;Sometimes I get going on writing unit tests without being mindful of my 'well understood reason' just for the sake of hacking out tests.&amp;#160; This is a nice formulation for me to keep in mind.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.amazon.com/xUnit-Test-Patterns-Refactoring-Addison-Wesley/dp/0131495054/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1216824163&amp;amp;sr=1-1"&gt;xUnit Test Patterns&lt;/a&gt; has a lot to say about this kind of thing too.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12703226-8474057255548118525?l=stuffbytheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffbytheway.blogspot.com/feeds/8474057255548118525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12703226&amp;postID=8474057255548118525' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/8474057255548118525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/8474057255548118525'/><link rel='alternate' type='text/html' href='http://stuffbytheway.blogspot.com/2008/07/tdd-guidelines.html' title='TDD Guidelines'/><author><name>Charles Crary</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12703226.post-6337193035142337214</id><published>2008-07-01T08:42:00.001-07:00</published><updated>2008-07-01T08:45:04.935-07:00</updated><title type='text'>Dependency Injection Resources</title><content type='html'>&lt;p&gt;Here are the promised resources:&lt;/p&gt;  &lt;p&gt;The &lt;a href="http://www.objectmentor.com/resources/articles/srp.pdf"&gt;Single Responsibility Principle&lt;/a&gt; by Robert C. Martin (Uncle Bob) is one of the design principles that makes Dependency Injection useful.&amp;#160; Also recommend are his articles &lt;a href="http://www.objectmentor.com/resources/articles/ocp.pdf"&gt;Open/Closed Principle&lt;/a&gt;; &lt;a href="http://www.objectmentor.com/resources/articles/dip.pdf"&gt;Dependency Inversion Principle&lt;/a&gt;; and &lt;a href="http://www.objectmentor.com/resources/articles/lsp.pdf"&gt;Liskov Substitution Principle&lt;/a&gt;.&amp;#160; All of these articles are more or less excerpts from his book &lt;a href="http://www.amazon.com/Principles-Patterns-Practices-Robert-Martin/dp/0131857258/ref=pd_bbs_sr_2?ie=UTF8&amp;amp;s=books&amp;amp;qid=1214925859&amp;amp;sr=8-2"&gt;Agile Principles, Patterns, and Practices in C#&lt;/a&gt;, so if you are interested in his book (which is great) these articles would be a good place to start before you make the investment.&amp;#160; Remember there is a Java version of the book too (&lt;a href="http://www.amazon.com/Software-Development-Principles-Patterns-Practices/dp/0135974445/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1214925859&amp;amp;sr=8-1"&gt;Agile Software Development, Principles, Patterns, and Practices&lt;/a&gt;).&lt;/p&gt;  &lt;p&gt;Unfortunately due to the structure of my talk I gave these principles short-shrift, so I want to make myself clear while I have the chance:&amp;#160; I consider them to be more important than the tool (the container).&amp;#160; In fact, I suspect that if you aren't following SRP, OCP and DIP, a Dependency Injection container would be useless anyway.&lt;/p&gt;  &lt;p&gt;While I'm on books, &lt;a href="http://www.amazon.com/Refactoring-Improving-Existing-Addison-Wesley-Technology/dp/0201485672/ref=pd_bbs_sr_2?ie=UTF8&amp;amp;s=books&amp;amp;qid=1214926015&amp;amp;sr=1-2"&gt;Refactoring: Improving the Design of Existing Code&lt;/a&gt; is a must have title.&amp;#160; This is the book I mentioned in the talk that I bought years after having it recommended.&amp;#160; It was too bad I waited, because the book was a revelation.&amp;#160; Just the chapter on Code Smells alone is worth the price of admission.&lt;/p&gt;  &lt;p&gt;The &lt;a href="http://www.castleproject.org/"&gt;Castle Project&lt;/a&gt;'s home page is a link worth having.&amp;#160; There are some tutorials worth looking at here if you want to go deeper.&amp;#160; Note that the Castle Project is a lot bigger than just the MicroKernel and Windsor Container - it also boasts the Monorail project (a .NET MVC web framework) and a really cool Dynamic Proxy.&amp;#160;&amp;#160; Great stuff.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://using.castleproject.org/display/IoC/Home"&gt;Using Castle Project&lt;/a&gt; is a collection of Castle Windsor specific resources.&amp;#160; &lt;/p&gt;  &lt;p&gt;I'm not actively using &lt;a href="http://structuremap.sourceforge.net/Default.htm"&gt;StructureMap&lt;/a&gt; right now, but they just had a new release that is probably worth looking at.&amp;#160; They also have a NAnt task for testing configuration, which is a really cool addition.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://structuremap.sourceforge.net/Concepts.htm"&gt;High-Level Concepts&lt;/a&gt; is a part of the &lt;a href="http://structuremap.sourceforge.net/Default.htm"&gt;StructureMap&lt;/a&gt; web site which gives some great summaries of concepts surrounding good design in general, and Dependency Injection in particular.&amp;#160; These are important regardless of which container you use.&amp;#160; It was written by &lt;a href="http://codebetter.com/blogs/jeremy.miller/default.aspx"&gt;Jeremy Miller&lt;/a&gt;, who's blog is a great resource no matter what he's talking about.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.ayende.com/Blog/archive/2007/10/21/The-IoC-mind-set-Validation.aspx"&gt;The IoC mind set: Validation&lt;/a&gt; is a pretty powerful article by &lt;a href="http://www.ayende.com/Blog/"&gt;Oren Eini&lt;/a&gt; on how to use a Dependency Injection Container (Castle in this case) to manage a multiplicity of validation rules.&amp;#160; It addresses a point I had hoped to make with my final example but which got lost in the lack of time and the broken code.&amp;#160; The container permits some *very* interesting efficiencies, that you just wouldn't come up with if you didn't have a container.&amp;#160; It is what Oren calls the &lt;em&gt;Inversion of Control Mind Set&lt;/em&gt; in this entry.&lt;/p&gt;  &lt;p&gt;I'd recommend subscribing his &lt;a href="http://www.ayende.com/Blog/"&gt;blog&lt;/a&gt; if you really want to stretch your mind in this direction.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://altdotnet.org/"&gt;ALT.NET Portal&lt;/a&gt; is a good place to start for exposure to all of the ALT.NET stuff, not just Dependency Injection.&amp;#160; The discussion groups on Yahoo are pretty rich.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.martinfowler.com/articles/injection.html"&gt;Inversion of Control Containers and the Dependency Injection pattern&lt;/a&gt; is Martin Fowler's article on the topic.&amp;#160; It is usually the first citation when someone covers this topic.&amp;#160; It examines an alternative pattern as well - Service Locator.&lt;/p&gt;  &lt;p&gt;Again, if any of you want further assistance with this stuff, call or email me and I'll be glad to help.&amp;#160; Thanks again for attending!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12703226-6337193035142337214?l=stuffbytheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffbytheway.blogspot.com/feeds/6337193035142337214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12703226&amp;postID=6337193035142337214' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/6337193035142337214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/6337193035142337214'/><link rel='alternate' type='text/html' href='http://stuffbytheway.blogspot.com/2008/07/dependency-injection-resources.html' title='Dependency Injection Resources'/><author><name>Charles Crary</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12703226.post-5152187818389679808</id><published>2008-06-30T08:16:00.001-07:00</published><updated>2008-06-30T08:16:40.217-07:00</updated><title type='text'>Dependency Injection Containers Talk at SoCal Rock and Roll Code Camp</title><content type='html'>&lt;p&gt;Thanks again to all of you who attended.&amp;#160; And to all of you who completed the evaluation forms.&amp;#160; I had a lot of fun doing the talk, and look forward to delivering improved versions of it in the future.&lt;/p&gt;  &lt;p&gt;I've printed out my slides to a PDF and put it on the &lt;a href="http://www.socalcodecamp.com/session.aspx?sid=cf40b4f3-95e6-482e-91b0-1aef7edfc39d"&gt;session's&lt;/a&gt; page on the code camp web site.&amp;#160; The sample code is also there now.&amp;#160; I've only included the first two samples, but they should be enough to get you started playing around with the Windsor Container if you're interested.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/charles.crary/SGj404grixI/AAAAAAAAABE/n4RyMpXiGdY/IMAG0084%5B2%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="184" alt="IMAG0084" src="http://lh4.ggpht.com/charles.crary/SGj41JlDi3I/AAAAAAAAABM/sDfZ-bg67pc/IMAG0084_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I didn't include the third code sample.&amp;#160; As I mentioned it had some dependencies that I couldn't provide - on code developed in my workplace.&amp;#160; &lt;/p&gt;  &lt;p&gt;But I hope to put something together to illustrate the points associated with that third, ill-fated, sample.&amp;#160; Expect to see something here on the blog. If you're interested and don't see anything, please feel free to nag.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/charles.crary/SGj41rpA2lI/AAAAAAAAABY/pwTVaV5JUsM/IMAG0085%5B2%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="184" alt="IMAG0085" src="http://lh5.ggpht.com/charles.crary/SGj41yIpBpI/AAAAAAAAABc/-gkuP_bDA7k/IMAG0085_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;There are a few other resources I'd like to post - references to books and/or articles I mentioned in the talk.&amp;#160; Look for that by Tuesday morning.&lt;/p&gt;  &lt;p&gt;If you want to pursue this topic further and are running into roadblocks and need a hand, please feel free to call or email me.&amp;#160; Or even post a comment on the blog.&amp;#160; I'll do what I can to help out.&lt;/p&gt;  &lt;p&gt;Thanks again for attending the session.&amp;#160; I had a lot of fun.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12703226-5152187818389679808?l=stuffbytheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffbytheway.blogspot.com/feeds/5152187818389679808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12703226&amp;postID=5152187818389679808' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/5152187818389679808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/5152187818389679808'/><link rel='alternate' type='text/html' href='http://stuffbytheway.blogspot.com/2008/06/dependency-injection-containers-talk-at.html' title='Dependency Injection Containers Talk at SoCal Rock and Roll Code Camp'/><author><name>Charles Crary</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/charles.crary/SGj41JlDi3I/AAAAAAAAABM/sDfZ-bg67pc/s72-c/IMAG0084_thumb.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12703226.post-6771091601812263991</id><published>2008-05-31T07:47:00.000-07:00</published><updated>2008-05-31T09:17:38.487-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='codecamp srp ocp dependencyinjection'/><title type='text'>Professionalism, Programming, and Punditry and Success as a Metric</title><content type='html'>&lt;a href="http://www.hanselman.com/blog/"&gt;Scott &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Hanselman&lt;/span&gt;&lt;/a&gt; had a nice &lt;a href="http://www.hanselman.com/blog/ProfessionalismProgrammingAndPunditryAndSuccessAsAMetric.aspx"&gt;post&lt;/a&gt; in response to &lt;a href="http://www.codinghorror.com/blog/"&gt;Jeff Atwood&lt;/a&gt;'s &lt;a href="http://www.codinghorror.com/blog/archives/001124.html"&gt;post&lt;/a&gt; in response to &lt;a href="http://girtby.net/"&gt;Alastair Rankine's&lt;/a&gt; post &lt;a href="http://girtby.net/archives/2008/5/22/blogging-horror" target="_blank"&gt;"Blogging Horror&lt;/a&gt;".  I don't feel the need to comment on &lt;a href="http://www.codinghorror.com/blog/"&gt;Coding Horror&lt;/a&gt; beyond saying that I &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;occasionally&lt;/span&gt; find some real jewels there.  Good stuff for free.&lt;br /&gt;&lt;br /&gt;But Scott's post struck a nerve.  Here's some context. &lt;br /&gt;&lt;br /&gt;I've been contemplating presenting at the local code camp for years now, but have never gotten around to actually doing it.  I'd always figured that I should pick a topic on which I could speak with some authority.  Makes sense I thought, but I was never able to pick one that moved me. &lt;br /&gt;&lt;br /&gt;Localization is a nice, well circumscribed topic that I have engaged pretty thoroughly over the years.  I have some hard earned experience, useful code and guidance borne of long hours.  But I really find it difficult to care enough to put it all together into something that wouldn't risk being a waste of someone's time.  So I've never done it.&lt;br /&gt;&lt;br /&gt;The list of sessions for the code camp was posted a few weeks ago, and I'd been thinking that it would have been nice to see more and new sessions that addressed issues like &lt;a href="http://c2.com/cgi/wiki?SingleResponsibilityPrinciple"&gt;SRP&lt;/a&gt; and &lt;a href="http://c2.com/cgi/wiki?OpenClosedPrinciple"&gt;OCP&lt;/a&gt; and  &lt;a href="http://www.martinfowler.com/articles/injection.html"&gt;Dependency Injection&lt;/a&gt; and other principles of  good design.  Maybe you've seen this coming, but I realized could do that session I wanted.  Certainly then it would be on something that I actually cared about.&lt;br /&gt;&lt;br /&gt;Of course the thing that's kept me from even considering it before is that I'm still learning, and still have a lot to learn.  But I figured there's no reason that I can't do it based on my own struggles to make my code better. &lt;br /&gt;&lt;br /&gt;I finally decided a week ago that I was actually going to do it.  This past week's free time has been spent on reviewing literature, searching for good examples, and trying to make sure I've covered all the bases.  I woke up at 4:30AM this morning and finally had the scenario for a good example.  It was such a nice scenario that I couldn't get back to sleep.&lt;br /&gt;&lt;br /&gt;So after I'd finished documenting my example this morning, it was really nice to see Scott's post about Jeff''s post about Alastair Rankine's post.  Here's the best bit:&lt;br /&gt;&lt;blockquote&gt;We're all just learning together. I started blogging so I could Google myself later, that's all. I taught as an adjunct professor so I could know the topics better as there is no better way to learn a thing deeply than to teach it. I worked on a few books so I could really dig deep, but I'm the first guy to say "dude, I have no idea." My brain bit-rots as yours does.&lt;/blockquote&gt;That is a nice bit of encouragement, isn't it?&lt;br /&gt;&lt;br /&gt;Counting down four more weeks until the code camp and I don't even know if it is still open for submissions (hope so), but I'm going to do the work regardless of whether I can get in under the deadline.  If I do it, you'll read about it here.  But if I don't (and probably even if I do) it will all eventually find its way here.&lt;br /&gt;&lt;br /&gt;We'll see what I can do . . .&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12703226-6771091601812263991?l=stuffbytheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffbytheway.blogspot.com/feeds/6771091601812263991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12703226&amp;postID=6771091601812263991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/6771091601812263991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/6771091601812263991'/><link rel='alternate' type='text/html' href='http://stuffbytheway.blogspot.com/2008/05/professionalism-programming-and.html' title='Professionalism, Programming, and Punditry and Success as a Metric'/><author><name>Charles Crary</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12703226.post-113210251156735855</id><published>2005-11-15T16:45:00.000-08:00</published><updated>2005-11-15T16:55:11.586-08:00</updated><title type='text'>Button Defaults in HTML</title><content type='html'>I'm going to forget this, so . . .&lt;br /&gt;&lt;br /&gt;Managing the active or default button on web page is tricky, depending on what kind of button you are using.  At least in IE.&lt;br /&gt;&lt;br /&gt;Submit buttons (input type submit) don't give you any options.  When your form gets focus, the first submit button gets the equivalent of a setActive().  You can try to call setActive() on subsequent submit buttons, but it doesn't make any difference.&lt;br /&gt;&lt;br /&gt;This is a bummer if you've got a wizard interface, with Cancel, Back and Next all in a row at the bottom of your form.  Note that System.Web.UI.WebControls.Button in ASP.NET renders to one of these buttons.&lt;br /&gt;&lt;br /&gt;However, buttons rendered with the button tag are more forgiving.  They haven't got any default behavior, but at least you can roll  your own by monitoring keystrokes in keypress.  To get my wizard controls buttons to function the way I want, I've created a System.Web.UI.WebControls.Button work-alike control which renders to a button tag instead of an input tag.&lt;br /&gt;&lt;br /&gt;While we're at this, note that setActive() and focus() are two distinct methods, and accomplish different ends.  I want my default button to be setActive() when I'm in any of the controls in my form, but the specific control I'm on has the focus.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12703226-113210251156735855?l=stuffbytheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffbytheway.blogspot.com/feeds/113210251156735855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12703226&amp;postID=113210251156735855' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/113210251156735855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/113210251156735855'/><link rel='alternate' type='text/html' href='http://stuffbytheway.blogspot.com/2005/11/button-defaults-in-html.html' title='Button Defaults in HTML'/><author><name>Charles Crary</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12703226.post-113035067254940747</id><published>2005-10-26T10:59:00.000-07:00</published><updated>2005-10-26T11:17:52.556-07:00</updated><title type='text'>Ellipsis in Internet Explorer</title><content type='html'>I forget this repeatedly - so here it is for future reference.&lt;br /&gt;&lt;br /&gt;To get a string of indeterminent length to display inside a fixed width with ellipses indicating that it is longer, apply the following CSS styles:&lt;br /&gt;&lt;br /&gt;overflow: hidden;&lt;br /&gt;text-overflow: ellipsis;&lt;br /&gt;white-space: nowrap;&lt;br /&gt;&lt;br /&gt;You'll also need to apply a width style.  If you want your entire string to appear in a tool tip, put it into the title attribute of whatever element it is going into.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12703226-113035067254940747?l=stuffbytheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffbytheway.blogspot.com/feeds/113035067254940747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12703226&amp;postID=113035067254940747' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/113035067254940747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/113035067254940747'/><link rel='alternate' type='text/html' href='http://stuffbytheway.blogspot.com/2005/10/ellipsis-in-internet-explorer.html' title='Ellipsis in Internet Explorer'/><author><name>Charles Crary</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12703226.post-111587591353203859</id><published>2005-05-11T22:31:00.000-07:00</published><updated>2005-05-11T22:31:54.300-07:00</updated><title type='text'></title><content type='html'>&lt;p class="mobile-photo"&gt;&lt;img width="320" src="http://photos1.blogger.com/blogger/2603/1089/0/Image_13-713532.jpg"/&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;Gavin's Spring concert.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12703226-111587591353203859?l=stuffbytheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffbytheway.blogspot.com/feeds/111587591353203859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12703226&amp;postID=111587591353203859' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/111587591353203859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/111587591353203859'/><link rel='alternate' type='text/html' href='http://stuffbytheway.blogspot.com/2005/05/gavins-spring-concert.html' title=''/><author><name>Charles Crary</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12703226.post-111540785629600700</id><published>2005-05-06T12:30:00.000-07:00</published><updated>2005-05-06T12:34:47.040-07:00</updated><title type='text'></title><content type='html'>&lt;p class="mobile-photo"&gt;&lt;img width="320" src="http://photos1.blogger.com/blogger/6334/828/0/Image_01-756296.jpg"/&gt;&lt;/p&gt;&lt;p class="mobile-post"&gt;John witnessing to someone at the Taste of Mililani.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12703226-111540785629600700?l=stuffbytheway.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://stuffbytheway.blogspot.com/feeds/111540785629600700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=12703226&amp;postID=111540785629600700' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/111540785629600700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12703226/posts/default/111540785629600700'/><link rel='alternate' type='text/html' href='http://stuffbytheway.blogspot.com/2005/05/john-witnessing-to-someone-at-taste-of.html' title=''/><author><name>Charles Crary</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
