<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Elegant Code &#187; Widgets of Wisdom</title>
	<atom:link href="http://elegantcode.com/tag/widgets-of-wisdom/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 10:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Your First Developer Job</title>
		<link>http://elegantcode.com/2008/05/06/your-first-developer-job/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=your-first-developer-job</link>
		<comments>http://elegantcode.com/2008/05/06/your-first-developer-job/#comments</comments>
		<pubDate>Wed, 07 May 2008 04:45:09 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/05/06/your-first-developer-job/</guid>
		<description><![CDATA[I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see [...]]]></description>
			<content:encoded><![CDATA[<p>I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see them learn about the aspects of real life we face in developing solutions for clients. My favorite quote of the whole semester was, &quot;I don't think the client even knows what they want. I don't get it. Why are we even here?&quot; Awesome, no? Doesn't that just sum it all up? The beautiful thing about this is how the students were surprised when this happened. But I digress...</p>  <p>As we were wrapping up the last night I received what seemed like an innocent enough question from one of the students. &quot;What kind of job do you think I should look for?&quot;</p>  <p>It really caught me off guard, although I should have seen it coming. I didn't have a good answer on the tip of my tongue, and that may be because there isn't one. The CIS program is not designed specifically to churn out developers, but introduces students to all sorts of disciplines so they can pick a specialty later. For example thy study project management, requirements analysis, some programming, some networking, you get the idea. So the question really was bigger than it seemed. </p>  <p>Let's assume for this post that the person in question wanted to be a developer. Even if the person is looking to become a developer, the question what kind of employer to seek out isn't an easy one.</p>  <p>My father has worked 45 years as a mechanic for 2 employers. He is happy doing that. Many people, in fact most, are content with an occupation just like that. There is nothing in the world wrong with this; the world turns, people still live and love, people die, babies are born, all without making a life out of their career. Other people don't see things that way. They are passionate about their work and want to contribute to a higher vision of their chosen profession. I would guess if you are reading this, you see yourself in a similar light.</p>  <p>Someone develops code for the state government agencies. In fact, I have met many competent people who do exactly that. Are those developers missing out on something? Probably not in their mind, or they wouldn't be there. The point is simply that for some people a job is a job and there is no dishonor there.</p>  <p>This means my answer can't be glib, it must be realistic. You can't just say, &quot;Go somewhere Agile,&quot; or, &quot;Find a place where you can write Ruby.&quot; This is real life and sometimes grown ups balance security and risk and boredom and excitement because they have kids at home, or need special medical accommodation, or any one of a host of other considerations.</p>  <p>All that said, if you are passionate about the craft, if you want to drink in the industry, if you do want to learn as much as you can as soon as you can, I say this: Go work for a company with fewer than 50 employees building web solutions. </p>  <h2>Locus of Control</h2>  <p>As a company grows larger, the <a href="http://en.wikipedia.org/wiki/Locus_of_control" target="_blank">locus of control</a> individuals have inside the organization grows smaller. This is easy to see. </p>  <p>In smaller organizations, people tend to be jacks of all trades. If a server goes down, you care. If a defect is found, you care. If there is a client in the picture, you tend to actually know them. In short, small organizations provide first hand experience with many aspects of developing and delivering products. </p>  <p>In larger companies and teams, people tend to be expected to focus on a small niche of expertise. I cannot begin to tell you the number of resumes I have seen from people who spent years poking at HP's test harness suite or Micron's order entry system. This kind of &quot;specialization&quot; is not usually a recipe for career growth.</p>  <h2>Technology Exposure</h2>  <p>You'll get to go deep on technology because you are part of a small group that simply must make it work. There is no passing the buck, because there is no one to pass it to. You'll get to know whatever the technology stack is inside and out.</p>  <p>I recommend web development for a simple reason, the web isn't going away! Additionally, the technology involved in delivering to the web is growing at an astounding pace. I don't know what the web will evolve to&#160; in years to come, but it will be on hulluva ride.</p>  <h2>Comradery and Mentorship</h2>  <p>In a small organization, it is easier to foster a genuine sense that we are all in this together. The esprit de' corp in a smaller organization is typically tighter than in large organizations. This means you stand a better chance of falling in with someone who can actually mentor your career and take a genuine interest in your development.</p>  <p>Of course this exists in larger companies and is lacking in many smaller ones. I do think it is more generally found in smaller organizations, though.</p>  <h2>Conclusion</h2>  <p>So, what's the right answer? There isn't one, of course. There are just too many options and factors.</p>  <p>I will say that instead of ensuring your potential employer can pass <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" target="_blank">Spolsky's Joel Test</a>, it is more important to ensure you will be empowered to help them pass it if you come aboard.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/05/06/your-first-developer-job/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Many Uses of Relative Estimation</title>
		<link>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-many-uses-of-relative-estimation</link>
		<comments>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 21:57:16 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/</guid>
		<description><![CDATA[Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety. Have you ever looked at the website HotOrNot.com? It turns out that pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety.</p>  <p>Have you ever looked at the website <a href="http://www.hotornot.com/" target="_blank">HotOrNot.com</a>? It turns out that pretty much everyone from Quazzi Modo to Angelina Jolie ranks from a 4 to a 7. This is a prime example of our poor ability to estimate on a closely related value scale. It is pretty tough to tell if something is a 2 or a 3, but it is pretty easy to see the difference in size between a 5 and a 13. 13 is more than twice as big as 5, right?</p>  <p>Think about it this way: Does it really matter if something is going to take 3 hours or six hours? In software development, it typically doesn&#8217;t matter.</p>  <p>So the relative estimation model looks like this, in pursuing an estimate for piece of work A: </p>  <ol>   <li>Is this piece of work bigger or smaller than that piece of work B that we already did? </li>    <li>Bigger? OK, how much bigger? 2X bigger? 3X? </li>    <li>OK, 4X bigger. </li>    <li>Here is piece of work C that we already did. It was estimated at 4X bigger than B. Is it roughly the same size as A? </li>    <li>Yes. </li>    <li>Cool, we are done. </li> </ol>  <p>Once we understand that we can trust these relative comparisons because we are better at them than empirical estimation, it becomes much easier to size our work. Look at things you've already done and estimate the new one in relation to the previous work. We get our relative size and convert it into time, dollars, or whatever the project managers need and we are done. This is a much faster (and accurate) thing to do than to break it down into tasks and estimate each task. Why? Because we will never get the tasking right.</p>  <p>There is a ton more that could be said (and has) on relative estimation, but remember this: The next time you have to estimate a project for your manager, make it easier on yourself by doing a relative size first. You'll get back to coding much faster and you'll find the numbers are amazingly accurate.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Opposite of a Singleton?</title>
		<link>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-opposite-of-a-singleton</link>
		<comments>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 03:42:22 +0000</pubDate>
		<dc:creator>Alex Mueller</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/</guid>
		<description><![CDATA[I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to [...]]]></description>
			<content:encoded><![CDATA[<p>I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to the inverse object as a &quot;new object.&quot; As I pondered this later in the day, I considered adjectives describing the nature of objects. They can be many things, but two concepts that popped into my head to classify them were &quot;complex&quot; and &quot;simple.&quot; </p>  <p>I started playing with the words and making them resemble singleton. &quot;Complexton&quot; did not sound right to me. I should mention that I was washing my hands as I was contemplating this. I lifted up my head, looked into the mirror, and thought, &quot;SIMPLETON.&quot; The opposite of a singleton is a &quot;simpleton.&quot;</p>  <p>If the opposite of a singleton is not a &quot;simpleton,&quot; then what is it? Until I find a plausible answer, I will try and insert this new term into my next design discussion. </p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What is Elegant Code to me?</title>
		<link>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-is-elegant-code-to-me</link>
		<comments>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 03:47:45 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/</guid>
		<description><![CDATA[This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&#160; It isn't easy to describe.&#160; And really, the notion of what constitutes elegance in code changes over time.&#160; There is no static "this is good code" test, and I doubt there ever will be.&#160; Plus, [...]]]></description>
			<content:encoded><![CDATA[<p>This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&nbsp; It isn't easy to describe.&nbsp; And really, the notion of what constitutes elegance in code changes over time.&nbsp; There is no static "this is good code" test, and I doubt there ever will be.&nbsp; Plus, what makes good code in one language, may not apply to the next.</p> <p>So let me state for the record: today's elegant code is tomorrow's drivel.&nbsp; Don't feel bad, many writers have the same problems.&nbsp; What was super amazing back in the day is now rubbish or near unreadable.&nbsp; I am thinking of the Victorian writing that Hemingway usurped, and now Hemingway himself is almost unreadable (to me anyway).&nbsp; Tastes change with the times.&nbsp; That is a simple fact.</p> <p>So what can you do about this?&nbsp; As I say that old writing sucks to read (read Washington Irvine lately?), great works of literature still abound (for instance, Hemingway is still a great writer -- even if I prefer Tolkien) .&nbsp; So take some notes from them, and from other crafts in looking for the answer.&nbsp; If you want a cliff notes version of what this is going to tell you, it is this: you must always push yourself to get better.</p> <ol> <li>Find a good teacher.&nbsp; Nothing is better than sitting at the feet of a master who can nudge you along in the right direction.&nbsp; While early mistakes can often be corrected easily with a little bit of guidance, after they have had some time to fester all bets are off.&nbsp; I believe a fare number of "Anit-patterns" were created by self taught developers (find <a href="http://elegantcode.com/2008/03/21/sql-ejaculation/">SQL Ejaculation</a> on this site).&nbsp; <li>Read.&nbsp;&nbsp; Good writer are first good readers.&nbsp; Start with Code Complete, move into a good Patterns book, get MSDN Magazine, find some bloggers your like, but keep moving.&nbsp; You will NEVER be done reading.&nbsp; I imagine that even Martin Fowler has a "to read" booklist a mile long.  <li>Read code.&nbsp;&nbsp; There are a plethora of open source project just waiting to be read -- do so.&nbsp; This is the single best way to expand your coding repertoire, find things your language can do that you didn't even know about..&nbsp;&nbsp; Scott Hanselman has recently popularized this idea, and I thank him for it.  <li>Practice.&nbsp; This means writing small applications at home.&nbsp; You get an idea that you want to try out -- do it.&nbsp; I don't mean you have to write finished applications, just have some exploring time.&nbsp; I remember talking with an 80 year old master woodworker (he lives down the street from me), who was telling me how many time he would practice making dovetail joints before he felt competent.&nbsp; It was years worth.  <li>Pay Attention.&nbsp; Being good at anything really amounts to that.&nbsp; And don't just pay attention when reading, writing, or talking about code.&nbsp; Inspiration come from everywhere, any good artist will tell you that.&nbsp; Pay attention when you cook, when you work on the car, when you are wood working, playing an instrument, whatever it is that you do.&nbsp; This will help you in the end, event if it is just learning the amount of dedication it really takes to become good at something.  <li>Beware of preferences.&nbsp; Any time I hear someone start a statement with "I prefer code to ..." you know things are going downhill.&nbsp; If you find someone who cares more about how your code is formatted then how it is written you have found yourself in a mess.&nbsp; More importantly, beware of them in yourself.&nbsp;&nbsp; Having code style standard is important, but it isn't worth loosing sleep over.&nbsp; This also pertains to inheritance, patterns, use of particular classes (e.g. always using the generic list class in C# when a Dictionary would be better).&nbsp; <li>No Sacred Cows. Believe no single source of information.&nbsp; This means not thinking that Microsoft, Sun, IBM, Richard Stallman, or anyone else will have all of the correct answers.&nbsp; Apply the scientific method and do some research, experiment, and question the authority.&nbsp;&nbsp; There should be no sacred cows in programming.  <li>Talk with others.&nbsp; Join a user group, show up every now and then, heckle the presenter, and -maybe- speak.&nbsp; You want a broad range of people who you can talk to and bounce ideas off of.&nbsp; This will help you from becoming that crazy guy in the corner who vehemently states that all your code should be in one file.&nbsp; Having a mentor (mentioned earlier) is great, but having people around to push you from multiple directions is also good.  <li>Learn languages.&nbsp; This gets back to the "read code" idea. Make that multiple types of languages as well.&nbsp; If you know C# or Java and SQL, learn Python or Ruby, get really good at JavaScript.&nbsp; If you want something really out there, learn MDX.&nbsp; This is also a repertoire thing.&nbsp; Seeing how other languages work will make you rethink your ideas about what your current code, in whatever languages you are working in, should look like.  <li>Keep Thinking!!!&nbsp; That is possibly the most important point.&nbsp; Keep thinking.&nbsp; Don't just evaluate something once and never return, go back and reevaluate. Did the technique work?&nbsp; How could it have been better?&nbsp;&nbsp; The idea is continual improvement.  <li>Switch jobs every now and then.&nbsp; When I announced I was leaving my first programming job out of college, the VP of R&amp;D had me sit down with him and talk.&nbsp; He wasn't trying to keep me (he knew I was moving to be closer to family), he wanted to give me some advice.&nbsp; He told me to change jobs every three years.&nbsp; After you have been with a place for three years you have probably learned everything you are going to learn and it time to move on.&nbsp; This doesn't mean changing companies either.&nbsp; I've been with the same company now for four years, but I've had three different jobs.&nbsp; If you have been writing commercial applications, become a consultant - or vise-versa, become a test engineer, expand your boundaries.&nbsp; Again, this is about pushing yourself to be better.  <li>Have a Hobby. But don't ask about me, I have too many.&nbsp;&nbsp; Creating software is about creating things.&nbsp; So I suggest picking a hobby that involves creating something.&nbsp; Popular hobbies amongst programmers I know include: cooking, music, woodworking, beer making, and BBQ (which is different than cooking).&nbsp; But don't discount sports (golf is always popular), computer games, and board games.&nbsp; Anything that promotes the development of skill levels can't be a bad thing. </li></ol> <p>And I'm stopping there.&nbsp; This is my beginner's guide to how to become the writer elegant code.&nbsp; If you have others you think I missed, add them too the comments.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NetDug Unit Testing</title>
		<link>http://elegantcode.com/2008/03/22/netdug-unit-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=netdug-unit-testing</link>
		<comments>http://elegantcode.com/2008/03/22/netdug-unit-testing/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 21:00:30 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/22/netdug-unit-testing/</guid>
		<description><![CDATA[So last night I had the opportunity to be the moderator at NetDug, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk [...]]]></description>
			<content:encoded><![CDATA[So last night I had the opportunity to be the moderator at <a href="http://www.netdug.com">NetDug</a>, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk with 20 slides, I think I showed about 5 of them.  I consider that a success (I threatened the audience, the less they talked, the more slides I would show).

<a href="http://elegantcode.com/wp-content/uploads/2008/03/unittestingdemo.zip">Slides and sample code</a>

What I learned from last night:
<ol>
	<li>I'm not much of a moderator (I talk to much)</li>
	<li>Code coverage is a art in divination</li>
	<li>Mock/Stub/Fake Objects are hard to explain</li>
	<li>Over use Mocks could be a code smell</li>
	<li>The discussion format actually works pretty well for talking about unit testing</li>
	<li>If you give geeks a chance to talk, they will talk</li>
</ol>
What I hope everyone else got from the topic:
<ol>
	<li>Unit testing forces you to write better code</li>
	<li>Unit testing forces you to use better object oriented principles</li>
</ol>
<h3>Test Technology</h3>
This was an early question, what technologies to use to test your code.  <a href="http://www.nunit.org/index.php">NUnit</a>, MSUnit, and <a href="http://www.mbunit.com/">MBUnit</a> were all mentioned and viable, and stable, technologies.  For mock objects (which you are going to need) there is <a href="http://www.ayende.com/projects/rhino-mocks/downloads.aspx">Rhino Mocks</a> and <a href="http://www.typemock.com/">TypeMock</a>.  I suggest Rhino Mocks over <a href="http://www.typemock.com/">TypeMock</a> for anyone who can't purchase the full version of <a href="http://www.typemock.com/">TypeMock</a> (but there is a nice free version as well).

Then there are the helper technologies: <a href="http://testdriven.net">TestDriven.Net</a> and <a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> are the main two, but apparently MSUnit's runner isn't bad either (I haven't used it yet).  All of these tools make it easier to run your unit tests from inside Visual Studio, and each has other benefits.  <a href="http://testdriven.net">TestDriven.Net</a> has wonderful Reflector integration (a better object browser), and ReSharper...<a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> is just a must have (that is me talking, not the group).
<h3>Code Coverage</h3>
Code Coverage, using tools like <a href="http://www.ncover.com/">NCover</a> (<a href="http://www.ncover.com/download/discontinued">free version</a>), tell you how much of your code base is tested.  This was one of the early questions.  How much of your code base should be tested?  Answer: it depends on the product.  My view is that a library (no UI element) should have +90% coverage, if there is a substantial amount of UI then the project can get down to 60%.  If your code coverage gets below that you just aren't trying, or you need to rethink your architecture. 

I did talk a bit about code that was not really testable (not in an automated way anyway): UI, Database code, and external resource code are all potentially untestable.  More on this in a moment.

Database code is not testable if you can't return the database to a known state (you can restore the database data). 

UI code testing should be avoided because UI tests have to be so bound to the UI that they are brittle.  So you end up spending a considerable portion of your development time fixing broken test. Brittle tests are to be avoided whenever possible.
<h3>Testing existing code</h3>
Probably the hardest question to answer from last night was: how do you test existing code bases.  And that came up over and over.  Do you start with integration tests and then work in unit tests, or the other way around. 

I will admit, most of the time when I talk about unit testing, I center it around new projects.  Unit test is hard enough with new code, testing old code that wasn't written with unit test in mind is a migraine waiting to happen.

The audience did have some good advice though.  Pick parts of the project that you need to work on (say one class) and make that testable and tested.  Essentially you start creating silos of tested code.  The other suggestion (and I actually had a slide for this) was to get the book: <a href="http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206114497&amp;sr=8-1">Working Effectively with Legacy Code</a>.  Finally, buy TypeMock -- the big boy version, not the free-be version.  You'll need it.
<h3>UI Testing</h3>
This is my treatise on writing unit tests for the User Interface:

1. Don't do it until you are done with the UI.
2. Only test that the UI works in a basic sense.
3. You still have to test the UI by hand.

If you start writing UI tests while you are developing the UI, you will continually break the tests.  Writing the test by hand is none trivial, and using tools to write them is also error prone.  Finally, these tests can't tell you if the UI is just bad.  Only exposure can tell you that.  Every developer should be forced to have to use their UI repeatedly so they know where is sucks.  You wont get that with automated UI tests.

That said, there are tools to help you test web user interfaces. <a href="http://watin.sourceforge.net/">Watin</a>, <a href="http://wtr.rubyforge.org/">Watir</a>, and <a href="http://selenium.openqa.org/">Selenium</a> are all there to help.  We shall see if Team Systems adds anything to help with this (I'm hoping it does).
<h3>Testing Database code</h3>
This is essentially, testing code that touches the database.  Could be your <a href="http://www.hibernate.org/343.html">NHibernate</a> code, could be a stored procedure, could be ADO.Net code.  But really, this is just code that must touch an outside resource (database, file system, serial connection, etc) and there is no way, or point, to abstract it out any further.

The main point here was to have a way to get the data back to a known state.  Without that everything else gets much harder.

We also came up with a new term: SQL Ejaculation.  That is a pattern smell where an excessive amount of your HTML comes from you SQL database.  Like the entire site.  All of the HTML.  And you have stored procedures that simply build the HTML -- in a 10,000 line stored procedure.  That is SQL Ejaculation.

Note: if this comes up in a Google search I might get worried.
<h3></h3>
<h3>After the meeting</h3>
We all went to Table Rock for a beer.  'nuf said, it is a great group.

Finally, to the guy who asked me a question after the meeting was over: I'm sorry, I just haven't had to draw multiple, overlapping, transparent images on a win form using GDI.Net in a really long time.  I know it involves alpha-transparency values, but I haven't done that in years.  Maybe you should look at WPF.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/22/netdug-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be Careful of Your Passion</title>
		<link>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=be-careful-of-your-passion</link>
		<comments>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 14:37:04 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Architecture and Design]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/02/27/be-careful-of-your-passion/</guid>
		<description><![CDATA[Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." Most of us got into this business because we liked making computers do things we [...]]]></description>
			<content:encoded><![CDATA[<p>Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." </p> <p>Most of us got into this business because we liked making computers do things we think of as cool. The most successful among us still get that rush when our new creation spools up and runs.</p> <p>Tinkerers like us tend to gold plate the pieces of our systems we find most interesting. This is why developers will often find themselves the go-to-guy for certain specialities. A dev likes making services, she makes good ones because it's fun, she gets to make more of them. Sounds perfectly reasonable and symbiotic, no?</p> <p>It can be.</p> <h2>Ignoring the Boring</h2> <p>When we get to focus exclusively on the parts of the system that really flip our bits, it can come at a price. Although we might be jazzed about services, that data model still needs our attention. It is fairly common to focus on that thing that really gets us excited and forget (or outright ignore) that part which seems boring. Just because you think someone else will come along and sweep up after doesn't make it happen. </p> <p>The most common instance of "Ignoring the Boring" is documentation. Let's face it, we want to write in languages other than English, right? Documentation is in the elegance of my self-describing code, right? Not so much. Whether we like it or not, documentation is often a deliverable of our system and as such deserves the respect we might give to our WSDL or interface definitions. Just because the reader is a human rather than a machine doesn't mean we should short change her because it's boring to do the work.</p> <h2>Smells of Sub-Optimizing</h2> <p>It is easy to see this kind of monocular behavior can result in a really clean UI with a messy back end, or visa versa. Whatever gets the short end of the stick will tend to show up in the system as a glaring deficit. We can then measure the deficit in the ignored sub-component in observable ways. Some failures of attention to detail might include:</p> <ul> <li>Lack of enforced constraints or relationships in database tables  <li>Code in the view, because it's just this one little thing  <li>Leaky abstractions, because wrapping that data model in business logic can be a real PITA  <li>No check in notes  <li>Not taking the time to do code reviews, even informally</li></ul> <h2>The System Isn't Your Playground</h2> <p>On the other end of the spectrum, what happens when we get to play with the things that <em>are</em> fun? The results can depend on what the implementer really enjoys.</p> <p>One recent real world story I heard told of a hardware engineer who designed 7 different chips within a device, each with a fundamentally different way of representing logic circuits. The chip engineer had a great time applying all the different techniques he read about in last month's <em>Nerd Fest Quarterly</em>, but the team assigned to test this Franken-board was rightly annoyed.</p> <p>Another symptom of playground development is needless abstraction layers or design patterns applied to simple problems. If a system is implemented with a gazillion abstraction layers where only a concrete implementation will do, you can bet someone is reading the <em>Gang of Four</em> in bed at night.</p> <p>If your passion is trying new tools and technologies, how many of these shiny new toys are incorporated into your system without deliberate attention? How many logging libraries does one team really need? How many unit test frameworks?</p> <p><a href="http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It" target="_blank">YAGNI</a>, 'nuff said.</p> <h2>Keep Your Passion Alive</h2> <p>So, what are you saying, Starr? Stop trying to extract pleasure from my work? Just bang the keys and give my 40 to the man? Of course not!</p> <p>I am simply asserting that there is a degree of professionalism needed at all levels. Let's care about the system as a whole and be good stewards to the craft, not just the shiny bits. And, yes, documentation is a justifiable deliverable. Cowboy up.</p> <p>Learn new techniques that fire you up and apply them wisely, not with wild abandon. Delayed gratification means not always getting to use WPF to make a draw a button, or SilverLight to make a logo spin (&lt;-- bad example). Sometimes this means capitulating to use the prescribed framework so we can get a systemic optimization instead of trying to roll our own multi-tenant web portal, yet again.</p> <p>Having more tools in our toolbox is a great thing. This is the essence of youthful fun in our work. Knowing when to use those shiny new tools is the wisdom part. Now go learn something new.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Confessions of a bad web developer</title>
		<link>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=confessions-of-a-bad-web-developer</link>
		<comments>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 03:57:55 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/</guid>
		<description><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately. Not a lot, just enough to get acquainted for right now. Yesterday I had my "Road to Damascus" incident. I don't know HTML. OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them [...]]]></description>
			<content:encoded><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately.  Not a lot, just enough to get acquainted for right now.  Yesterday I had my "Road to Damascus" incident.  I don't know HTML.

OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them without looking things up.  More importantly, I know a ton of asp.net controls.  What I don't know, specifically, is how they all work.

Like the form tag.  I know every Asp.Net page I have ever made has had one of them (and only one, at least as of .Net 1.1 that is all you were allowed).  But I don't remember how to use it any more.  How to read data from it, pass values from one page to the next.  I used to, did it a few times in fact.  Then came Asp.Net, and I haven't looked back.

Have I written JavaScript during this time?  Sort of.  If you count copying code from Google (and testing it of course).  Over the years I have large blocks of Googled JavaScript code in existing projects that I've move from page to page.  Cut-and-paste is a type of reuse...right?  And lately, when my JavaScript requirements have not been Google-able, <a href="http://jquery.com">JQuery</a> has become my savior (more posts on that soon).  But I haven't written a JavaScript object, Prototype, or any such tomfoolery since Netscape 4.8.

And just to clarify.  I once wrote my own tree control in JavaScript.  Or, I wrote one for Netscape 4.04, 4.08, 4.5, 4.75, 4.8, and IE.  I never thought I could hate a language until Netscape.  Netscape killed any love of JavaScript for me.

But now with Ajax on the scene I can't do without it anymore.  And as cool as the Asp.Net Ajax Library is and all of the things that the control toolkit can do for you: without a bit of JavaScript muscle, it just isn't going to work for you.  Take a look at the Google Maps API and tell me you aren't thinking of things that could be done with it.  But it ain't going no where without some JavaScript know-how.

CSS I have come to terms with.  I know the difference between .tag and #tag.  I've written a hover or two.  But there are still unknowns there as well.  I still visit <a href="http://w3schools.com/css">w3schools</a> regularly, and spend way too much time with <a href="http://www.getfirebug.com">FireBug</a> and <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a>.  And <a href="http://csszengarden.com">CssZenGarden</a> -- that is just beyond me right now.

But even in Asp.Net.  <a href="http://www.xefteri.com/articles/show.cfm?id=18">How does a post back work?</a> How is it that a button click is hooked up to an event handler? I'm a firm believer that their is no "magic" in programming.  Post back is magic to me.   Maybe once years ago I knew, but not anymore.

But things like: if you have a table, and every row has a check box on it, on the server side, how do you know which check box is which?  Heck, how do I figure that out on the client side with JavaScript?  The magic is ViewState, I know.  But...

That really is the beauty of WebForms.  It provides a nice insulating coat that insulates you from all of the goo that is html and JavaScript.  ViewState is my friend.  But what does this have to do with Asp.Net MVC?  Absolutely everything.

Asp.Net is a stripped down version of web development with .Net.  ViewState: gone.  asp:Button: hope you are familiar with submit.  The cozy jacket is gone and has been replaced with a wind breaker.  All those old techniques that we threw away with our last ASP page needs to be resurrected.

Being how I already live in a cold climate, I know that the biggest part of working in cold weather is to acclimated to the temperature.  Part of it as well, is knowing that you have to work in the cold climate.  So this isn't time to put things off.  Spring is still a ways off.  So, for Asp.Net WebForms developers, that means re-familiarizing yourself with a few technologies that we all thought we didn't need to know that well:
<ul>
	<li>XHML</li>
	<li>CSS</li>
	<li>JavaScript</li>
	<li>JSON</li>
	<li>JQuery</li>
	<li>Asp.Net Ajax framework</li>
</ul>
I'm not going to specify particular books.  I don't have time for that, and you can search Amazon as well as I can.  Actually, I bought a couple of these books for  at Hastings near my house.  Worth every cent.

Also worth noting what is not on my list: XML.  The language we thought was the lingua franca of the web.  I've had enough XML, and the Asp.Net Ajax library talks via JSON (which is much smaller).   So XML is out for me.  And that is fine, I think, there is enough to learn as is.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom IV</title>
		<link>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iv</link>
		<comments>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 04:48:42 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins. Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. [...]]]></description>
			<content:encoded><![CDATA[<p>If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a href="http://elegantcode.com/?p=646" target="_blank">here</a>.</p> <ol> <li>Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins.  <li>Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. .Net, as an example.  <li>If metrics are prescribed to a team, explain how they will be used. Metrics cause fear, mitigate that fear.  <li>You can prescribe Agility, but not hyper-performance.  <li>Part of the maturation process of Agile is the tendency for people to over-analyze the holy heck out of it. This is relly a reaction to the cost of software development and the incredible amounts of historical waste in the industry.  <li>CEOs do not care about code coverage. Speak to them appropriately about quality.  <li>Earned value reporting is ridiculous.  <li>"Don't wait until the customer is screaming to optimize for performance." <em>-- Thanks, Kevin</em>.  <li>Deliver less, but sooner and more often. <li>"Daddy, is that your new <a href="http://en.wikipedia.org/wiki/Out-Of-Box_Experience" target="_blank">OOBE</a>?" - My kid when I opened my new MacBook. "Yes, it is, son. Yes, it is."</li></ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom III</title>
		<link>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iii</link>
		<comments>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 04:14:20 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=664</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Carry a model at all times to express your understanding to others. Look for patterns in all systems at all levels. Seeing them is the very essence of insight. At the application level, architecture and design are synonymous. "BizTalk is overkill" [...]]]></description>
			<content:encoded><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a target="_blank" href="http://elegantcode.com/?p=646">here</a>.
<ol>
	<li>Carry a model at all times to express your understanding to others.</li>
	<li>Look for patterns in all systems at all levels. Seeing them is the very essence of insight.</li>
	<li>At the application level, architecture and design are synonymous.</li>
	<li>"BizTalk is overkill" is a typically overheard comment of <em>Drive by Architecture</em>.</li>
	<li>Developers would never prescribe BizTalk or a TIBCO or any other message bus system. That type of decision is typical of a CTO or someone who reports directly to one. These are strategic decisions.
"I think that, generally, if you're looking at something like BizTalk, you're probably looking at somebody, a directory port of a CIO or a CTO, I would say." -- Roger Session</li>
	<li>"Anything that is architecture and is specific to a particular technology is kind of an oxymoron." -- Roger Sessions</li>
	<li>Good design allows for emergent functionality, which we can also think of as purposeful evolution.</li>
	<li>The Open/Close principle doesn't mean you can't recompile. -- Allan Shalloway</li>
	<li>Fewer keystrokes != Elegant Code. Damn it! -- Dave Starr :)</li>
	<li>Architectural decisions are those that will kill your business if they are wrong.</li>
	<li>To introduce a new technology into a system, have the entire team immerse in an architectural spike, then estimate.</li>
	<li>Schedule riskiest work first. Try prioritizing a backlog by risk.</li>
	<li>The work of a developer is to uncover complexity, the work of an architect is to simplify it.</li>
	<li>A legacy system is one that is already making money.</li>
	<li>“The <a href="http://en.wikipedia.org/wiki/Winchester_Mystery_House">Winchester House</a> in San Jose is the perfect example of following a vision without a plan.”</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Ways to Stop Context Switching</title>
	<atom:link href="http://elegantcode.com/tag/widgets-of-wisdom/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 10:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Elegant Code &#187; Widgets of Wisdom</title>
	<atom:link href="http://elegantcode.com/tag/widgets-of-wisdom/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 10:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Your First Developer Job</title>
		<link>http://elegantcode.com/2008/05/06/your-first-developer-job/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=your-first-developer-job</link>
		<comments>http://elegantcode.com/2008/05/06/your-first-developer-job/#comments</comments>
		<pubDate>Wed, 07 May 2008 04:45:09 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/05/06/your-first-developer-job/</guid>
		<description><![CDATA[I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see [...]]]></description>
			<content:encoded><![CDATA[<p>I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see them learn about the aspects of real life we face in developing solutions for clients. My favorite quote of the whole semester was, &quot;I don't think the client even knows what they want. I don't get it. Why are we even here?&quot; Awesome, no? Doesn't that just sum it all up? The beautiful thing about this is how the students were surprised when this happened. But I digress...</p>  <p>As we were wrapping up the last night I received what seemed like an innocent enough question from one of the students. &quot;What kind of job do you think I should look for?&quot;</p>  <p>It really caught me off guard, although I should have seen it coming. I didn't have a good answer on the tip of my tongue, and that may be because there isn't one. The CIS program is not designed specifically to churn out developers, but introduces students to all sorts of disciplines so they can pick a specialty later. For example thy study project management, requirements analysis, some programming, some networking, you get the idea. So the question really was bigger than it seemed. </p>  <p>Let's assume for this post that the person in question wanted to be a developer. Even if the person is looking to become a developer, the question what kind of employer to seek out isn't an easy one.</p>  <p>My father has worked 45 years as a mechanic for 2 employers. He is happy doing that. Many people, in fact most, are content with an occupation just like that. There is nothing in the world wrong with this; the world turns, people still live and love, people die, babies are born, all without making a life out of their career. Other people don't see things that way. They are passionate about their work and want to contribute to a higher vision of their chosen profession. I would guess if you are reading this, you see yourself in a similar light.</p>  <p>Someone develops code for the state government agencies. In fact, I have met many competent people who do exactly that. Are those developers missing out on something? Probably not in their mind, or they wouldn't be there. The point is simply that for some people a job is a job and there is no dishonor there.</p>  <p>This means my answer can't be glib, it must be realistic. You can't just say, &quot;Go somewhere Agile,&quot; or, &quot;Find a place where you can write Ruby.&quot; This is real life and sometimes grown ups balance security and risk and boredom and excitement because they have kids at home, or need special medical accommodation, or any one of a host of other considerations.</p>  <p>All that said, if you are passionate about the craft, if you want to drink in the industry, if you do want to learn as much as you can as soon as you can, I say this: Go work for a company with fewer than 50 employees building web solutions. </p>  <h2>Locus of Control</h2>  <p>As a company grows larger, the <a href="http://en.wikipedia.org/wiki/Locus_of_control" target="_blank">locus of control</a> individuals have inside the organization grows smaller. This is easy to see. </p>  <p>In smaller organizations, people tend to be jacks of all trades. If a server goes down, you care. If a defect is found, you care. If there is a client in the picture, you tend to actually know them. In short, small organizations provide first hand experience with many aspects of developing and delivering products. </p>  <p>In larger companies and teams, people tend to be expected to focus on a small niche of expertise. I cannot begin to tell you the number of resumes I have seen from people who spent years poking at HP's test harness suite or Micron's order entry system. This kind of &quot;specialization&quot; is not usually a recipe for career growth.</p>  <h2>Technology Exposure</h2>  <p>You'll get to go deep on technology because you are part of a small group that simply must make it work. There is no passing the buck, because there is no one to pass it to. You'll get to know whatever the technology stack is inside and out.</p>  <p>I recommend web development for a simple reason, the web isn't going away! Additionally, the technology involved in delivering to the web is growing at an astounding pace. I don't know what the web will evolve to&#160; in years to come, but it will be on hulluva ride.</p>  <h2>Comradery and Mentorship</h2>  <p>In a small organization, it is easier to foster a genuine sense that we are all in this together. The esprit de' corp in a smaller organization is typically tighter than in large organizations. This means you stand a better chance of falling in with someone who can actually mentor your career and take a genuine interest in your development.</p>  <p>Of course this exists in larger companies and is lacking in many smaller ones. I do think it is more generally found in smaller organizations, though.</p>  <h2>Conclusion</h2>  <p>So, what's the right answer? There isn't one, of course. There are just too many options and factors.</p>  <p>I will say that instead of ensuring your potential employer can pass <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" target="_blank">Spolsky's Joel Test</a>, it is more important to ensure you will be empowered to help them pass it if you come aboard.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/05/06/your-first-developer-job/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Many Uses of Relative Estimation</title>
		<link>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-many-uses-of-relative-estimation</link>
		<comments>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 21:57:16 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/</guid>
		<description><![CDATA[Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety. Have you ever looked at the website HotOrNot.com? It turns out that pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety.</p>  <p>Have you ever looked at the website <a href="http://www.hotornot.com/" target="_blank">HotOrNot.com</a>? It turns out that pretty much everyone from Quazzi Modo to Angelina Jolie ranks from a 4 to a 7. This is a prime example of our poor ability to estimate on a closely related value scale. It is pretty tough to tell if something is a 2 or a 3, but it is pretty easy to see the difference in size between a 5 and a 13. 13 is more than twice as big as 5, right?</p>  <p>Think about it this way: Does it really matter if something is going to take 3 hours or six hours? In software development, it typically doesn&#8217;t matter.</p>  <p>So the relative estimation model looks like this, in pursuing an estimate for piece of work A: </p>  <ol>   <li>Is this piece of work bigger or smaller than that piece of work B that we already did? </li>    <li>Bigger? OK, how much bigger? 2X bigger? 3X? </li>    <li>OK, 4X bigger. </li>    <li>Here is piece of work C that we already did. It was estimated at 4X bigger than B. Is it roughly the same size as A? </li>    <li>Yes. </li>    <li>Cool, we are done. </li> </ol>  <p>Once we understand that we can trust these relative comparisons because we are better at them than empirical estimation, it becomes much easier to size our work. Look at things you've already done and estimate the new one in relation to the previous work. We get our relative size and convert it into time, dollars, or whatever the project managers need and we are done. This is a much faster (and accurate) thing to do than to break it down into tasks and estimate each task. Why? Because we will never get the tasking right.</p>  <p>There is a ton more that could be said (and has) on relative estimation, but remember this: The next time you have to estimate a project for your manager, make it easier on yourself by doing a relative size first. You'll get back to coding much faster and you'll find the numbers are amazingly accurate.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Opposite of a Singleton?</title>
		<link>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-opposite-of-a-singleton</link>
		<comments>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 03:42:22 +0000</pubDate>
		<dc:creator>Alex Mueller</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/</guid>
		<description><![CDATA[I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to [...]]]></description>
			<content:encoded><![CDATA[<p>I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to the inverse object as a &quot;new object.&quot; As I pondered this later in the day, I considered adjectives describing the nature of objects. They can be many things, but two concepts that popped into my head to classify them were &quot;complex&quot; and &quot;simple.&quot; </p>  <p>I started playing with the words and making them resemble singleton. &quot;Complexton&quot; did not sound right to me. I should mention that I was washing my hands as I was contemplating this. I lifted up my head, looked into the mirror, and thought, &quot;SIMPLETON.&quot; The opposite of a singleton is a &quot;simpleton.&quot;</p>  <p>If the opposite of a singleton is not a &quot;simpleton,&quot; then what is it? Until I find a plausible answer, I will try and insert this new term into my next design discussion. </p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What is Elegant Code to me?</title>
		<link>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-is-elegant-code-to-me</link>
		<comments>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 03:47:45 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/</guid>
		<description><![CDATA[This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&#160; It isn't easy to describe.&#160; And really, the notion of what constitutes elegance in code changes over time.&#160; There is no static "this is good code" test, and I doubt there ever will be.&#160; Plus, [...]]]></description>
			<content:encoded><![CDATA[<p>This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&nbsp; It isn't easy to describe.&nbsp; And really, the notion of what constitutes elegance in code changes over time.&nbsp; There is no static "this is good code" test, and I doubt there ever will be.&nbsp; Plus, what makes good code in one language, may not apply to the next.</p> <p>So let me state for the record: today's elegant code is tomorrow's drivel.&nbsp; Don't feel bad, many writers have the same problems.&nbsp; What was super amazing back in the day is now rubbish or near unreadable.&nbsp; I am thinking of the Victorian writing that Hemingway usurped, and now Hemingway himself is almost unreadable (to me anyway).&nbsp; Tastes change with the times.&nbsp; That is a simple fact.</p> <p>So what can you do about this?&nbsp; As I say that old writing sucks to read (read Washington Irvine lately?), great works of literature still abound (for instance, Hemingway is still a great writer -- even if I prefer Tolkien) .&nbsp; So take some notes from them, and from other crafts in looking for the answer.&nbsp; If you want a cliff notes version of what this is going to tell you, it is this: you must always push yourself to get better.</p> <ol> <li>Find a good teacher.&nbsp; Nothing is better than sitting at the feet of a master who can nudge you along in the right direction.&nbsp; While early mistakes can often be corrected easily with a little bit of guidance, after they have had some time to fester all bets are off.&nbsp; I believe a fare number of "Anit-patterns" were created by self taught developers (find <a href="http://elegantcode.com/2008/03/21/sql-ejaculation/">SQL Ejaculation</a> on this site).&nbsp; <li>Read.&nbsp;&nbsp; Good writer are first good readers.&nbsp; Start with Code Complete, move into a good Patterns book, get MSDN Magazine, find some bloggers your like, but keep moving.&nbsp; You will NEVER be done reading.&nbsp; I imagine that even Martin Fowler has a "to read" booklist a mile long.  <li>Read code.&nbsp;&nbsp; There are a plethora of open source project just waiting to be read -- do so.&nbsp; This is the single best way to expand your coding repertoire, find things your language can do that you didn't even know about..&nbsp;&nbsp; Scott Hanselman has recently popularized this idea, and I thank him for it.  <li>Practice.&nbsp; This means writing small applications at home.&nbsp; You get an idea that you want to try out -- do it.&nbsp; I don't mean you have to write finished applications, just have some exploring time.&nbsp; I remember talking with an 80 year old master woodworker (he lives down the street from me), who was telling me how many time he would practice making dovetail joints before he felt competent.&nbsp; It was years worth.  <li>Pay Attention.&nbsp; Being good at anything really amounts to that.&nbsp; And don't just pay attention when reading, writing, or talking about code.&nbsp; Inspiration come from everywhere, any good artist will tell you that.&nbsp; Pay attention when you cook, when you work on the car, when you are wood working, playing an instrument, whatever it is that you do.&nbsp; This will help you in the end, event if it is just learning the amount of dedication it really takes to become good at something.  <li>Beware of preferences.&nbsp; Any time I hear someone start a statement with "I prefer code to ..." you know things are going downhill.&nbsp; If you find someone who cares more about how your code is formatted then how it is written you have found yourself in a mess.&nbsp; More importantly, beware of them in yourself.&nbsp;&nbsp; Having code style standard is important, but it isn't worth loosing sleep over.&nbsp; This also pertains to inheritance, patterns, use of particular classes (e.g. always using the generic list class in C# when a Dictionary would be better).&nbsp; <li>No Sacred Cows. Believe no single source of information.&nbsp; This means not thinking that Microsoft, Sun, IBM, Richard Stallman, or anyone else will have all of the correct answers.&nbsp; Apply the scientific method and do some research, experiment, and question the authority.&nbsp;&nbsp; There should be no sacred cows in programming.  <li>Talk with others.&nbsp; Join a user group, show up every now and then, heckle the presenter, and -maybe- speak.&nbsp; You want a broad range of people who you can talk to and bounce ideas off of.&nbsp; This will help you from becoming that crazy guy in the corner who vehemently states that all your code should be in one file.&nbsp; Having a mentor (mentioned earlier) is great, but having people around to push you from multiple directions is also good.  <li>Learn languages.&nbsp; This gets back to the "read code" idea. Make that multiple types of languages as well.&nbsp; If you know C# or Java and SQL, learn Python or Ruby, get really good at JavaScript.&nbsp; If you want something really out there, learn MDX.&nbsp; This is also a repertoire thing.&nbsp; Seeing how other languages work will make you rethink your ideas about what your current code, in whatever languages you are working in, should look like.  <li>Keep Thinking!!!&nbsp; That is possibly the most important point.&nbsp; Keep thinking.&nbsp; Don't just evaluate something once and never return, go back and reevaluate. Did the technique work?&nbsp; How could it have been better?&nbsp;&nbsp; The idea is continual improvement.  <li>Switch jobs every now and then.&nbsp; When I announced I was leaving my first programming job out of college, the VP of R&amp;D had me sit down with him and talk.&nbsp; He wasn't trying to keep me (he knew I was moving to be closer to family), he wanted to give me some advice.&nbsp; He told me to change jobs every three years.&nbsp; After you have been with a place for three years you have probably learned everything you are going to learn and it time to move on.&nbsp; This doesn't mean changing companies either.&nbsp; I've been with the same company now for four years, but I've had three different jobs.&nbsp; If you have been writing commercial applications, become a consultant - or vise-versa, become a test engineer, expand your boundaries.&nbsp; Again, this is about pushing yourself to be better.  <li>Have a Hobby. But don't ask about me, I have too many.&nbsp;&nbsp; Creating software is about creating things.&nbsp; So I suggest picking a hobby that involves creating something.&nbsp; Popular hobbies amongst programmers I know include: cooking, music, woodworking, beer making, and BBQ (which is different than cooking).&nbsp; But don't discount sports (golf is always popular), computer games, and board games.&nbsp; Anything that promotes the development of skill levels can't be a bad thing. </li></ol> <p>And I'm stopping there.&nbsp; This is my beginner's guide to how to become the writer elegant code.&nbsp; If you have others you think I missed, add them too the comments.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NetDug Unit Testing</title>
		<link>http://elegantcode.com/2008/03/22/netdug-unit-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=netdug-unit-testing</link>
		<comments>http://elegantcode.com/2008/03/22/netdug-unit-testing/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 21:00:30 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/22/netdug-unit-testing/</guid>
		<description><![CDATA[So last night I had the opportunity to be the moderator at NetDug, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk [...]]]></description>
			<content:encoded><![CDATA[So last night I had the opportunity to be the moderator at <a href="http://www.netdug.com">NetDug</a>, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk with 20 slides, I think I showed about 5 of them.  I consider that a success (I threatened the audience, the less they talked, the more slides I would show).

<a href="http://elegantcode.com/wp-content/uploads/2008/03/unittestingdemo.zip">Slides and sample code</a>

What I learned from last night:
<ol>
	<li>I'm not much of a moderator (I talk to much)</li>
	<li>Code coverage is a art in divination</li>
	<li>Mock/Stub/Fake Objects are hard to explain</li>
	<li>Over use Mocks could be a code smell</li>
	<li>The discussion format actually works pretty well for talking about unit testing</li>
	<li>If you give geeks a chance to talk, they will talk</li>
</ol>
What I hope everyone else got from the topic:
<ol>
	<li>Unit testing forces you to write better code</li>
	<li>Unit testing forces you to use better object oriented principles</li>
</ol>
<h3>Test Technology</h3>
This was an early question, what technologies to use to test your code.  <a href="http://www.nunit.org/index.php">NUnit</a>, MSUnit, and <a href="http://www.mbunit.com/">MBUnit</a> were all mentioned and viable, and stable, technologies.  For mock objects (which you are going to need) there is <a href="http://www.ayende.com/projects/rhino-mocks/downloads.aspx">Rhino Mocks</a> and <a href="http://www.typemock.com/">TypeMock</a>.  I suggest Rhino Mocks over <a href="http://www.typemock.com/">TypeMock</a> for anyone who can't purchase the full version of <a href="http://www.typemock.com/">TypeMock</a> (but there is a nice free version as well).

Then there are the helper technologies: <a href="http://testdriven.net">TestDriven.Net</a> and <a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> are the main two, but apparently MSUnit's runner isn't bad either (I haven't used it yet).  All of these tools make it easier to run your unit tests from inside Visual Studio, and each has other benefits.  <a href="http://testdriven.net">TestDriven.Net</a> has wonderful Reflector integration (a better object browser), and ReSharper...<a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> is just a must have (that is me talking, not the group).
<h3>Code Coverage</h3>
Code Coverage, using tools like <a href="http://www.ncover.com/">NCover</a> (<a href="http://www.ncover.com/download/discontinued">free version</a>), tell you how much of your code base is tested.  This was one of the early questions.  How much of your code base should be tested?  Answer: it depends on the product.  My view is that a library (no UI element) should have +90% coverage, if there is a substantial amount of UI then the project can get down to 60%.  If your code coverage gets below that you just aren't trying, or you need to rethink your architecture. 

I did talk a bit about code that was not really testable (not in an automated way anyway): UI, Database code, and external resource code are all potentially untestable.  More on this in a moment.

Database code is not testable if you can't return the database to a known state (you can restore the database data). 

UI code testing should be avoided because UI tests have to be so bound to the UI that they are brittle.  So you end up spending a considerable portion of your development time fixing broken test. Brittle tests are to be avoided whenever possible.
<h3>Testing existing code</h3>
Probably the hardest question to answer from last night was: how do you test existing code bases.  And that came up over and over.  Do you start with integration tests and then work in unit tests, or the other way around. 

I will admit, most of the time when I talk about unit testing, I center it around new projects.  Unit test is hard enough with new code, testing old code that wasn't written with unit test in mind is a migraine waiting to happen.

The audience did have some good advice though.  Pick parts of the project that you need to work on (say one class) and make that testable and tested.  Essentially you start creating silos of tested code.  The other suggestion (and I actually had a slide for this) was to get the book: <a href="http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206114497&amp;sr=8-1">Working Effectively with Legacy Code</a>.  Finally, buy TypeMock -- the big boy version, not the free-be version.  You'll need it.
<h3>UI Testing</h3>
This is my treatise on writing unit tests for the User Interface:

1. Don't do it until you are done with the UI.
2. Only test that the UI works in a basic sense.
3. You still have to test the UI by hand.

If you start writing UI tests while you are developing the UI, you will continually break the tests.  Writing the test by hand is none trivial, and using tools to write them is also error prone.  Finally, these tests can't tell you if the UI is just bad.  Only exposure can tell you that.  Every developer should be forced to have to use their UI repeatedly so they know where is sucks.  You wont get that with automated UI tests.

That said, there are tools to help you test web user interfaces. <a href="http://watin.sourceforge.net/">Watin</a>, <a href="http://wtr.rubyforge.org/">Watir</a>, and <a href="http://selenium.openqa.org/">Selenium</a> are all there to help.  We shall see if Team Systems adds anything to help with this (I'm hoping it does).
<h3>Testing Database code</h3>
This is essentially, testing code that touches the database.  Could be your <a href="http://www.hibernate.org/343.html">NHibernate</a> code, could be a stored procedure, could be ADO.Net code.  But really, this is just code that must touch an outside resource (database, file system, serial connection, etc) and there is no way, or point, to abstract it out any further.

The main point here was to have a way to get the data back to a known state.  Without that everything else gets much harder.

We also came up with a new term: SQL Ejaculation.  That is a pattern smell where an excessive amount of your HTML comes from you SQL database.  Like the entire site.  All of the HTML.  And you have stored procedures that simply build the HTML -- in a 10,000 line stored procedure.  That is SQL Ejaculation.

Note: if this comes up in a Google search I might get worried.
<h3></h3>
<h3>After the meeting</h3>
We all went to Table Rock for a beer.  'nuf said, it is a great group.

Finally, to the guy who asked me a question after the meeting was over: I'm sorry, I just haven't had to draw multiple, overlapping, transparent images on a win form using GDI.Net in a really long time.  I know it involves alpha-transparency values, but I haven't done that in years.  Maybe you should look at WPF.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/22/netdug-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be Careful of Your Passion</title>
		<link>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=be-careful-of-your-passion</link>
		<comments>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 14:37:04 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Architecture and Design]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/02/27/be-careful-of-your-passion/</guid>
		<description><![CDATA[Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." Most of us got into this business because we liked making computers do things we [...]]]></description>
			<content:encoded><![CDATA[<p>Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." </p> <p>Most of us got into this business because we liked making computers do things we think of as cool. The most successful among us still get that rush when our new creation spools up and runs.</p> <p>Tinkerers like us tend to gold plate the pieces of our systems we find most interesting. This is why developers will often find themselves the go-to-guy for certain specialities. A dev likes making services, she makes good ones because it's fun, she gets to make more of them. Sounds perfectly reasonable and symbiotic, no?</p> <p>It can be.</p> <h2>Ignoring the Boring</h2> <p>When we get to focus exclusively on the parts of the system that really flip our bits, it can come at a price. Although we might be jazzed about services, that data model still needs our attention. It is fairly common to focus on that thing that really gets us excited and forget (or outright ignore) that part which seems boring. Just because you think someone else will come along and sweep up after doesn't make it happen. </p> <p>The most common instance of "Ignoring the Boring" is documentation. Let's face it, we want to write in languages other than English, right? Documentation is in the elegance of my self-describing code, right? Not so much. Whether we like it or not, documentation is often a deliverable of our system and as such deserves the respect we might give to our WSDL or interface definitions. Just because the reader is a human rather than a machine doesn't mean we should short change her because it's boring to do the work.</p> <h2>Smells of Sub-Optimizing</h2> <p>It is easy to see this kind of monocular behavior can result in a really clean UI with a messy back end, or visa versa. Whatever gets the short end of the stick will tend to show up in the system as a glaring deficit. We can then measure the deficit in the ignored sub-component in observable ways. Some failures of attention to detail might include:</p> <ul> <li>Lack of enforced constraints or relationships in database tables  <li>Code in the view, because it's just this one little thing  <li>Leaky abstractions, because wrapping that data model in business logic can be a real PITA  <li>No check in notes  <li>Not taking the time to do code reviews, even informally</li></ul> <h2>The System Isn't Your Playground</h2> <p>On the other end of the spectrum, what happens when we get to play with the things that <em>are</em> fun? The results can depend on what the implementer really enjoys.</p> <p>One recent real world story I heard told of a hardware engineer who designed 7 different chips within a device, each with a fundamentally different way of representing logic circuits. The chip engineer had a great time applying all the different techniques he read about in last month's <em>Nerd Fest Quarterly</em>, but the team assigned to test this Franken-board was rightly annoyed.</p> <p>Another symptom of playground development is needless abstraction layers or design patterns applied to simple problems. If a system is implemented with a gazillion abstraction layers where only a concrete implementation will do, you can bet someone is reading the <em>Gang of Four</em> in bed at night.</p> <p>If your passion is trying new tools and technologies, how many of these shiny new toys are incorporated into your system without deliberate attention? How many logging libraries does one team really need? How many unit test frameworks?</p> <p><a href="http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It" target="_blank">YAGNI</a>, 'nuff said.</p> <h2>Keep Your Passion Alive</h2> <p>So, what are you saying, Starr? Stop trying to extract pleasure from my work? Just bang the keys and give my 40 to the man? Of course not!</p> <p>I am simply asserting that there is a degree of professionalism needed at all levels. Let's care about the system as a whole and be good stewards to the craft, not just the shiny bits. And, yes, documentation is a justifiable deliverable. Cowboy up.</p> <p>Learn new techniques that fire you up and apply them wisely, not with wild abandon. Delayed gratification means not always getting to use WPF to make a draw a button, or SilverLight to make a logo spin (&lt;-- bad example). Sometimes this means capitulating to use the prescribed framework so we can get a systemic optimization instead of trying to roll our own multi-tenant web portal, yet again.</p> <p>Having more tools in our toolbox is a great thing. This is the essence of youthful fun in our work. Knowing when to use those shiny new tools is the wisdom part. Now go learn something new.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Confessions of a bad web developer</title>
		<link>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=confessions-of-a-bad-web-developer</link>
		<comments>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 03:57:55 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/</guid>
		<description><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately. Not a lot, just enough to get acquainted for right now. Yesterday I had my "Road to Damascus" incident. I don't know HTML. OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them [...]]]></description>
			<content:encoded><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately.  Not a lot, just enough to get acquainted for right now.  Yesterday I had my "Road to Damascus" incident.  I don't know HTML.

OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them without looking things up.  More importantly, I know a ton of asp.net controls.  What I don't know, specifically, is how they all work.

Like the form tag.  I know every Asp.Net page I have ever made has had one of them (and only one, at least as of .Net 1.1 that is all you were allowed).  But I don't remember how to use it any more.  How to read data from it, pass values from one page to the next.  I used to, did it a few times in fact.  Then came Asp.Net, and I haven't looked back.

Have I written JavaScript during this time?  Sort of.  If you count copying code from Google (and testing it of course).  Over the years I have large blocks of Googled JavaScript code in existing projects that I've move from page to page.  Cut-and-paste is a type of reuse...right?  And lately, when my JavaScript requirements have not been Google-able, <a href="http://jquery.com">JQuery</a> has become my savior (more posts on that soon).  But I haven't written a JavaScript object, Prototype, or any such tomfoolery since Netscape 4.8.

And just to clarify.  I once wrote my own tree control in JavaScript.  Or, I wrote one for Netscape 4.04, 4.08, 4.5, 4.75, 4.8, and IE.  I never thought I could hate a language until Netscape.  Netscape killed any love of JavaScript for me.

But now with Ajax on the scene I can't do without it anymore.  And as cool as the Asp.Net Ajax Library is and all of the things that the control toolkit can do for you: without a bit of JavaScript muscle, it just isn't going to work for you.  Take a look at the Google Maps API and tell me you aren't thinking of things that could be done with it.  But it ain't going no where without some JavaScript know-how.

CSS I have come to terms with.  I know the difference between .tag and #tag.  I've written a hover or two.  But there are still unknowns there as well.  I still visit <a href="http://w3schools.com/css">w3schools</a> regularly, and spend way too much time with <a href="http://www.getfirebug.com">FireBug</a> and <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a>.  And <a href="http://csszengarden.com">CssZenGarden</a> -- that is just beyond me right now.

But even in Asp.Net.  <a href="http://www.xefteri.com/articles/show.cfm?id=18">How does a post back work?</a> How is it that a button click is hooked up to an event handler? I'm a firm believer that their is no "magic" in programming.  Post back is magic to me.   Maybe once years ago I knew, but not anymore.

But things like: if you have a table, and every row has a check box on it, on the server side, how do you know which check box is which?  Heck, how do I figure that out on the client side with JavaScript?  The magic is ViewState, I know.  But...

That really is the beauty of WebForms.  It provides a nice insulating coat that insulates you from all of the goo that is html and JavaScript.  ViewState is my friend.  But what does this have to do with Asp.Net MVC?  Absolutely everything.

Asp.Net is a stripped down version of web development with .Net.  ViewState: gone.  asp:Button: hope you are familiar with submit.  The cozy jacket is gone and has been replaced with a wind breaker.  All those old techniques that we threw away with our last ASP page needs to be resurrected.

Being how I already live in a cold climate, I know that the biggest part of working in cold weather is to acclimated to the temperature.  Part of it as well, is knowing that you have to work in the cold climate.  So this isn't time to put things off.  Spring is still a ways off.  So, for Asp.Net WebForms developers, that means re-familiarizing yourself with a few technologies that we all thought we didn't need to know that well:
<ul>
	<li>XHML</li>
	<li>CSS</li>
	<li>JavaScript</li>
	<li>JSON</li>
	<li>JQuery</li>
	<li>Asp.Net Ajax framework</li>
</ul>
I'm not going to specify particular books.  I don't have time for that, and you can search Amazon as well as I can.  Actually, I bought a couple of these books for  at Hastings near my house.  Worth every cent.

Also worth noting what is not on my list: XML.  The language we thought was the lingua franca of the web.  I've had enough XML, and the Asp.Net Ajax library talks via JSON (which is much smaller).   So XML is out for me.  And that is fine, I think, there is enough to learn as is.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom IV</title>
		<link>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iv</link>
		<comments>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 04:48:42 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins. Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. [...]]]></description>
			<content:encoded><![CDATA[<p>If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a href="http://elegantcode.com/?p=646" target="_blank">here</a>.</p> <ol> <li>Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins.  <li>Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. .Net, as an example.  <li>If metrics are prescribed to a team, explain how they will be used. Metrics cause fear, mitigate that fear.  <li>You can prescribe Agility, but not hyper-performance.  <li>Part of the maturation process of Agile is the tendency for people to over-analyze the holy heck out of it. This is relly a reaction to the cost of software development and the incredible amounts of historical waste in the industry.  <li>CEOs do not care about code coverage. Speak to them appropriately about quality.  <li>Earned value reporting is ridiculous.  <li>"Don't wait until the customer is screaming to optimize for performance." <em>-- Thanks, Kevin</em>.  <li>Deliver less, but sooner and more often. <li>"Daddy, is that your new <a href="http://en.wikipedia.org/wiki/Out-Of-Box_Experience" target="_blank">OOBE</a>?" - My kid when I opened my new MacBook. "Yes, it is, son. Yes, it is."</li></ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom III</title>
		<link>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iii</link>
		<comments>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 04:14:20 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=664</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Carry a model at all times to express your understanding to others. Look for patterns in all systems at all levels. Seeing them is the very essence of insight. At the application level, architecture and design are synonymous. "BizTalk is overkill" [...]]]></description>
			<content:encoded><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a target="_blank" href="http://elegantcode.com/?p=646">here</a>.
<ol>
	<li>Carry a model at all times to express your understanding to others.</li>
	<li>Look for patterns in all systems at all levels. Seeing them is the very essence of insight.</li>
	<li>At the application level, architecture and design are synonymous.</li>
	<li>"BizTalk is overkill" is a typically overheard comment of <em>Drive by Architecture</em>.</li>
	<li>Developers would never prescribe BizTalk or a TIBCO or any other message bus system. That type of decision is typical of a CTO or someone who reports directly to one. These are strategic decisions.
"I think that, generally, if you're looking at something like BizTalk, you're probably looking at somebody, a directory port of a CIO or a CTO, I would say." -- Roger Session</li>
	<li>"Anything that is architecture and is specific to a particular technology is kind of an oxymoron." -- Roger Sessions</li>
	<li>Good design allows for emergent functionality, which we can also think of as purposeful evolution.</li>
	<li>The Open/Close principle doesn't mean you can't recompile. -- Allan Shalloway</li>
	<li>Fewer keystrokes != Elegant Code. Damn it! -- Dave Starr :)</li>
	<li>Architectural decisions are those that will kill your business if they are wrong.</li>
	<li>To introduce a new technology into a system, have the entire team immerse in an architectural spike, then estimate.</li>
	<li>Schedule riskiest work first. Try prioritizing a backlog by risk.</li>
	<li>The work of a developer is to uncover complexity, the work of an architect is to simplify it.</li>
	<li>A legacy system is one that is already making money.</li>
	<li>“The <a href="http://en.wikipedia.org/wiki/Winchester_Mystery_House">Winchester House</a> in San Jose is the perfect example of following a vision without a plan.”</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Ways to Stop Context Switching</title>
		<link>http://elegantcode.com/2008/05/06/your-first-developer-job/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=your-first-developer-job</link>
		<comments>http://elegantcode.com/2008/05/06/your-first-developer-job/#comments</comments>
		<pubDate>Wed, 07 May 2008 04:45:09 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/05/06/your-first-developer-job/</guid>
		<description><![CDATA[I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see [...]]]></description>
			<content:encoded><![CDATA[<p>I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see them learn about the aspects of real life we face in developing solutions for clients. My favorite quote of the whole semester was, &quot;I don't think the client even knows what they want. I don't get it. Why are we even here?&quot; Awesome, no? Doesn't that just sum it all up? The beautiful thing about this is how the students were surprised when this happened. But I digress...</p>  <p>As we were wrapping up the last night I received what seemed like an innocent enough question from one of the students. &quot;What kind of job do you think I should look for?&quot;</p>  <p>It really caught me off guard, although I should have seen it coming. I didn't have a good answer on the tip of my tongue, and that may be because there isn't one. The CIS program is not designed specifically to churn out developers, but introduces students to all sorts of disciplines so they can pick a specialty later. For example thy study project management, requirements analysis, some programming, some networking, you get the idea. So the question really was bigger than it seemed. </p>  <p>Let's assume for this post that the person in question wanted to be a developer. Even if the person is looking to become a developer, the question what kind of employer to seek out isn't an easy one.</p>  <p>My father has worked 45 years as a mechanic for 2 employers. He is happy doing that. Many people, in fact most, are content with an occupation just like that. There is nothing in the world wrong with this; the world turns, people still live and love, people die, babies are born, all without making a life out of their career. Other people don't see things that way. They are passionate about their work and want to contribute to a higher vision of their chosen profession. I would guess if you are reading this, you see yourself in a similar light.</p>  <p>Someone develops code for the state government agencies. In fact, I have met many competent people who do exactly that. Are those developers missing out on something? Probably not in their mind, or they wouldn't be there. The point is simply that for some people a job is a job and there is no dishonor there.</p>  <p>This means my answer can't be glib, it must be realistic. You can't just say, &quot;Go somewhere Agile,&quot; or, &quot;Find a place where you can write Ruby.&quot; This is real life and sometimes grown ups balance security and risk and boredom and excitement because they have kids at home, or need special medical accommodation, or any one of a host of other considerations.</p>  <p>All that said, if you are passionate about the craft, if you want to drink in the industry, if you do want to learn as much as you can as soon as you can, I say this: Go work for a company with fewer than 50 employees building web solutions. </p>  <h2>Locus of Control</h2>  <p>As a company grows larger, the <a href="http://en.wikipedia.org/wiki/Locus_of_control" target="_blank">locus of control</a> individuals have inside the organization grows smaller. This is easy to see. </p>  <p>In smaller organizations, people tend to be jacks of all trades. If a server goes down, you care. If a defect is found, you care. If there is a client in the picture, you tend to actually know them. In short, small organizations provide first hand experience with many aspects of developing and delivering products. </p>  <p>In larger companies and teams, people tend to be expected to focus on a small niche of expertise. I cannot begin to tell you the number of resumes I have seen from people who spent years poking at HP's test harness suite or Micron's order entry system. This kind of &quot;specialization&quot; is not usually a recipe for career growth.</p>  <h2>Technology Exposure</h2>  <p>You'll get to go deep on technology because you are part of a small group that simply must make it work. There is no passing the buck, because there is no one to pass it to. You'll get to know whatever the technology stack is inside and out.</p>  <p>I recommend web development for a simple reason, the web isn't going away! Additionally, the technology involved in delivering to the web is growing at an astounding pace. I don't know what the web will evolve to&#160; in years to come, but it will be on hulluva ride.</p>  <h2>Comradery and Mentorship</h2>  <p>In a small organization, it is easier to foster a genuine sense that we are all in this together. The esprit de' corp in a smaller organization is typically tighter than in large organizations. This means you stand a better chance of falling in with someone who can actually mentor your career and take a genuine interest in your development.</p>  <p>Of course this exists in larger companies and is lacking in many smaller ones. I do think it is more generally found in smaller organizations, though.</p>  <h2>Conclusion</h2>  <p>So, what's the right answer? There isn't one, of course. There are just too many options and factors.</p>  <p>I will say that instead of ensuring your potential employer can pass <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" target="_blank">Spolsky's Joel Test</a>, it is more important to ensure you will be empowered to help them pass it if you come aboard.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/05/06/your-first-developer-job/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Elegant Code &#187; Widgets of Wisdom</title>
	<atom:link href="http://elegantcode.com/tag/widgets-of-wisdom/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 10:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Your First Developer Job</title>
		<link>http://elegantcode.com/2008/05/06/your-first-developer-job/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=your-first-developer-job</link>
		<comments>http://elegantcode.com/2008/05/06/your-first-developer-job/#comments</comments>
		<pubDate>Wed, 07 May 2008 04:45:09 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/05/06/your-first-developer-job/</guid>
		<description><![CDATA[I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see [...]]]></description>
			<content:encoded><![CDATA[<p>I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see them learn about the aspects of real life we face in developing solutions for clients. My favorite quote of the whole semester was, &quot;I don't think the client even knows what they want. I don't get it. Why are we even here?&quot; Awesome, no? Doesn't that just sum it all up? The beautiful thing about this is how the students were surprised when this happened. But I digress...</p>  <p>As we were wrapping up the last night I received what seemed like an innocent enough question from one of the students. &quot;What kind of job do you think I should look for?&quot;</p>  <p>It really caught me off guard, although I should have seen it coming. I didn't have a good answer on the tip of my tongue, and that may be because there isn't one. The CIS program is not designed specifically to churn out developers, but introduces students to all sorts of disciplines so they can pick a specialty later. For example thy study project management, requirements analysis, some programming, some networking, you get the idea. So the question really was bigger than it seemed. </p>  <p>Let's assume for this post that the person in question wanted to be a developer. Even if the person is looking to become a developer, the question what kind of employer to seek out isn't an easy one.</p>  <p>My father has worked 45 years as a mechanic for 2 employers. He is happy doing that. Many people, in fact most, are content with an occupation just like that. There is nothing in the world wrong with this; the world turns, people still live and love, people die, babies are born, all without making a life out of their career. Other people don't see things that way. They are passionate about their work and want to contribute to a higher vision of their chosen profession. I would guess if you are reading this, you see yourself in a similar light.</p>  <p>Someone develops code for the state government agencies. In fact, I have met many competent people who do exactly that. Are those developers missing out on something? Probably not in their mind, or they wouldn't be there. The point is simply that for some people a job is a job and there is no dishonor there.</p>  <p>This means my answer can't be glib, it must be realistic. You can't just say, &quot;Go somewhere Agile,&quot; or, &quot;Find a place where you can write Ruby.&quot; This is real life and sometimes grown ups balance security and risk and boredom and excitement because they have kids at home, or need special medical accommodation, or any one of a host of other considerations.</p>  <p>All that said, if you are passionate about the craft, if you want to drink in the industry, if you do want to learn as much as you can as soon as you can, I say this: Go work for a company with fewer than 50 employees building web solutions. </p>  <h2>Locus of Control</h2>  <p>As a company grows larger, the <a href="http://en.wikipedia.org/wiki/Locus_of_control" target="_blank">locus of control</a> individuals have inside the organization grows smaller. This is easy to see. </p>  <p>In smaller organizations, people tend to be jacks of all trades. If a server goes down, you care. If a defect is found, you care. If there is a client in the picture, you tend to actually know them. In short, small organizations provide first hand experience with many aspects of developing and delivering products. </p>  <p>In larger companies and teams, people tend to be expected to focus on a small niche of expertise. I cannot begin to tell you the number of resumes I have seen from people who spent years poking at HP's test harness suite or Micron's order entry system. This kind of &quot;specialization&quot; is not usually a recipe for career growth.</p>  <h2>Technology Exposure</h2>  <p>You'll get to go deep on technology because you are part of a small group that simply must make it work. There is no passing the buck, because there is no one to pass it to. You'll get to know whatever the technology stack is inside and out.</p>  <p>I recommend web development for a simple reason, the web isn't going away! Additionally, the technology involved in delivering to the web is growing at an astounding pace. I don't know what the web will evolve to&#160; in years to come, but it will be on hulluva ride.</p>  <h2>Comradery and Mentorship</h2>  <p>In a small organization, it is easier to foster a genuine sense that we are all in this together. The esprit de' corp in a smaller organization is typically tighter than in large organizations. This means you stand a better chance of falling in with someone who can actually mentor your career and take a genuine interest in your development.</p>  <p>Of course this exists in larger companies and is lacking in many smaller ones. I do think it is more generally found in smaller organizations, though.</p>  <h2>Conclusion</h2>  <p>So, what's the right answer? There isn't one, of course. There are just too many options and factors.</p>  <p>I will say that instead of ensuring your potential employer can pass <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" target="_blank">Spolsky's Joel Test</a>, it is more important to ensure you will be empowered to help them pass it if you come aboard.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/05/06/your-first-developer-job/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Many Uses of Relative Estimation</title>
		<link>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-many-uses-of-relative-estimation</link>
		<comments>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 21:57:16 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/</guid>
		<description><![CDATA[Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety. Have you ever looked at the website HotOrNot.com? It turns out that pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety.</p>  <p>Have you ever looked at the website <a href="http://www.hotornot.com/" target="_blank">HotOrNot.com</a>? It turns out that pretty much everyone from Quazzi Modo to Angelina Jolie ranks from a 4 to a 7. This is a prime example of our poor ability to estimate on a closely related value scale. It is pretty tough to tell if something is a 2 or a 3, but it is pretty easy to see the difference in size between a 5 and a 13. 13 is more than twice as big as 5, right?</p>  <p>Think about it this way: Does it really matter if something is going to take 3 hours or six hours? In software development, it typically doesn&#8217;t matter.</p>  <p>So the relative estimation model looks like this, in pursuing an estimate for piece of work A: </p>  <ol>   <li>Is this piece of work bigger or smaller than that piece of work B that we already did? </li>    <li>Bigger? OK, how much bigger? 2X bigger? 3X? </li>    <li>OK, 4X bigger. </li>    <li>Here is piece of work C that we already did. It was estimated at 4X bigger than B. Is it roughly the same size as A? </li>    <li>Yes. </li>    <li>Cool, we are done. </li> </ol>  <p>Once we understand that we can trust these relative comparisons because we are better at them than empirical estimation, it becomes much easier to size our work. Look at things you've already done and estimate the new one in relation to the previous work. We get our relative size and convert it into time, dollars, or whatever the project managers need and we are done. This is a much faster (and accurate) thing to do than to break it down into tasks and estimate each task. Why? Because we will never get the tasking right.</p>  <p>There is a ton more that could be said (and has) on relative estimation, but remember this: The next time you have to estimate a project for your manager, make it easier on yourself by doing a relative size first. You'll get back to coding much faster and you'll find the numbers are amazingly accurate.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Opposite of a Singleton?</title>
		<link>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-opposite-of-a-singleton</link>
		<comments>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 03:42:22 +0000</pubDate>
		<dc:creator>Alex Mueller</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/</guid>
		<description><![CDATA[I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to [...]]]></description>
			<content:encoded><![CDATA[<p>I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to the inverse object as a &quot;new object.&quot; As I pondered this later in the day, I considered adjectives describing the nature of objects. They can be many things, but two concepts that popped into my head to classify them were &quot;complex&quot; and &quot;simple.&quot; </p>  <p>I started playing with the words and making them resemble singleton. &quot;Complexton&quot; did not sound right to me. I should mention that I was washing my hands as I was contemplating this. I lifted up my head, looked into the mirror, and thought, &quot;SIMPLETON.&quot; The opposite of a singleton is a &quot;simpleton.&quot;</p>  <p>If the opposite of a singleton is not a &quot;simpleton,&quot; then what is it? Until I find a plausible answer, I will try and insert this new term into my next design discussion. </p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What is Elegant Code to me?</title>
		<link>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-is-elegant-code-to-me</link>
		<comments>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 03:47:45 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/</guid>
		<description><![CDATA[This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&#160; It isn't easy to describe.&#160; And really, the notion of what constitutes elegance in code changes over time.&#160; There is no static "this is good code" test, and I doubt there ever will be.&#160; Plus, [...]]]></description>
			<content:encoded><![CDATA[<p>This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&nbsp; It isn't easy to describe.&nbsp; And really, the notion of what constitutes elegance in code changes over time.&nbsp; There is no static "this is good code" test, and I doubt there ever will be.&nbsp; Plus, what makes good code in one language, may not apply to the next.</p> <p>So let me state for the record: today's elegant code is tomorrow's drivel.&nbsp; Don't feel bad, many writers have the same problems.&nbsp; What was super amazing back in the day is now rubbish or near unreadable.&nbsp; I am thinking of the Victorian writing that Hemingway usurped, and now Hemingway himself is almost unreadable (to me anyway).&nbsp; Tastes change with the times.&nbsp; That is a simple fact.</p> <p>So what can you do about this?&nbsp; As I say that old writing sucks to read (read Washington Irvine lately?), great works of literature still abound (for instance, Hemingway is still a great writer -- even if I prefer Tolkien) .&nbsp; So take some notes from them, and from other crafts in looking for the answer.&nbsp; If you want a cliff notes version of what this is going to tell you, it is this: you must always push yourself to get better.</p> <ol> <li>Find a good teacher.&nbsp; Nothing is better than sitting at the feet of a master who can nudge you along in the right direction.&nbsp; While early mistakes can often be corrected easily with a little bit of guidance, after they have had some time to fester all bets are off.&nbsp; I believe a fare number of "Anit-patterns" were created by self taught developers (find <a href="http://elegantcode.com/2008/03/21/sql-ejaculation/">SQL Ejaculation</a> on this site).&nbsp; <li>Read.&nbsp;&nbsp; Good writer are first good readers.&nbsp; Start with Code Complete, move into a good Patterns book, get MSDN Magazine, find some bloggers your like, but keep moving.&nbsp; You will NEVER be done reading.&nbsp; I imagine that even Martin Fowler has a "to read" booklist a mile long.  <li>Read code.&nbsp;&nbsp; There are a plethora of open source project just waiting to be read -- do so.&nbsp; This is the single best way to expand your coding repertoire, find things your language can do that you didn't even know about..&nbsp;&nbsp; Scott Hanselman has recently popularized this idea, and I thank him for it.  <li>Practice.&nbsp; This means writing small applications at home.&nbsp; You get an idea that you want to try out -- do it.&nbsp; I don't mean you have to write finished applications, just have some exploring time.&nbsp; I remember talking with an 80 year old master woodworker (he lives down the street from me), who was telling me how many time he would practice making dovetail joints before he felt competent.&nbsp; It was years worth.  <li>Pay Attention.&nbsp; Being good at anything really amounts to that.&nbsp; And don't just pay attention when reading, writing, or talking about code.&nbsp; Inspiration come from everywhere, any good artist will tell you that.&nbsp; Pay attention when you cook, when you work on the car, when you are wood working, playing an instrument, whatever it is that you do.&nbsp; This will help you in the end, event if it is just learning the amount of dedication it really takes to become good at something.  <li>Beware of preferences.&nbsp; Any time I hear someone start a statement with "I prefer code to ..." you know things are going downhill.&nbsp; If you find someone who cares more about how your code is formatted then how it is written you have found yourself in a mess.&nbsp; More importantly, beware of them in yourself.&nbsp;&nbsp; Having code style standard is important, but it isn't worth loosing sleep over.&nbsp; This also pertains to inheritance, patterns, use of particular classes (e.g. always using the generic list class in C# when a Dictionary would be better).&nbsp; <li>No Sacred Cows. Believe no single source of information.&nbsp; This means not thinking that Microsoft, Sun, IBM, Richard Stallman, or anyone else will have all of the correct answers.&nbsp; Apply the scientific method and do some research, experiment, and question the authority.&nbsp;&nbsp; There should be no sacred cows in programming.  <li>Talk with others.&nbsp; Join a user group, show up every now and then, heckle the presenter, and -maybe- speak.&nbsp; You want a broad range of people who you can talk to and bounce ideas off of.&nbsp; This will help you from becoming that crazy guy in the corner who vehemently states that all your code should be in one file.&nbsp; Having a mentor (mentioned earlier) is great, but having people around to push you from multiple directions is also good.  <li>Learn languages.&nbsp; This gets back to the "read code" idea. Make that multiple types of languages as well.&nbsp; If you know C# or Java and SQL, learn Python or Ruby, get really good at JavaScript.&nbsp; If you want something really out there, learn MDX.&nbsp; This is also a repertoire thing.&nbsp; Seeing how other languages work will make you rethink your ideas about what your current code, in whatever languages you are working in, should look like.  <li>Keep Thinking!!!&nbsp; That is possibly the most important point.&nbsp; Keep thinking.&nbsp; Don't just evaluate something once and never return, go back and reevaluate. Did the technique work?&nbsp; How could it have been better?&nbsp;&nbsp; The idea is continual improvement.  <li>Switch jobs every now and then.&nbsp; When I announced I was leaving my first programming job out of college, the VP of R&amp;D had me sit down with him and talk.&nbsp; He wasn't trying to keep me (he knew I was moving to be closer to family), he wanted to give me some advice.&nbsp; He told me to change jobs every three years.&nbsp; After you have been with a place for three years you have probably learned everything you are going to learn and it time to move on.&nbsp; This doesn't mean changing companies either.&nbsp; I've been with the same company now for four years, but I've had three different jobs.&nbsp; If you have been writing commercial applications, become a consultant - or vise-versa, become a test engineer, expand your boundaries.&nbsp; Again, this is about pushing yourself to be better.  <li>Have a Hobby. But don't ask about me, I have too many.&nbsp;&nbsp; Creating software is about creating things.&nbsp; So I suggest picking a hobby that involves creating something.&nbsp; Popular hobbies amongst programmers I know include: cooking, music, woodworking, beer making, and BBQ (which is different than cooking).&nbsp; But don't discount sports (golf is always popular), computer games, and board games.&nbsp; Anything that promotes the development of skill levels can't be a bad thing. </li></ol> <p>And I'm stopping there.&nbsp; This is my beginner's guide to how to become the writer elegant code.&nbsp; If you have others you think I missed, add them too the comments.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NetDug Unit Testing</title>
		<link>http://elegantcode.com/2008/03/22/netdug-unit-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=netdug-unit-testing</link>
		<comments>http://elegantcode.com/2008/03/22/netdug-unit-testing/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 21:00:30 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/22/netdug-unit-testing/</guid>
		<description><![CDATA[So last night I had the opportunity to be the moderator at NetDug, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk [...]]]></description>
			<content:encoded><![CDATA[So last night I had the opportunity to be the moderator at <a href="http://www.netdug.com">NetDug</a>, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk with 20 slides, I think I showed about 5 of them.  I consider that a success (I threatened the audience, the less they talked, the more slides I would show).

<a href="http://elegantcode.com/wp-content/uploads/2008/03/unittestingdemo.zip">Slides and sample code</a>

What I learned from last night:
<ol>
	<li>I'm not much of a moderator (I talk to much)</li>
	<li>Code coverage is a art in divination</li>
	<li>Mock/Stub/Fake Objects are hard to explain</li>
	<li>Over use Mocks could be a code smell</li>
	<li>The discussion format actually works pretty well for talking about unit testing</li>
	<li>If you give geeks a chance to talk, they will talk</li>
</ol>
What I hope everyone else got from the topic:
<ol>
	<li>Unit testing forces you to write better code</li>
	<li>Unit testing forces you to use better object oriented principles</li>
</ol>
<h3>Test Technology</h3>
This was an early question, what technologies to use to test your code.  <a href="http://www.nunit.org/index.php">NUnit</a>, MSUnit, and <a href="http://www.mbunit.com/">MBUnit</a> were all mentioned and viable, and stable, technologies.  For mock objects (which you are going to need) there is <a href="http://www.ayende.com/projects/rhino-mocks/downloads.aspx">Rhino Mocks</a> and <a href="http://www.typemock.com/">TypeMock</a>.  I suggest Rhino Mocks over <a href="http://www.typemock.com/">TypeMock</a> for anyone who can't purchase the full version of <a href="http://www.typemock.com/">TypeMock</a> (but there is a nice free version as well).

Then there are the helper technologies: <a href="http://testdriven.net">TestDriven.Net</a> and <a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> are the main two, but apparently MSUnit's runner isn't bad either (I haven't used it yet).  All of these tools make it easier to run your unit tests from inside Visual Studio, and each has other benefits.  <a href="http://testdriven.net">TestDriven.Net</a> has wonderful Reflector integration (a better object browser), and ReSharper...<a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> is just a must have (that is me talking, not the group).
<h3>Code Coverage</h3>
Code Coverage, using tools like <a href="http://www.ncover.com/">NCover</a> (<a href="http://www.ncover.com/download/discontinued">free version</a>), tell you how much of your code base is tested.  This was one of the early questions.  How much of your code base should be tested?  Answer: it depends on the product.  My view is that a library (no UI element) should have +90% coverage, if there is a substantial amount of UI then the project can get down to 60%.  If your code coverage gets below that you just aren't trying, or you need to rethink your architecture. 

I did talk a bit about code that was not really testable (not in an automated way anyway): UI, Database code, and external resource code are all potentially untestable.  More on this in a moment.

Database code is not testable if you can't return the database to a known state (you can restore the database data). 

UI code testing should be avoided because UI tests have to be so bound to the UI that they are brittle.  So you end up spending a considerable portion of your development time fixing broken test. Brittle tests are to be avoided whenever possible.
<h3>Testing existing code</h3>
Probably the hardest question to answer from last night was: how do you test existing code bases.  And that came up over and over.  Do you start with integration tests and then work in unit tests, or the other way around. 

I will admit, most of the time when I talk about unit testing, I center it around new projects.  Unit test is hard enough with new code, testing old code that wasn't written with unit test in mind is a migraine waiting to happen.

The audience did have some good advice though.  Pick parts of the project that you need to work on (say one class) and make that testable and tested.  Essentially you start creating silos of tested code.  The other suggestion (and I actually had a slide for this) was to get the book: <a href="http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206114497&amp;sr=8-1">Working Effectively with Legacy Code</a>.  Finally, buy TypeMock -- the big boy version, not the free-be version.  You'll need it.
<h3>UI Testing</h3>
This is my treatise on writing unit tests for the User Interface:

1. Don't do it until you are done with the UI.
2. Only test that the UI works in a basic sense.
3. You still have to test the UI by hand.

If you start writing UI tests while you are developing the UI, you will continually break the tests.  Writing the test by hand is none trivial, and using tools to write them is also error prone.  Finally, these tests can't tell you if the UI is just bad.  Only exposure can tell you that.  Every developer should be forced to have to use their UI repeatedly so they know where is sucks.  You wont get that with automated UI tests.

That said, there are tools to help you test web user interfaces. <a href="http://watin.sourceforge.net/">Watin</a>, <a href="http://wtr.rubyforge.org/">Watir</a>, and <a href="http://selenium.openqa.org/">Selenium</a> are all there to help.  We shall see if Team Systems adds anything to help with this (I'm hoping it does).
<h3>Testing Database code</h3>
This is essentially, testing code that touches the database.  Could be your <a href="http://www.hibernate.org/343.html">NHibernate</a> code, could be a stored procedure, could be ADO.Net code.  But really, this is just code that must touch an outside resource (database, file system, serial connection, etc) and there is no way, or point, to abstract it out any further.

The main point here was to have a way to get the data back to a known state.  Without that everything else gets much harder.

We also came up with a new term: SQL Ejaculation.  That is a pattern smell where an excessive amount of your HTML comes from you SQL database.  Like the entire site.  All of the HTML.  And you have stored procedures that simply build the HTML -- in a 10,000 line stored procedure.  That is SQL Ejaculation.

Note: if this comes up in a Google search I might get worried.
<h3></h3>
<h3>After the meeting</h3>
We all went to Table Rock for a beer.  'nuf said, it is a great group.

Finally, to the guy who asked me a question after the meeting was over: I'm sorry, I just haven't had to draw multiple, overlapping, transparent images on a win form using GDI.Net in a really long time.  I know it involves alpha-transparency values, but I haven't done that in years.  Maybe you should look at WPF.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/22/netdug-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be Careful of Your Passion</title>
		<link>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=be-careful-of-your-passion</link>
		<comments>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 14:37:04 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Architecture and Design]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/02/27/be-careful-of-your-passion/</guid>
		<description><![CDATA[Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." Most of us got into this business because we liked making computers do things we [...]]]></description>
			<content:encoded><![CDATA[<p>Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." </p> <p>Most of us got into this business because we liked making computers do things we think of as cool. The most successful among us still get that rush when our new creation spools up and runs.</p> <p>Tinkerers like us tend to gold plate the pieces of our systems we find most interesting. This is why developers will often find themselves the go-to-guy for certain specialities. A dev likes making services, she makes good ones because it's fun, she gets to make more of them. Sounds perfectly reasonable and symbiotic, no?</p> <p>It can be.</p> <h2>Ignoring the Boring</h2> <p>When we get to focus exclusively on the parts of the system that really flip our bits, it can come at a price. Although we might be jazzed about services, that data model still needs our attention. It is fairly common to focus on that thing that really gets us excited and forget (or outright ignore) that part which seems boring. Just because you think someone else will come along and sweep up after doesn't make it happen. </p> <p>The most common instance of "Ignoring the Boring" is documentation. Let's face it, we want to write in languages other than English, right? Documentation is in the elegance of my self-describing code, right? Not so much. Whether we like it or not, documentation is often a deliverable of our system and as such deserves the respect we might give to our WSDL or interface definitions. Just because the reader is a human rather than a machine doesn't mean we should short change her because it's boring to do the work.</p> <h2>Smells of Sub-Optimizing</h2> <p>It is easy to see this kind of monocular behavior can result in a really clean UI with a messy back end, or visa versa. Whatever gets the short end of the stick will tend to show up in the system as a glaring deficit. We can then measure the deficit in the ignored sub-component in observable ways. Some failures of attention to detail might include:</p> <ul> <li>Lack of enforced constraints or relationships in database tables  <li>Code in the view, because it's just this one little thing  <li>Leaky abstractions, because wrapping that data model in business logic can be a real PITA  <li>No check in notes  <li>Not taking the time to do code reviews, even informally</li></ul> <h2>The System Isn't Your Playground</h2> <p>On the other end of the spectrum, what happens when we get to play with the things that <em>are</em> fun? The results can depend on what the implementer really enjoys.</p> <p>One recent real world story I heard told of a hardware engineer who designed 7 different chips within a device, each with a fundamentally different way of representing logic circuits. The chip engineer had a great time applying all the different techniques he read about in last month's <em>Nerd Fest Quarterly</em>, but the team assigned to test this Franken-board was rightly annoyed.</p> <p>Another symptom of playground development is needless abstraction layers or design patterns applied to simple problems. If a system is implemented with a gazillion abstraction layers where only a concrete implementation will do, you can bet someone is reading the <em>Gang of Four</em> in bed at night.</p> <p>If your passion is trying new tools and technologies, how many of these shiny new toys are incorporated into your system without deliberate attention? How many logging libraries does one team really need? How many unit test frameworks?</p> <p><a href="http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It" target="_blank">YAGNI</a>, 'nuff said.</p> <h2>Keep Your Passion Alive</h2> <p>So, what are you saying, Starr? Stop trying to extract pleasure from my work? Just bang the keys and give my 40 to the man? Of course not!</p> <p>I am simply asserting that there is a degree of professionalism needed at all levels. Let's care about the system as a whole and be good stewards to the craft, not just the shiny bits. And, yes, documentation is a justifiable deliverable. Cowboy up.</p> <p>Learn new techniques that fire you up and apply them wisely, not with wild abandon. Delayed gratification means not always getting to use WPF to make a draw a button, or SilverLight to make a logo spin (&lt;-- bad example). Sometimes this means capitulating to use the prescribed framework so we can get a systemic optimization instead of trying to roll our own multi-tenant web portal, yet again.</p> <p>Having more tools in our toolbox is a great thing. This is the essence of youthful fun in our work. Knowing when to use those shiny new tools is the wisdom part. Now go learn something new.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Confessions of a bad web developer</title>
		<link>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=confessions-of-a-bad-web-developer</link>
		<comments>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 03:57:55 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/</guid>
		<description><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately. Not a lot, just enough to get acquainted for right now. Yesterday I had my "Road to Damascus" incident. I don't know HTML. OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them [...]]]></description>
			<content:encoded><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately.  Not a lot, just enough to get acquainted for right now.  Yesterday I had my "Road to Damascus" incident.  I don't know HTML.

OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them without looking things up.  More importantly, I know a ton of asp.net controls.  What I don't know, specifically, is how they all work.

Like the form tag.  I know every Asp.Net page I have ever made has had one of them (and only one, at least as of .Net 1.1 that is all you were allowed).  But I don't remember how to use it any more.  How to read data from it, pass values from one page to the next.  I used to, did it a few times in fact.  Then came Asp.Net, and I haven't looked back.

Have I written JavaScript during this time?  Sort of.  If you count copying code from Google (and testing it of course).  Over the years I have large blocks of Googled JavaScript code in existing projects that I've move from page to page.  Cut-and-paste is a type of reuse...right?  And lately, when my JavaScript requirements have not been Google-able, <a href="http://jquery.com">JQuery</a> has become my savior (more posts on that soon).  But I haven't written a JavaScript object, Prototype, or any such tomfoolery since Netscape 4.8.

And just to clarify.  I once wrote my own tree control in JavaScript.  Or, I wrote one for Netscape 4.04, 4.08, 4.5, 4.75, 4.8, and IE.  I never thought I could hate a language until Netscape.  Netscape killed any love of JavaScript for me.

But now with Ajax on the scene I can't do without it anymore.  And as cool as the Asp.Net Ajax Library is and all of the things that the control toolkit can do for you: without a bit of JavaScript muscle, it just isn't going to work for you.  Take a look at the Google Maps API and tell me you aren't thinking of things that could be done with it.  But it ain't going no where without some JavaScript know-how.

CSS I have come to terms with.  I know the difference between .tag and #tag.  I've written a hover or two.  But there are still unknowns there as well.  I still visit <a href="http://w3schools.com/css">w3schools</a> regularly, and spend way too much time with <a href="http://www.getfirebug.com">FireBug</a> and <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a>.  And <a href="http://csszengarden.com">CssZenGarden</a> -- that is just beyond me right now.

But even in Asp.Net.  <a href="http://www.xefteri.com/articles/show.cfm?id=18">How does a post back work?</a> How is it that a button click is hooked up to an event handler? I'm a firm believer that their is no "magic" in programming.  Post back is magic to me.   Maybe once years ago I knew, but not anymore.

But things like: if you have a table, and every row has a check box on it, on the server side, how do you know which check box is which?  Heck, how do I figure that out on the client side with JavaScript?  The magic is ViewState, I know.  But...

That really is the beauty of WebForms.  It provides a nice insulating coat that insulates you from all of the goo that is html and JavaScript.  ViewState is my friend.  But what does this have to do with Asp.Net MVC?  Absolutely everything.

Asp.Net is a stripped down version of web development with .Net.  ViewState: gone.  asp:Button: hope you are familiar with submit.  The cozy jacket is gone and has been replaced with a wind breaker.  All those old techniques that we threw away with our last ASP page needs to be resurrected.

Being how I already live in a cold climate, I know that the biggest part of working in cold weather is to acclimated to the temperature.  Part of it as well, is knowing that you have to work in the cold climate.  So this isn't time to put things off.  Spring is still a ways off.  So, for Asp.Net WebForms developers, that means re-familiarizing yourself with a few technologies that we all thought we didn't need to know that well:
<ul>
	<li>XHML</li>
	<li>CSS</li>
	<li>JavaScript</li>
	<li>JSON</li>
	<li>JQuery</li>
	<li>Asp.Net Ajax framework</li>
</ul>
I'm not going to specify particular books.  I don't have time for that, and you can search Amazon as well as I can.  Actually, I bought a couple of these books for  at Hastings near my house.  Worth every cent.

Also worth noting what is not on my list: XML.  The language we thought was the lingua franca of the web.  I've had enough XML, and the Asp.Net Ajax library talks via JSON (which is much smaller).   So XML is out for me.  And that is fine, I think, there is enough to learn as is.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom IV</title>
		<link>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iv</link>
		<comments>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 04:48:42 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins. Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. [...]]]></description>
			<content:encoded><![CDATA[<p>If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a href="http://elegantcode.com/?p=646" target="_blank">here</a>.</p> <ol> <li>Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins.  <li>Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. .Net, as an example.  <li>If metrics are prescribed to a team, explain how they will be used. Metrics cause fear, mitigate that fear.  <li>You can prescribe Agility, but not hyper-performance.  <li>Part of the maturation process of Agile is the tendency for people to over-analyze the holy heck out of it. This is relly a reaction to the cost of software development and the incredible amounts of historical waste in the industry.  <li>CEOs do not care about code coverage. Speak to them appropriately about quality.  <li>Earned value reporting is ridiculous.  <li>"Don't wait until the customer is screaming to optimize for performance." <em>-- Thanks, Kevin</em>.  <li>Deliver less, but sooner and more often. <li>"Daddy, is that your new <a href="http://en.wikipedia.org/wiki/Out-Of-Box_Experience" target="_blank">OOBE</a>?" - My kid when I opened my new MacBook. "Yes, it is, son. Yes, it is."</li></ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom III</title>
		<link>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iii</link>
		<comments>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 04:14:20 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=664</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Carry a model at all times to express your understanding to others. Look for patterns in all systems at all levels. Seeing them is the very essence of insight. At the application level, architecture and design are synonymous. "BizTalk is overkill" [...]]]></description>
			<content:encoded><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a target="_blank" href="http://elegantcode.com/?p=646">here</a>.
<ol>
	<li>Carry a model at all times to express your understanding to others.</li>
	<li>Look for patterns in all systems at all levels. Seeing them is the very essence of insight.</li>
	<li>At the application level, architecture and design are synonymous.</li>
	<li>"BizTalk is overkill" is a typically overheard comment of <em>Drive by Architecture</em>.</li>
	<li>Developers would never prescribe BizTalk or a TIBCO or any other message bus system. That type of decision is typical of a CTO or someone who reports directly to one. These are strategic decisions.
"I think that, generally, if you're looking at something like BizTalk, you're probably looking at somebody, a directory port of a CIO or a CTO, I would say." -- Roger Session</li>
	<li>"Anything that is architecture and is specific to a particular technology is kind of an oxymoron." -- Roger Sessions</li>
	<li>Good design allows for emergent functionality, which we can also think of as purposeful evolution.</li>
	<li>The Open/Close principle doesn't mean you can't recompile. -- Allan Shalloway</li>
	<li>Fewer keystrokes != Elegant Code. Damn it! -- Dave Starr :)</li>
	<li>Architectural decisions are those that will kill your business if they are wrong.</li>
	<li>To introduce a new technology into a system, have the entire team immerse in an architectural spike, then estimate.</li>
	<li>Schedule riskiest work first. Try prioritizing a backlog by risk.</li>
	<li>The work of a developer is to uncover complexity, the work of an architect is to simplify it.</li>
	<li>A legacy system is one that is already making money.</li>
	<li>“The <a href="http://en.wikipedia.org/wiki/Winchester_Mystery_House">Winchester House</a> in San Jose is the perfect example of following a vision without a plan.”</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Ways to Stop Context Switching</title>
		<link>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-many-uses-of-relative-estimation</link>
		<comments>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 21:57:16 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/</guid>
		<description><![CDATA[Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety. Have you ever looked at the website HotOrNot.com? It turns out that pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety.</p>  <p>Have you ever looked at the website <a href="http://www.hotornot.com/" target="_blank">HotOrNot.com</a>? It turns out that pretty much everyone from Quazzi Modo to Angelina Jolie ranks from a 4 to a 7. This is a prime example of our poor ability to estimate on a closely related value scale. It is pretty tough to tell if something is a 2 or a 3, but it is pretty easy to see the difference in size between a 5 and a 13. 13 is more than twice as big as 5, right?</p>  <p>Think about it this way: Does it really matter if something is going to take 3 hours or six hours? In software development, it typically doesn&#8217;t matter.</p>  <p>So the relative estimation model looks like this, in pursuing an estimate for piece of work A: </p>  <ol>   <li>Is this piece of work bigger or smaller than that piece of work B that we already did? </li>    <li>Bigger? OK, how much bigger? 2X bigger? 3X? </li>    <li>OK, 4X bigger. </li>    <li>Here is piece of work C that we already did. It was estimated at 4X bigger than B. Is it roughly the same size as A? </li>    <li>Yes. </li>    <li>Cool, we are done. </li> </ol>  <p>Once we understand that we can trust these relative comparisons because we are better at them than empirical estimation, it becomes much easier to size our work. Look at things you've already done and estimate the new one in relation to the previous work. We get our relative size and convert it into time, dollars, or whatever the project managers need and we are done. This is a much faster (and accurate) thing to do than to break it down into tasks and estimate each task. Why? Because we will never get the tasking right.</p>  <p>There is a ton more that could be said (and has) on relative estimation, but remember this: The next time you have to estimate a project for your manager, make it easier on yourself by doing a relative size first. You'll get back to coding much faster and you'll find the numbers are amazingly accurate.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Elegant Code &#187; Widgets of Wisdom</title>
	<atom:link href="http://elegantcode.com/tag/widgets-of-wisdom/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 10:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Your First Developer Job</title>
		<link>http://elegantcode.com/2008/05/06/your-first-developer-job/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=your-first-developer-job</link>
		<comments>http://elegantcode.com/2008/05/06/your-first-developer-job/#comments</comments>
		<pubDate>Wed, 07 May 2008 04:45:09 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/05/06/your-first-developer-job/</guid>
		<description><![CDATA[I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see [...]]]></description>
			<content:encoded><![CDATA[<p>I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see them learn about the aspects of real life we face in developing solutions for clients. My favorite quote of the whole semester was, &quot;I don't think the client even knows what they want. I don't get it. Why are we even here?&quot; Awesome, no? Doesn't that just sum it all up? The beautiful thing about this is how the students were surprised when this happened. But I digress...</p>  <p>As we were wrapping up the last night I received what seemed like an innocent enough question from one of the students. &quot;What kind of job do you think I should look for?&quot;</p>  <p>It really caught me off guard, although I should have seen it coming. I didn't have a good answer on the tip of my tongue, and that may be because there isn't one. The CIS program is not designed specifically to churn out developers, but introduces students to all sorts of disciplines so they can pick a specialty later. For example thy study project management, requirements analysis, some programming, some networking, you get the idea. So the question really was bigger than it seemed. </p>  <p>Let's assume for this post that the person in question wanted to be a developer. Even if the person is looking to become a developer, the question what kind of employer to seek out isn't an easy one.</p>  <p>My father has worked 45 years as a mechanic for 2 employers. He is happy doing that. Many people, in fact most, are content with an occupation just like that. There is nothing in the world wrong with this; the world turns, people still live and love, people die, babies are born, all without making a life out of their career. Other people don't see things that way. They are passionate about their work and want to contribute to a higher vision of their chosen profession. I would guess if you are reading this, you see yourself in a similar light.</p>  <p>Someone develops code for the state government agencies. In fact, I have met many competent people who do exactly that. Are those developers missing out on something? Probably not in their mind, or they wouldn't be there. The point is simply that for some people a job is a job and there is no dishonor there.</p>  <p>This means my answer can't be glib, it must be realistic. You can't just say, &quot;Go somewhere Agile,&quot; or, &quot;Find a place where you can write Ruby.&quot; This is real life and sometimes grown ups balance security and risk and boredom and excitement because they have kids at home, or need special medical accommodation, or any one of a host of other considerations.</p>  <p>All that said, if you are passionate about the craft, if you want to drink in the industry, if you do want to learn as much as you can as soon as you can, I say this: Go work for a company with fewer than 50 employees building web solutions. </p>  <h2>Locus of Control</h2>  <p>As a company grows larger, the <a href="http://en.wikipedia.org/wiki/Locus_of_control" target="_blank">locus of control</a> individuals have inside the organization grows smaller. This is easy to see. </p>  <p>In smaller organizations, people tend to be jacks of all trades. If a server goes down, you care. If a defect is found, you care. If there is a client in the picture, you tend to actually know them. In short, small organizations provide first hand experience with many aspects of developing and delivering products. </p>  <p>In larger companies and teams, people tend to be expected to focus on a small niche of expertise. I cannot begin to tell you the number of resumes I have seen from people who spent years poking at HP's test harness suite or Micron's order entry system. This kind of &quot;specialization&quot; is not usually a recipe for career growth.</p>  <h2>Technology Exposure</h2>  <p>You'll get to go deep on technology because you are part of a small group that simply must make it work. There is no passing the buck, because there is no one to pass it to. You'll get to know whatever the technology stack is inside and out.</p>  <p>I recommend web development for a simple reason, the web isn't going away! Additionally, the technology involved in delivering to the web is growing at an astounding pace. I don't know what the web will evolve to&#160; in years to come, but it will be on hulluva ride.</p>  <h2>Comradery and Mentorship</h2>  <p>In a small organization, it is easier to foster a genuine sense that we are all in this together. The esprit de' corp in a smaller organization is typically tighter than in large organizations. This means you stand a better chance of falling in with someone who can actually mentor your career and take a genuine interest in your development.</p>  <p>Of course this exists in larger companies and is lacking in many smaller ones. I do think it is more generally found in smaller organizations, though.</p>  <h2>Conclusion</h2>  <p>So, what's the right answer? There isn't one, of course. There are just too many options and factors.</p>  <p>I will say that instead of ensuring your potential employer can pass <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" target="_blank">Spolsky's Joel Test</a>, it is more important to ensure you will be empowered to help them pass it if you come aboard.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/05/06/your-first-developer-job/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Many Uses of Relative Estimation</title>
		<link>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-many-uses-of-relative-estimation</link>
		<comments>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 21:57:16 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/</guid>
		<description><![CDATA[Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety. Have you ever looked at the website HotOrNot.com? It turns out that pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety.</p>  <p>Have you ever looked at the website <a href="http://www.hotornot.com/" target="_blank">HotOrNot.com</a>? It turns out that pretty much everyone from Quazzi Modo to Angelina Jolie ranks from a 4 to a 7. This is a prime example of our poor ability to estimate on a closely related value scale. It is pretty tough to tell if something is a 2 or a 3, but it is pretty easy to see the difference in size between a 5 and a 13. 13 is more than twice as big as 5, right?</p>  <p>Think about it this way: Does it really matter if something is going to take 3 hours or six hours? In software development, it typically doesn&#8217;t matter.</p>  <p>So the relative estimation model looks like this, in pursuing an estimate for piece of work A: </p>  <ol>   <li>Is this piece of work bigger or smaller than that piece of work B that we already did? </li>    <li>Bigger? OK, how much bigger? 2X bigger? 3X? </li>    <li>OK, 4X bigger. </li>    <li>Here is piece of work C that we already did. It was estimated at 4X bigger than B. Is it roughly the same size as A? </li>    <li>Yes. </li>    <li>Cool, we are done. </li> </ol>  <p>Once we understand that we can trust these relative comparisons because we are better at them than empirical estimation, it becomes much easier to size our work. Look at things you've already done and estimate the new one in relation to the previous work. We get our relative size and convert it into time, dollars, or whatever the project managers need and we are done. This is a much faster (and accurate) thing to do than to break it down into tasks and estimate each task. Why? Because we will never get the tasking right.</p>  <p>There is a ton more that could be said (and has) on relative estimation, but remember this: The next time you have to estimate a project for your manager, make it easier on yourself by doing a relative size first. You'll get back to coding much faster and you'll find the numbers are amazingly accurate.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Opposite of a Singleton?</title>
		<link>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-opposite-of-a-singleton</link>
		<comments>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 03:42:22 +0000</pubDate>
		<dc:creator>Alex Mueller</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/</guid>
		<description><![CDATA[I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to [...]]]></description>
			<content:encoded><![CDATA[<p>I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to the inverse object as a &quot;new object.&quot; As I pondered this later in the day, I considered adjectives describing the nature of objects. They can be many things, but two concepts that popped into my head to classify them were &quot;complex&quot; and &quot;simple.&quot; </p>  <p>I started playing with the words and making them resemble singleton. &quot;Complexton&quot; did not sound right to me. I should mention that I was washing my hands as I was contemplating this. I lifted up my head, looked into the mirror, and thought, &quot;SIMPLETON.&quot; The opposite of a singleton is a &quot;simpleton.&quot;</p>  <p>If the opposite of a singleton is not a &quot;simpleton,&quot; then what is it? Until I find a plausible answer, I will try and insert this new term into my next design discussion. </p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What is Elegant Code to me?</title>
		<link>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-is-elegant-code-to-me</link>
		<comments>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 03:47:45 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/</guid>
		<description><![CDATA[This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&#160; It isn't easy to describe.&#160; And really, the notion of what constitutes elegance in code changes over time.&#160; There is no static "this is good code" test, and I doubt there ever will be.&#160; Plus, [...]]]></description>
			<content:encoded><![CDATA[<p>This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&nbsp; It isn't easy to describe.&nbsp; And really, the notion of what constitutes elegance in code changes over time.&nbsp; There is no static "this is good code" test, and I doubt there ever will be.&nbsp; Plus, what makes good code in one language, may not apply to the next.</p> <p>So let me state for the record: today's elegant code is tomorrow's drivel.&nbsp; Don't feel bad, many writers have the same problems.&nbsp; What was super amazing back in the day is now rubbish or near unreadable.&nbsp; I am thinking of the Victorian writing that Hemingway usurped, and now Hemingway himself is almost unreadable (to me anyway).&nbsp; Tastes change with the times.&nbsp; That is a simple fact.</p> <p>So what can you do about this?&nbsp; As I say that old writing sucks to read (read Washington Irvine lately?), great works of literature still abound (for instance, Hemingway is still a great writer -- even if I prefer Tolkien) .&nbsp; So take some notes from them, and from other crafts in looking for the answer.&nbsp; If you want a cliff notes version of what this is going to tell you, it is this: you must always push yourself to get better.</p> <ol> <li>Find a good teacher.&nbsp; Nothing is better than sitting at the feet of a master who can nudge you along in the right direction.&nbsp; While early mistakes can often be corrected easily with a little bit of guidance, after they have had some time to fester all bets are off.&nbsp; I believe a fare number of "Anit-patterns" were created by self taught developers (find <a href="http://elegantcode.com/2008/03/21/sql-ejaculation/">SQL Ejaculation</a> on this site).&nbsp; <li>Read.&nbsp;&nbsp; Good writer are first good readers.&nbsp; Start with Code Complete, move into a good Patterns book, get MSDN Magazine, find some bloggers your like, but keep moving.&nbsp; You will NEVER be done reading.&nbsp; I imagine that even Martin Fowler has a "to read" booklist a mile long.  <li>Read code.&nbsp;&nbsp; There are a plethora of open source project just waiting to be read -- do so.&nbsp; This is the single best way to expand your coding repertoire, find things your language can do that you didn't even know about..&nbsp;&nbsp; Scott Hanselman has recently popularized this idea, and I thank him for it.  <li>Practice.&nbsp; This means writing small applications at home.&nbsp; You get an idea that you want to try out -- do it.&nbsp; I don't mean you have to write finished applications, just have some exploring time.&nbsp; I remember talking with an 80 year old master woodworker (he lives down the street from me), who was telling me how many time he would practice making dovetail joints before he felt competent.&nbsp; It was years worth.  <li>Pay Attention.&nbsp; Being good at anything really amounts to that.&nbsp; And don't just pay attention when reading, writing, or talking about code.&nbsp; Inspiration come from everywhere, any good artist will tell you that.&nbsp; Pay attention when you cook, when you work on the car, when you are wood working, playing an instrument, whatever it is that you do.&nbsp; This will help you in the end, event if it is just learning the amount of dedication it really takes to become good at something.  <li>Beware of preferences.&nbsp; Any time I hear someone start a statement with "I prefer code to ..." you know things are going downhill.&nbsp; If you find someone who cares more about how your code is formatted then how it is written you have found yourself in a mess.&nbsp; More importantly, beware of them in yourself.&nbsp;&nbsp; Having code style standard is important, but it isn't worth loosing sleep over.&nbsp; This also pertains to inheritance, patterns, use of particular classes (e.g. always using the generic list class in C# when a Dictionary would be better).&nbsp; <li>No Sacred Cows. Believe no single source of information.&nbsp; This means not thinking that Microsoft, Sun, IBM, Richard Stallman, or anyone else will have all of the correct answers.&nbsp; Apply the scientific method and do some research, experiment, and question the authority.&nbsp;&nbsp; There should be no sacred cows in programming.  <li>Talk with others.&nbsp; Join a user group, show up every now and then, heckle the presenter, and -maybe- speak.&nbsp; You want a broad range of people who you can talk to and bounce ideas off of.&nbsp; This will help you from becoming that crazy guy in the corner who vehemently states that all your code should be in one file.&nbsp; Having a mentor (mentioned earlier) is great, but having people around to push you from multiple directions is also good.  <li>Learn languages.&nbsp; This gets back to the "read code" idea. Make that multiple types of languages as well.&nbsp; If you know C# or Java and SQL, learn Python or Ruby, get really good at JavaScript.&nbsp; If you want something really out there, learn MDX.&nbsp; This is also a repertoire thing.&nbsp; Seeing how other languages work will make you rethink your ideas about what your current code, in whatever languages you are working in, should look like.  <li>Keep Thinking!!!&nbsp; That is possibly the most important point.&nbsp; Keep thinking.&nbsp; Don't just evaluate something once and never return, go back and reevaluate. Did the technique work?&nbsp; How could it have been better?&nbsp;&nbsp; The idea is continual improvement.  <li>Switch jobs every now and then.&nbsp; When I announced I was leaving my first programming job out of college, the VP of R&amp;D had me sit down with him and talk.&nbsp; He wasn't trying to keep me (he knew I was moving to be closer to family), he wanted to give me some advice.&nbsp; He told me to change jobs every three years.&nbsp; After you have been with a place for three years you have probably learned everything you are going to learn and it time to move on.&nbsp; This doesn't mean changing companies either.&nbsp; I've been with the same company now for four years, but I've had three different jobs.&nbsp; If you have been writing commercial applications, become a consultant - or vise-versa, become a test engineer, expand your boundaries.&nbsp; Again, this is about pushing yourself to be better.  <li>Have a Hobby. But don't ask about me, I have too many.&nbsp;&nbsp; Creating software is about creating things.&nbsp; So I suggest picking a hobby that involves creating something.&nbsp; Popular hobbies amongst programmers I know include: cooking, music, woodworking, beer making, and BBQ (which is different than cooking).&nbsp; But don't discount sports (golf is always popular), computer games, and board games.&nbsp; Anything that promotes the development of skill levels can't be a bad thing. </li></ol> <p>And I'm stopping there.&nbsp; This is my beginner's guide to how to become the writer elegant code.&nbsp; If you have others you think I missed, add them too the comments.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NetDug Unit Testing</title>
		<link>http://elegantcode.com/2008/03/22/netdug-unit-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=netdug-unit-testing</link>
		<comments>http://elegantcode.com/2008/03/22/netdug-unit-testing/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 21:00:30 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/22/netdug-unit-testing/</guid>
		<description><![CDATA[So last night I had the opportunity to be the moderator at NetDug, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk [...]]]></description>
			<content:encoded><![CDATA[So last night I had the opportunity to be the moderator at <a href="http://www.netdug.com">NetDug</a>, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk with 20 slides, I think I showed about 5 of them.  I consider that a success (I threatened the audience, the less they talked, the more slides I would show).

<a href="http://elegantcode.com/wp-content/uploads/2008/03/unittestingdemo.zip">Slides and sample code</a>

What I learned from last night:
<ol>
	<li>I'm not much of a moderator (I talk to much)</li>
	<li>Code coverage is a art in divination</li>
	<li>Mock/Stub/Fake Objects are hard to explain</li>
	<li>Over use Mocks could be a code smell</li>
	<li>The discussion format actually works pretty well for talking about unit testing</li>
	<li>If you give geeks a chance to talk, they will talk</li>
</ol>
What I hope everyone else got from the topic:
<ol>
	<li>Unit testing forces you to write better code</li>
	<li>Unit testing forces you to use better object oriented principles</li>
</ol>
<h3>Test Technology</h3>
This was an early question, what technologies to use to test your code.  <a href="http://www.nunit.org/index.php">NUnit</a>, MSUnit, and <a href="http://www.mbunit.com/">MBUnit</a> were all mentioned and viable, and stable, technologies.  For mock objects (which you are going to need) there is <a href="http://www.ayende.com/projects/rhino-mocks/downloads.aspx">Rhino Mocks</a> and <a href="http://www.typemock.com/">TypeMock</a>.  I suggest Rhino Mocks over <a href="http://www.typemock.com/">TypeMock</a> for anyone who can't purchase the full version of <a href="http://www.typemock.com/">TypeMock</a> (but there is a nice free version as well).

Then there are the helper technologies: <a href="http://testdriven.net">TestDriven.Net</a> and <a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> are the main two, but apparently MSUnit's runner isn't bad either (I haven't used it yet).  All of these tools make it easier to run your unit tests from inside Visual Studio, and each has other benefits.  <a href="http://testdriven.net">TestDriven.Net</a> has wonderful Reflector integration (a better object browser), and ReSharper...<a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> is just a must have (that is me talking, not the group).
<h3>Code Coverage</h3>
Code Coverage, using tools like <a href="http://www.ncover.com/">NCover</a> (<a href="http://www.ncover.com/download/discontinued">free version</a>), tell you how much of your code base is tested.  This was one of the early questions.  How much of your code base should be tested?  Answer: it depends on the product.  My view is that a library (no UI element) should have +90% coverage, if there is a substantial amount of UI then the project can get down to 60%.  If your code coverage gets below that you just aren't trying, or you need to rethink your architecture. 

I did talk a bit about code that was not really testable (not in an automated way anyway): UI, Database code, and external resource code are all potentially untestable.  More on this in a moment.

Database code is not testable if you can't return the database to a known state (you can restore the database data). 

UI code testing should be avoided because UI tests have to be so bound to the UI that they are brittle.  So you end up spending a considerable portion of your development time fixing broken test. Brittle tests are to be avoided whenever possible.
<h3>Testing existing code</h3>
Probably the hardest question to answer from last night was: how do you test existing code bases.  And that came up over and over.  Do you start with integration tests and then work in unit tests, or the other way around. 

I will admit, most of the time when I talk about unit testing, I center it around new projects.  Unit test is hard enough with new code, testing old code that wasn't written with unit test in mind is a migraine waiting to happen.

The audience did have some good advice though.  Pick parts of the project that you need to work on (say one class) and make that testable and tested.  Essentially you start creating silos of tested code.  The other suggestion (and I actually had a slide for this) was to get the book: <a href="http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206114497&amp;sr=8-1">Working Effectively with Legacy Code</a>.  Finally, buy TypeMock -- the big boy version, not the free-be version.  You'll need it.
<h3>UI Testing</h3>
This is my treatise on writing unit tests for the User Interface:

1. Don't do it until you are done with the UI.
2. Only test that the UI works in a basic sense.
3. You still have to test the UI by hand.

If you start writing UI tests while you are developing the UI, you will continually break the tests.  Writing the test by hand is none trivial, and using tools to write them is also error prone.  Finally, these tests can't tell you if the UI is just bad.  Only exposure can tell you that.  Every developer should be forced to have to use their UI repeatedly so they know where is sucks.  You wont get that with automated UI tests.

That said, there are tools to help you test web user interfaces. <a href="http://watin.sourceforge.net/">Watin</a>, <a href="http://wtr.rubyforge.org/">Watir</a>, and <a href="http://selenium.openqa.org/">Selenium</a> are all there to help.  We shall see if Team Systems adds anything to help with this (I'm hoping it does).
<h3>Testing Database code</h3>
This is essentially, testing code that touches the database.  Could be your <a href="http://www.hibernate.org/343.html">NHibernate</a> code, could be a stored procedure, could be ADO.Net code.  But really, this is just code that must touch an outside resource (database, file system, serial connection, etc) and there is no way, or point, to abstract it out any further.

The main point here was to have a way to get the data back to a known state.  Without that everything else gets much harder.

We also came up with a new term: SQL Ejaculation.  That is a pattern smell where an excessive amount of your HTML comes from you SQL database.  Like the entire site.  All of the HTML.  And you have stored procedures that simply build the HTML -- in a 10,000 line stored procedure.  That is SQL Ejaculation.

Note: if this comes up in a Google search I might get worried.
<h3></h3>
<h3>After the meeting</h3>
We all went to Table Rock for a beer.  'nuf said, it is a great group.

Finally, to the guy who asked me a question after the meeting was over: I'm sorry, I just haven't had to draw multiple, overlapping, transparent images on a win form using GDI.Net in a really long time.  I know it involves alpha-transparency values, but I haven't done that in years.  Maybe you should look at WPF.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/22/netdug-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be Careful of Your Passion</title>
		<link>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=be-careful-of-your-passion</link>
		<comments>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 14:37:04 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Architecture and Design]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/02/27/be-careful-of-your-passion/</guid>
		<description><![CDATA[Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." Most of us got into this business because we liked making computers do things we [...]]]></description>
			<content:encoded><![CDATA[<p>Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." </p> <p>Most of us got into this business because we liked making computers do things we think of as cool. The most successful among us still get that rush when our new creation spools up and runs.</p> <p>Tinkerers like us tend to gold plate the pieces of our systems we find most interesting. This is why developers will often find themselves the go-to-guy for certain specialities. A dev likes making services, she makes good ones because it's fun, she gets to make more of them. Sounds perfectly reasonable and symbiotic, no?</p> <p>It can be.</p> <h2>Ignoring the Boring</h2> <p>When we get to focus exclusively on the parts of the system that really flip our bits, it can come at a price. Although we might be jazzed about services, that data model still needs our attention. It is fairly common to focus on that thing that really gets us excited and forget (or outright ignore) that part which seems boring. Just because you think someone else will come along and sweep up after doesn't make it happen. </p> <p>The most common instance of "Ignoring the Boring" is documentation. Let's face it, we want to write in languages other than English, right? Documentation is in the elegance of my self-describing code, right? Not so much. Whether we like it or not, documentation is often a deliverable of our system and as such deserves the respect we might give to our WSDL or interface definitions. Just because the reader is a human rather than a machine doesn't mean we should short change her because it's boring to do the work.</p> <h2>Smells of Sub-Optimizing</h2> <p>It is easy to see this kind of monocular behavior can result in a really clean UI with a messy back end, or visa versa. Whatever gets the short end of the stick will tend to show up in the system as a glaring deficit. We can then measure the deficit in the ignored sub-component in observable ways. Some failures of attention to detail might include:</p> <ul> <li>Lack of enforced constraints or relationships in database tables  <li>Code in the view, because it's just this one little thing  <li>Leaky abstractions, because wrapping that data model in business logic can be a real PITA  <li>No check in notes  <li>Not taking the time to do code reviews, even informally</li></ul> <h2>The System Isn't Your Playground</h2> <p>On the other end of the spectrum, what happens when we get to play with the things that <em>are</em> fun? The results can depend on what the implementer really enjoys.</p> <p>One recent real world story I heard told of a hardware engineer who designed 7 different chips within a device, each with a fundamentally different way of representing logic circuits. The chip engineer had a great time applying all the different techniques he read about in last month's <em>Nerd Fest Quarterly</em>, but the team assigned to test this Franken-board was rightly annoyed.</p> <p>Another symptom of playground development is needless abstraction layers or design patterns applied to simple problems. If a system is implemented with a gazillion abstraction layers where only a concrete implementation will do, you can bet someone is reading the <em>Gang of Four</em> in bed at night.</p> <p>If your passion is trying new tools and technologies, how many of these shiny new toys are incorporated into your system without deliberate attention? How many logging libraries does one team really need? How many unit test frameworks?</p> <p><a href="http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It" target="_blank">YAGNI</a>, 'nuff said.</p> <h2>Keep Your Passion Alive</h2> <p>So, what are you saying, Starr? Stop trying to extract pleasure from my work? Just bang the keys and give my 40 to the man? Of course not!</p> <p>I am simply asserting that there is a degree of professionalism needed at all levels. Let's care about the system as a whole and be good stewards to the craft, not just the shiny bits. And, yes, documentation is a justifiable deliverable. Cowboy up.</p> <p>Learn new techniques that fire you up and apply them wisely, not with wild abandon. Delayed gratification means not always getting to use WPF to make a draw a button, or SilverLight to make a logo spin (&lt;-- bad example). Sometimes this means capitulating to use the prescribed framework so we can get a systemic optimization instead of trying to roll our own multi-tenant web portal, yet again.</p> <p>Having more tools in our toolbox is a great thing. This is the essence of youthful fun in our work. Knowing when to use those shiny new tools is the wisdom part. Now go learn something new.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Confessions of a bad web developer</title>
		<link>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=confessions-of-a-bad-web-developer</link>
		<comments>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 03:57:55 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/</guid>
		<description><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately. Not a lot, just enough to get acquainted for right now. Yesterday I had my "Road to Damascus" incident. I don't know HTML. OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them [...]]]></description>
			<content:encoded><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately.  Not a lot, just enough to get acquainted for right now.  Yesterday I had my "Road to Damascus" incident.  I don't know HTML.

OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them without looking things up.  More importantly, I know a ton of asp.net controls.  What I don't know, specifically, is how they all work.

Like the form tag.  I know every Asp.Net page I have ever made has had one of them (and only one, at least as of .Net 1.1 that is all you were allowed).  But I don't remember how to use it any more.  How to read data from it, pass values from one page to the next.  I used to, did it a few times in fact.  Then came Asp.Net, and I haven't looked back.

Have I written JavaScript during this time?  Sort of.  If you count copying code from Google (and testing it of course).  Over the years I have large blocks of Googled JavaScript code in existing projects that I've move from page to page.  Cut-and-paste is a type of reuse...right?  And lately, when my JavaScript requirements have not been Google-able, <a href="http://jquery.com">JQuery</a> has become my savior (more posts on that soon).  But I haven't written a JavaScript object, Prototype, or any such tomfoolery since Netscape 4.8.

And just to clarify.  I once wrote my own tree control in JavaScript.  Or, I wrote one for Netscape 4.04, 4.08, 4.5, 4.75, 4.8, and IE.  I never thought I could hate a language until Netscape.  Netscape killed any love of JavaScript for me.

But now with Ajax on the scene I can't do without it anymore.  And as cool as the Asp.Net Ajax Library is and all of the things that the control toolkit can do for you: without a bit of JavaScript muscle, it just isn't going to work for you.  Take a look at the Google Maps API and tell me you aren't thinking of things that could be done with it.  But it ain't going no where without some JavaScript know-how.

CSS I have come to terms with.  I know the difference between .tag and #tag.  I've written a hover or two.  But there are still unknowns there as well.  I still visit <a href="http://w3schools.com/css">w3schools</a> regularly, and spend way too much time with <a href="http://www.getfirebug.com">FireBug</a> and <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a>.  And <a href="http://csszengarden.com">CssZenGarden</a> -- that is just beyond me right now.

But even in Asp.Net.  <a href="http://www.xefteri.com/articles/show.cfm?id=18">How does a post back work?</a> How is it that a button click is hooked up to an event handler? I'm a firm believer that their is no "magic" in programming.  Post back is magic to me.   Maybe once years ago I knew, but not anymore.

But things like: if you have a table, and every row has a check box on it, on the server side, how do you know which check box is which?  Heck, how do I figure that out on the client side with JavaScript?  The magic is ViewState, I know.  But...

That really is the beauty of WebForms.  It provides a nice insulating coat that insulates you from all of the goo that is html and JavaScript.  ViewState is my friend.  But what does this have to do with Asp.Net MVC?  Absolutely everything.

Asp.Net is a stripped down version of web development with .Net.  ViewState: gone.  asp:Button: hope you are familiar with submit.  The cozy jacket is gone and has been replaced with a wind breaker.  All those old techniques that we threw away with our last ASP page needs to be resurrected.

Being how I already live in a cold climate, I know that the biggest part of working in cold weather is to acclimated to the temperature.  Part of it as well, is knowing that you have to work in the cold climate.  So this isn't time to put things off.  Spring is still a ways off.  So, for Asp.Net WebForms developers, that means re-familiarizing yourself with a few technologies that we all thought we didn't need to know that well:
<ul>
	<li>XHML</li>
	<li>CSS</li>
	<li>JavaScript</li>
	<li>JSON</li>
	<li>JQuery</li>
	<li>Asp.Net Ajax framework</li>
</ul>
I'm not going to specify particular books.  I don't have time for that, and you can search Amazon as well as I can.  Actually, I bought a couple of these books for  at Hastings near my house.  Worth every cent.

Also worth noting what is not on my list: XML.  The language we thought was the lingua franca of the web.  I've had enough XML, and the Asp.Net Ajax library talks via JSON (which is much smaller).   So XML is out for me.  And that is fine, I think, there is enough to learn as is.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom IV</title>
		<link>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iv</link>
		<comments>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 04:48:42 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins. Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. [...]]]></description>
			<content:encoded><![CDATA[<p>If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a href="http://elegantcode.com/?p=646" target="_blank">here</a>.</p> <ol> <li>Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins.  <li>Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. .Net, as an example.  <li>If metrics are prescribed to a team, explain how they will be used. Metrics cause fear, mitigate that fear.  <li>You can prescribe Agility, but not hyper-performance.  <li>Part of the maturation process of Agile is the tendency for people to over-analyze the holy heck out of it. This is relly a reaction to the cost of software development and the incredible amounts of historical waste in the industry.  <li>CEOs do not care about code coverage. Speak to them appropriately about quality.  <li>Earned value reporting is ridiculous.  <li>"Don't wait until the customer is screaming to optimize for performance." <em>-- Thanks, Kevin</em>.  <li>Deliver less, but sooner and more often. <li>"Daddy, is that your new <a href="http://en.wikipedia.org/wiki/Out-Of-Box_Experience" target="_blank">OOBE</a>?" - My kid when I opened my new MacBook. "Yes, it is, son. Yes, it is."</li></ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom III</title>
		<link>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iii</link>
		<comments>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 04:14:20 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=664</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Carry a model at all times to express your understanding to others. Look for patterns in all systems at all levels. Seeing them is the very essence of insight. At the application level, architecture and design are synonymous. "BizTalk is overkill" [...]]]></description>
			<content:encoded><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a target="_blank" href="http://elegantcode.com/?p=646">here</a>.
<ol>
	<li>Carry a model at all times to express your understanding to others.</li>
	<li>Look for patterns in all systems at all levels. Seeing them is the very essence of insight.</li>
	<li>At the application level, architecture and design are synonymous.</li>
	<li>"BizTalk is overkill" is a typically overheard comment of <em>Drive by Architecture</em>.</li>
	<li>Developers would never prescribe BizTalk or a TIBCO or any other message bus system. That type of decision is typical of a CTO or someone who reports directly to one. These are strategic decisions.
"I think that, generally, if you're looking at something like BizTalk, you're probably looking at somebody, a directory port of a CIO or a CTO, I would say." -- Roger Session</li>
	<li>"Anything that is architecture and is specific to a particular technology is kind of an oxymoron." -- Roger Sessions</li>
	<li>Good design allows for emergent functionality, which we can also think of as purposeful evolution.</li>
	<li>The Open/Close principle doesn't mean you can't recompile. -- Allan Shalloway</li>
	<li>Fewer keystrokes != Elegant Code. Damn it! -- Dave Starr :)</li>
	<li>Architectural decisions are those that will kill your business if they are wrong.</li>
	<li>To introduce a new technology into a system, have the entire team immerse in an architectural spike, then estimate.</li>
	<li>Schedule riskiest work first. Try prioritizing a backlog by risk.</li>
	<li>The work of a developer is to uncover complexity, the work of an architect is to simplify it.</li>
	<li>A legacy system is one that is already making money.</li>
	<li>“The <a href="http://en.wikipedia.org/wiki/Winchester_Mystery_House">Winchester House</a> in San Jose is the perfect example of following a vision without a plan.”</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Ways to Stop Context Switching</title>
		<link>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-opposite-of-a-singleton</link>
		<comments>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 03:42:22 +0000</pubDate>
		<dc:creator>Alex Mueller</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/</guid>
		<description><![CDATA[I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to [...]]]></description>
			<content:encoded><![CDATA[<p>I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to the inverse object as a &quot;new object.&quot; As I pondered this later in the day, I considered adjectives describing the nature of objects. They can be many things, but two concepts that popped into my head to classify them were &quot;complex&quot; and &quot;simple.&quot; </p>  <p>I started playing with the words and making them resemble singleton. &quot;Complexton&quot; did not sound right to me. I should mention that I was washing my hands as I was contemplating this. I lifted up my head, looked into the mirror, and thought, &quot;SIMPLETON.&quot; The opposite of a singleton is a &quot;simpleton.&quot;</p>  <p>If the opposite of a singleton is not a &quot;simpleton,&quot; then what is it? Until I find a plausible answer, I will try and insert this new term into my next design discussion. </p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Elegant Code &#187; Widgets of Wisdom</title>
	<atom:link href="http://elegantcode.com/tag/widgets-of-wisdom/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 10:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Your First Developer Job</title>
		<link>http://elegantcode.com/2008/05/06/your-first-developer-job/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=your-first-developer-job</link>
		<comments>http://elegantcode.com/2008/05/06/your-first-developer-job/#comments</comments>
		<pubDate>Wed, 07 May 2008 04:45:09 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/05/06/your-first-developer-job/</guid>
		<description><![CDATA[I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see [...]]]></description>
			<content:encoded><![CDATA[<p>I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see them learn about the aspects of real life we face in developing solutions for clients. My favorite quote of the whole semester was, &quot;I don't think the client even knows what they want. I don't get it. Why are we even here?&quot; Awesome, no? Doesn't that just sum it all up? The beautiful thing about this is how the students were surprised when this happened. But I digress...</p>  <p>As we were wrapping up the last night I received what seemed like an innocent enough question from one of the students. &quot;What kind of job do you think I should look for?&quot;</p>  <p>It really caught me off guard, although I should have seen it coming. I didn't have a good answer on the tip of my tongue, and that may be because there isn't one. The CIS program is not designed specifically to churn out developers, but introduces students to all sorts of disciplines so they can pick a specialty later. For example thy study project management, requirements analysis, some programming, some networking, you get the idea. So the question really was bigger than it seemed. </p>  <p>Let's assume for this post that the person in question wanted to be a developer. Even if the person is looking to become a developer, the question what kind of employer to seek out isn't an easy one.</p>  <p>My father has worked 45 years as a mechanic for 2 employers. He is happy doing that. Many people, in fact most, are content with an occupation just like that. There is nothing in the world wrong with this; the world turns, people still live and love, people die, babies are born, all without making a life out of their career. Other people don't see things that way. They are passionate about their work and want to contribute to a higher vision of their chosen profession. I would guess if you are reading this, you see yourself in a similar light.</p>  <p>Someone develops code for the state government agencies. In fact, I have met many competent people who do exactly that. Are those developers missing out on something? Probably not in their mind, or they wouldn't be there. The point is simply that for some people a job is a job and there is no dishonor there.</p>  <p>This means my answer can't be glib, it must be realistic. You can't just say, &quot;Go somewhere Agile,&quot; or, &quot;Find a place where you can write Ruby.&quot; This is real life and sometimes grown ups balance security and risk and boredom and excitement because they have kids at home, or need special medical accommodation, or any one of a host of other considerations.</p>  <p>All that said, if you are passionate about the craft, if you want to drink in the industry, if you do want to learn as much as you can as soon as you can, I say this: Go work for a company with fewer than 50 employees building web solutions. </p>  <h2>Locus of Control</h2>  <p>As a company grows larger, the <a href="http://en.wikipedia.org/wiki/Locus_of_control" target="_blank">locus of control</a> individuals have inside the organization grows smaller. This is easy to see. </p>  <p>In smaller organizations, people tend to be jacks of all trades. If a server goes down, you care. If a defect is found, you care. If there is a client in the picture, you tend to actually know them. In short, small organizations provide first hand experience with many aspects of developing and delivering products. </p>  <p>In larger companies and teams, people tend to be expected to focus on a small niche of expertise. I cannot begin to tell you the number of resumes I have seen from people who spent years poking at HP's test harness suite or Micron's order entry system. This kind of &quot;specialization&quot; is not usually a recipe for career growth.</p>  <h2>Technology Exposure</h2>  <p>You'll get to go deep on technology because you are part of a small group that simply must make it work. There is no passing the buck, because there is no one to pass it to. You'll get to know whatever the technology stack is inside and out.</p>  <p>I recommend web development for a simple reason, the web isn't going away! Additionally, the technology involved in delivering to the web is growing at an astounding pace. I don't know what the web will evolve to&#160; in years to come, but it will be on hulluva ride.</p>  <h2>Comradery and Mentorship</h2>  <p>In a small organization, it is easier to foster a genuine sense that we are all in this together. The esprit de' corp in a smaller organization is typically tighter than in large organizations. This means you stand a better chance of falling in with someone who can actually mentor your career and take a genuine interest in your development.</p>  <p>Of course this exists in larger companies and is lacking in many smaller ones. I do think it is more generally found in smaller organizations, though.</p>  <h2>Conclusion</h2>  <p>So, what's the right answer? There isn't one, of course. There are just too many options and factors.</p>  <p>I will say that instead of ensuring your potential employer can pass <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" target="_blank">Spolsky's Joel Test</a>, it is more important to ensure you will be empowered to help them pass it if you come aboard.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/05/06/your-first-developer-job/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Many Uses of Relative Estimation</title>
		<link>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-many-uses-of-relative-estimation</link>
		<comments>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 21:57:16 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/</guid>
		<description><![CDATA[Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety. Have you ever looked at the website HotOrNot.com? It turns out that pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety.</p>  <p>Have you ever looked at the website <a href="http://www.hotornot.com/" target="_blank">HotOrNot.com</a>? It turns out that pretty much everyone from Quazzi Modo to Angelina Jolie ranks from a 4 to a 7. This is a prime example of our poor ability to estimate on a closely related value scale. It is pretty tough to tell if something is a 2 or a 3, but it is pretty easy to see the difference in size between a 5 and a 13. 13 is more than twice as big as 5, right?</p>  <p>Think about it this way: Does it really matter if something is going to take 3 hours or six hours? In software development, it typically doesn&#8217;t matter.</p>  <p>So the relative estimation model looks like this, in pursuing an estimate for piece of work A: </p>  <ol>   <li>Is this piece of work bigger or smaller than that piece of work B that we already did? </li>    <li>Bigger? OK, how much bigger? 2X bigger? 3X? </li>    <li>OK, 4X bigger. </li>    <li>Here is piece of work C that we already did. It was estimated at 4X bigger than B. Is it roughly the same size as A? </li>    <li>Yes. </li>    <li>Cool, we are done. </li> </ol>  <p>Once we understand that we can trust these relative comparisons because we are better at them than empirical estimation, it becomes much easier to size our work. Look at things you've already done and estimate the new one in relation to the previous work. We get our relative size and convert it into time, dollars, or whatever the project managers need and we are done. This is a much faster (and accurate) thing to do than to break it down into tasks and estimate each task. Why? Because we will never get the tasking right.</p>  <p>There is a ton more that could be said (and has) on relative estimation, but remember this: The next time you have to estimate a project for your manager, make it easier on yourself by doing a relative size first. You'll get back to coding much faster and you'll find the numbers are amazingly accurate.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Opposite of a Singleton?</title>
		<link>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-opposite-of-a-singleton</link>
		<comments>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 03:42:22 +0000</pubDate>
		<dc:creator>Alex Mueller</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/</guid>
		<description><![CDATA[I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to [...]]]></description>
			<content:encoded><![CDATA[<p>I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to the inverse object as a &quot;new object.&quot; As I pondered this later in the day, I considered adjectives describing the nature of objects. They can be many things, but two concepts that popped into my head to classify them were &quot;complex&quot; and &quot;simple.&quot; </p>  <p>I started playing with the words and making them resemble singleton. &quot;Complexton&quot; did not sound right to me. I should mention that I was washing my hands as I was contemplating this. I lifted up my head, looked into the mirror, and thought, &quot;SIMPLETON.&quot; The opposite of a singleton is a &quot;simpleton.&quot;</p>  <p>If the opposite of a singleton is not a &quot;simpleton,&quot; then what is it? Until I find a plausible answer, I will try and insert this new term into my next design discussion. </p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What is Elegant Code to me?</title>
		<link>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-is-elegant-code-to-me</link>
		<comments>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 03:47:45 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/</guid>
		<description><![CDATA[This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&#160; It isn't easy to describe.&#160; And really, the notion of what constitutes elegance in code changes over time.&#160; There is no static "this is good code" test, and I doubt there ever will be.&#160; Plus, [...]]]></description>
			<content:encoded><![CDATA[<p>This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&nbsp; It isn't easy to describe.&nbsp; And really, the notion of what constitutes elegance in code changes over time.&nbsp; There is no static "this is good code" test, and I doubt there ever will be.&nbsp; Plus, what makes good code in one language, may not apply to the next.</p> <p>So let me state for the record: today's elegant code is tomorrow's drivel.&nbsp; Don't feel bad, many writers have the same problems.&nbsp; What was super amazing back in the day is now rubbish or near unreadable.&nbsp; I am thinking of the Victorian writing that Hemingway usurped, and now Hemingway himself is almost unreadable (to me anyway).&nbsp; Tastes change with the times.&nbsp; That is a simple fact.</p> <p>So what can you do about this?&nbsp; As I say that old writing sucks to read (read Washington Irvine lately?), great works of literature still abound (for instance, Hemingway is still a great writer -- even if I prefer Tolkien) .&nbsp; So take some notes from them, and from other crafts in looking for the answer.&nbsp; If you want a cliff notes version of what this is going to tell you, it is this: you must always push yourself to get better.</p> <ol> <li>Find a good teacher.&nbsp; Nothing is better than sitting at the feet of a master who can nudge you along in the right direction.&nbsp; While early mistakes can often be corrected easily with a little bit of guidance, after they have had some time to fester all bets are off.&nbsp; I believe a fare number of "Anit-patterns" were created by self taught developers (find <a href="http://elegantcode.com/2008/03/21/sql-ejaculation/">SQL Ejaculation</a> on this site).&nbsp; <li>Read.&nbsp;&nbsp; Good writer are first good readers.&nbsp; Start with Code Complete, move into a good Patterns book, get MSDN Magazine, find some bloggers your like, but keep moving.&nbsp; You will NEVER be done reading.&nbsp; I imagine that even Martin Fowler has a "to read" booklist a mile long.  <li>Read code.&nbsp;&nbsp; There are a plethora of open source project just waiting to be read -- do so.&nbsp; This is the single best way to expand your coding repertoire, find things your language can do that you didn't even know about..&nbsp;&nbsp; Scott Hanselman has recently popularized this idea, and I thank him for it.  <li>Practice.&nbsp; This means writing small applications at home.&nbsp; You get an idea that you want to try out -- do it.&nbsp; I don't mean you have to write finished applications, just have some exploring time.&nbsp; I remember talking with an 80 year old master woodworker (he lives down the street from me), who was telling me how many time he would practice making dovetail joints before he felt competent.&nbsp; It was years worth.  <li>Pay Attention.&nbsp; Being good at anything really amounts to that.&nbsp; And don't just pay attention when reading, writing, or talking about code.&nbsp; Inspiration come from everywhere, any good artist will tell you that.&nbsp; Pay attention when you cook, when you work on the car, when you are wood working, playing an instrument, whatever it is that you do.&nbsp; This will help you in the end, event if it is just learning the amount of dedication it really takes to become good at something.  <li>Beware of preferences.&nbsp; Any time I hear someone start a statement with "I prefer code to ..." you know things are going downhill.&nbsp; If you find someone who cares more about how your code is formatted then how it is written you have found yourself in a mess.&nbsp; More importantly, beware of them in yourself.&nbsp;&nbsp; Having code style standard is important, but it isn't worth loosing sleep over.&nbsp; This also pertains to inheritance, patterns, use of particular classes (e.g. always using the generic list class in C# when a Dictionary would be better).&nbsp; <li>No Sacred Cows. Believe no single source of information.&nbsp; This means not thinking that Microsoft, Sun, IBM, Richard Stallman, or anyone else will have all of the correct answers.&nbsp; Apply the scientific method and do some research, experiment, and question the authority.&nbsp;&nbsp; There should be no sacred cows in programming.  <li>Talk with others.&nbsp; Join a user group, show up every now and then, heckle the presenter, and -maybe- speak.&nbsp; You want a broad range of people who you can talk to and bounce ideas off of.&nbsp; This will help you from becoming that crazy guy in the corner who vehemently states that all your code should be in one file.&nbsp; Having a mentor (mentioned earlier) is great, but having people around to push you from multiple directions is also good.  <li>Learn languages.&nbsp; This gets back to the "read code" idea. Make that multiple types of languages as well.&nbsp; If you know C# or Java and SQL, learn Python or Ruby, get really good at JavaScript.&nbsp; If you want something really out there, learn MDX.&nbsp; This is also a repertoire thing.&nbsp; Seeing how other languages work will make you rethink your ideas about what your current code, in whatever languages you are working in, should look like.  <li>Keep Thinking!!!&nbsp; That is possibly the most important point.&nbsp; Keep thinking.&nbsp; Don't just evaluate something once and never return, go back and reevaluate. Did the technique work?&nbsp; How could it have been better?&nbsp;&nbsp; The idea is continual improvement.  <li>Switch jobs every now and then.&nbsp; When I announced I was leaving my first programming job out of college, the VP of R&amp;D had me sit down with him and talk.&nbsp; He wasn't trying to keep me (he knew I was moving to be closer to family), he wanted to give me some advice.&nbsp; He told me to change jobs every three years.&nbsp; After you have been with a place for three years you have probably learned everything you are going to learn and it time to move on.&nbsp; This doesn't mean changing companies either.&nbsp; I've been with the same company now for four years, but I've had three different jobs.&nbsp; If you have been writing commercial applications, become a consultant - or vise-versa, become a test engineer, expand your boundaries.&nbsp; Again, this is about pushing yourself to be better.  <li>Have a Hobby. But don't ask about me, I have too many.&nbsp;&nbsp; Creating software is about creating things.&nbsp; So I suggest picking a hobby that involves creating something.&nbsp; Popular hobbies amongst programmers I know include: cooking, music, woodworking, beer making, and BBQ (which is different than cooking).&nbsp; But don't discount sports (golf is always popular), computer games, and board games.&nbsp; Anything that promotes the development of skill levels can't be a bad thing. </li></ol> <p>And I'm stopping there.&nbsp; This is my beginner's guide to how to become the writer elegant code.&nbsp; If you have others you think I missed, add them too the comments.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NetDug Unit Testing</title>
		<link>http://elegantcode.com/2008/03/22/netdug-unit-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=netdug-unit-testing</link>
		<comments>http://elegantcode.com/2008/03/22/netdug-unit-testing/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 21:00:30 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/22/netdug-unit-testing/</guid>
		<description><![CDATA[So last night I had the opportunity to be the moderator at NetDug, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk [...]]]></description>
			<content:encoded><![CDATA[So last night I had the opportunity to be the moderator at <a href="http://www.netdug.com">NetDug</a>, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk with 20 slides, I think I showed about 5 of them.  I consider that a success (I threatened the audience, the less they talked, the more slides I would show).

<a href="http://elegantcode.com/wp-content/uploads/2008/03/unittestingdemo.zip">Slides and sample code</a>

What I learned from last night:
<ol>
	<li>I'm not much of a moderator (I talk to much)</li>
	<li>Code coverage is a art in divination</li>
	<li>Mock/Stub/Fake Objects are hard to explain</li>
	<li>Over use Mocks could be a code smell</li>
	<li>The discussion format actually works pretty well for talking about unit testing</li>
	<li>If you give geeks a chance to talk, they will talk</li>
</ol>
What I hope everyone else got from the topic:
<ol>
	<li>Unit testing forces you to write better code</li>
	<li>Unit testing forces you to use better object oriented principles</li>
</ol>
<h3>Test Technology</h3>
This was an early question, what technologies to use to test your code.  <a href="http://www.nunit.org/index.php">NUnit</a>, MSUnit, and <a href="http://www.mbunit.com/">MBUnit</a> were all mentioned and viable, and stable, technologies.  For mock objects (which you are going to need) there is <a href="http://www.ayende.com/projects/rhino-mocks/downloads.aspx">Rhino Mocks</a> and <a href="http://www.typemock.com/">TypeMock</a>.  I suggest Rhino Mocks over <a href="http://www.typemock.com/">TypeMock</a> for anyone who can't purchase the full version of <a href="http://www.typemock.com/">TypeMock</a> (but there is a nice free version as well).

Then there are the helper technologies: <a href="http://testdriven.net">TestDriven.Net</a> and <a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> are the main two, but apparently MSUnit's runner isn't bad either (I haven't used it yet).  All of these tools make it easier to run your unit tests from inside Visual Studio, and each has other benefits.  <a href="http://testdriven.net">TestDriven.Net</a> has wonderful Reflector integration (a better object browser), and ReSharper...<a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> is just a must have (that is me talking, not the group).
<h3>Code Coverage</h3>
Code Coverage, using tools like <a href="http://www.ncover.com/">NCover</a> (<a href="http://www.ncover.com/download/discontinued">free version</a>), tell you how much of your code base is tested.  This was one of the early questions.  How much of your code base should be tested?  Answer: it depends on the product.  My view is that a library (no UI element) should have +90% coverage, if there is a substantial amount of UI then the project can get down to 60%.  If your code coverage gets below that you just aren't trying, or you need to rethink your architecture. 

I did talk a bit about code that was not really testable (not in an automated way anyway): UI, Database code, and external resource code are all potentially untestable.  More on this in a moment.

Database code is not testable if you can't return the database to a known state (you can restore the database data). 

UI code testing should be avoided because UI tests have to be so bound to the UI that they are brittle.  So you end up spending a considerable portion of your development time fixing broken test. Brittle tests are to be avoided whenever possible.
<h3>Testing existing code</h3>
Probably the hardest question to answer from last night was: how do you test existing code bases.  And that came up over and over.  Do you start with integration tests and then work in unit tests, or the other way around. 

I will admit, most of the time when I talk about unit testing, I center it around new projects.  Unit test is hard enough with new code, testing old code that wasn't written with unit test in mind is a migraine waiting to happen.

The audience did have some good advice though.  Pick parts of the project that you need to work on (say one class) and make that testable and tested.  Essentially you start creating silos of tested code.  The other suggestion (and I actually had a slide for this) was to get the book: <a href="http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206114497&amp;sr=8-1">Working Effectively with Legacy Code</a>.  Finally, buy TypeMock -- the big boy version, not the free-be version.  You'll need it.
<h3>UI Testing</h3>
This is my treatise on writing unit tests for the User Interface:

1. Don't do it until you are done with the UI.
2. Only test that the UI works in a basic sense.
3. You still have to test the UI by hand.

If you start writing UI tests while you are developing the UI, you will continually break the tests.  Writing the test by hand is none trivial, and using tools to write them is also error prone.  Finally, these tests can't tell you if the UI is just bad.  Only exposure can tell you that.  Every developer should be forced to have to use their UI repeatedly so they know where is sucks.  You wont get that with automated UI tests.

That said, there are tools to help you test web user interfaces. <a href="http://watin.sourceforge.net/">Watin</a>, <a href="http://wtr.rubyforge.org/">Watir</a>, and <a href="http://selenium.openqa.org/">Selenium</a> are all there to help.  We shall see if Team Systems adds anything to help with this (I'm hoping it does).
<h3>Testing Database code</h3>
This is essentially, testing code that touches the database.  Could be your <a href="http://www.hibernate.org/343.html">NHibernate</a> code, could be a stored procedure, could be ADO.Net code.  But really, this is just code that must touch an outside resource (database, file system, serial connection, etc) and there is no way, or point, to abstract it out any further.

The main point here was to have a way to get the data back to a known state.  Without that everything else gets much harder.

We also came up with a new term: SQL Ejaculation.  That is a pattern smell where an excessive amount of your HTML comes from you SQL database.  Like the entire site.  All of the HTML.  And you have stored procedures that simply build the HTML -- in a 10,000 line stored procedure.  That is SQL Ejaculation.

Note: if this comes up in a Google search I might get worried.
<h3></h3>
<h3>After the meeting</h3>
We all went to Table Rock for a beer.  'nuf said, it is a great group.

Finally, to the guy who asked me a question after the meeting was over: I'm sorry, I just haven't had to draw multiple, overlapping, transparent images on a win form using GDI.Net in a really long time.  I know it involves alpha-transparency values, but I haven't done that in years.  Maybe you should look at WPF.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/22/netdug-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be Careful of Your Passion</title>
		<link>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=be-careful-of-your-passion</link>
		<comments>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 14:37:04 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Architecture and Design]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/02/27/be-careful-of-your-passion/</guid>
		<description><![CDATA[Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." Most of us got into this business because we liked making computers do things we [...]]]></description>
			<content:encoded><![CDATA[<p>Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." </p> <p>Most of us got into this business because we liked making computers do things we think of as cool. The most successful among us still get that rush when our new creation spools up and runs.</p> <p>Tinkerers like us tend to gold plate the pieces of our systems we find most interesting. This is why developers will often find themselves the go-to-guy for certain specialities. A dev likes making services, she makes good ones because it's fun, she gets to make more of them. Sounds perfectly reasonable and symbiotic, no?</p> <p>It can be.</p> <h2>Ignoring the Boring</h2> <p>When we get to focus exclusively on the parts of the system that really flip our bits, it can come at a price. Although we might be jazzed about services, that data model still needs our attention. It is fairly common to focus on that thing that really gets us excited and forget (or outright ignore) that part which seems boring. Just because you think someone else will come along and sweep up after doesn't make it happen. </p> <p>The most common instance of "Ignoring the Boring" is documentation. Let's face it, we want to write in languages other than English, right? Documentation is in the elegance of my self-describing code, right? Not so much. Whether we like it or not, documentation is often a deliverable of our system and as such deserves the respect we might give to our WSDL or interface definitions. Just because the reader is a human rather than a machine doesn't mean we should short change her because it's boring to do the work.</p> <h2>Smells of Sub-Optimizing</h2> <p>It is easy to see this kind of monocular behavior can result in a really clean UI with a messy back end, or visa versa. Whatever gets the short end of the stick will tend to show up in the system as a glaring deficit. We can then measure the deficit in the ignored sub-component in observable ways. Some failures of attention to detail might include:</p> <ul> <li>Lack of enforced constraints or relationships in database tables  <li>Code in the view, because it's just this one little thing  <li>Leaky abstractions, because wrapping that data model in business logic can be a real PITA  <li>No check in notes  <li>Not taking the time to do code reviews, even informally</li></ul> <h2>The System Isn't Your Playground</h2> <p>On the other end of the spectrum, what happens when we get to play with the things that <em>are</em> fun? The results can depend on what the implementer really enjoys.</p> <p>One recent real world story I heard told of a hardware engineer who designed 7 different chips within a device, each with a fundamentally different way of representing logic circuits. The chip engineer had a great time applying all the different techniques he read about in last month's <em>Nerd Fest Quarterly</em>, but the team assigned to test this Franken-board was rightly annoyed.</p> <p>Another symptom of playground development is needless abstraction layers or design patterns applied to simple problems. If a system is implemented with a gazillion abstraction layers where only a concrete implementation will do, you can bet someone is reading the <em>Gang of Four</em> in bed at night.</p> <p>If your passion is trying new tools and technologies, how many of these shiny new toys are incorporated into your system without deliberate attention? How many logging libraries does one team really need? How many unit test frameworks?</p> <p><a href="http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It" target="_blank">YAGNI</a>, 'nuff said.</p> <h2>Keep Your Passion Alive</h2> <p>So, what are you saying, Starr? Stop trying to extract pleasure from my work? Just bang the keys and give my 40 to the man? Of course not!</p> <p>I am simply asserting that there is a degree of professionalism needed at all levels. Let's care about the system as a whole and be good stewards to the craft, not just the shiny bits. And, yes, documentation is a justifiable deliverable. Cowboy up.</p> <p>Learn new techniques that fire you up and apply them wisely, not with wild abandon. Delayed gratification means not always getting to use WPF to make a draw a button, or SilverLight to make a logo spin (&lt;-- bad example). Sometimes this means capitulating to use the prescribed framework so we can get a systemic optimization instead of trying to roll our own multi-tenant web portal, yet again.</p> <p>Having more tools in our toolbox is a great thing. This is the essence of youthful fun in our work. Knowing when to use those shiny new tools is the wisdom part. Now go learn something new.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Confessions of a bad web developer</title>
		<link>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=confessions-of-a-bad-web-developer</link>
		<comments>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 03:57:55 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/</guid>
		<description><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately. Not a lot, just enough to get acquainted for right now. Yesterday I had my "Road to Damascus" incident. I don't know HTML. OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them [...]]]></description>
			<content:encoded><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately.  Not a lot, just enough to get acquainted for right now.  Yesterday I had my "Road to Damascus" incident.  I don't know HTML.

OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them without looking things up.  More importantly, I know a ton of asp.net controls.  What I don't know, specifically, is how they all work.

Like the form tag.  I know every Asp.Net page I have ever made has had one of them (and only one, at least as of .Net 1.1 that is all you were allowed).  But I don't remember how to use it any more.  How to read data from it, pass values from one page to the next.  I used to, did it a few times in fact.  Then came Asp.Net, and I haven't looked back.

Have I written JavaScript during this time?  Sort of.  If you count copying code from Google (and testing it of course).  Over the years I have large blocks of Googled JavaScript code in existing projects that I've move from page to page.  Cut-and-paste is a type of reuse...right?  And lately, when my JavaScript requirements have not been Google-able, <a href="http://jquery.com">JQuery</a> has become my savior (more posts on that soon).  But I haven't written a JavaScript object, Prototype, or any such tomfoolery since Netscape 4.8.

And just to clarify.  I once wrote my own tree control in JavaScript.  Or, I wrote one for Netscape 4.04, 4.08, 4.5, 4.75, 4.8, and IE.  I never thought I could hate a language until Netscape.  Netscape killed any love of JavaScript for me.

But now with Ajax on the scene I can't do without it anymore.  And as cool as the Asp.Net Ajax Library is and all of the things that the control toolkit can do for you: without a bit of JavaScript muscle, it just isn't going to work for you.  Take a look at the Google Maps API and tell me you aren't thinking of things that could be done with it.  But it ain't going no where without some JavaScript know-how.

CSS I have come to terms with.  I know the difference between .tag and #tag.  I've written a hover or two.  But there are still unknowns there as well.  I still visit <a href="http://w3schools.com/css">w3schools</a> regularly, and spend way too much time with <a href="http://www.getfirebug.com">FireBug</a> and <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a>.  And <a href="http://csszengarden.com">CssZenGarden</a> -- that is just beyond me right now.

But even in Asp.Net.  <a href="http://www.xefteri.com/articles/show.cfm?id=18">How does a post back work?</a> How is it that a button click is hooked up to an event handler? I'm a firm believer that their is no "magic" in programming.  Post back is magic to me.   Maybe once years ago I knew, but not anymore.

But things like: if you have a table, and every row has a check box on it, on the server side, how do you know which check box is which?  Heck, how do I figure that out on the client side with JavaScript?  The magic is ViewState, I know.  But...

That really is the beauty of WebForms.  It provides a nice insulating coat that insulates you from all of the goo that is html and JavaScript.  ViewState is my friend.  But what does this have to do with Asp.Net MVC?  Absolutely everything.

Asp.Net is a stripped down version of web development with .Net.  ViewState: gone.  asp:Button: hope you are familiar with submit.  The cozy jacket is gone and has been replaced with a wind breaker.  All those old techniques that we threw away with our last ASP page needs to be resurrected.

Being how I already live in a cold climate, I know that the biggest part of working in cold weather is to acclimated to the temperature.  Part of it as well, is knowing that you have to work in the cold climate.  So this isn't time to put things off.  Spring is still a ways off.  So, for Asp.Net WebForms developers, that means re-familiarizing yourself with a few technologies that we all thought we didn't need to know that well:
<ul>
	<li>XHML</li>
	<li>CSS</li>
	<li>JavaScript</li>
	<li>JSON</li>
	<li>JQuery</li>
	<li>Asp.Net Ajax framework</li>
</ul>
I'm not going to specify particular books.  I don't have time for that, and you can search Amazon as well as I can.  Actually, I bought a couple of these books for  at Hastings near my house.  Worth every cent.

Also worth noting what is not on my list: XML.  The language we thought was the lingua franca of the web.  I've had enough XML, and the Asp.Net Ajax library talks via JSON (which is much smaller).   So XML is out for me.  And that is fine, I think, there is enough to learn as is.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom IV</title>
		<link>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iv</link>
		<comments>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 04:48:42 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins. Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. [...]]]></description>
			<content:encoded><![CDATA[<p>If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a href="http://elegantcode.com/?p=646" target="_blank">here</a>.</p> <ol> <li>Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins.  <li>Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. .Net, as an example.  <li>If metrics are prescribed to a team, explain how they will be used. Metrics cause fear, mitigate that fear.  <li>You can prescribe Agility, but not hyper-performance.  <li>Part of the maturation process of Agile is the tendency for people to over-analyze the holy heck out of it. This is relly a reaction to the cost of software development and the incredible amounts of historical waste in the industry.  <li>CEOs do not care about code coverage. Speak to them appropriately about quality.  <li>Earned value reporting is ridiculous.  <li>"Don't wait until the customer is screaming to optimize for performance." <em>-- Thanks, Kevin</em>.  <li>Deliver less, but sooner and more often. <li>"Daddy, is that your new <a href="http://en.wikipedia.org/wiki/Out-Of-Box_Experience" target="_blank">OOBE</a>?" - My kid when I opened my new MacBook. "Yes, it is, son. Yes, it is."</li></ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom III</title>
		<link>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iii</link>
		<comments>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 04:14:20 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=664</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Carry a model at all times to express your understanding to others. Look for patterns in all systems at all levels. Seeing them is the very essence of insight. At the application level, architecture and design are synonymous. "BizTalk is overkill" [...]]]></description>
			<content:encoded><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a target="_blank" href="http://elegantcode.com/?p=646">here</a>.
<ol>
	<li>Carry a model at all times to express your understanding to others.</li>
	<li>Look for patterns in all systems at all levels. Seeing them is the very essence of insight.</li>
	<li>At the application level, architecture and design are synonymous.</li>
	<li>"BizTalk is overkill" is a typically overheard comment of <em>Drive by Architecture</em>.</li>
	<li>Developers would never prescribe BizTalk or a TIBCO or any other message bus system. That type of decision is typical of a CTO or someone who reports directly to one. These are strategic decisions.
"I think that, generally, if you're looking at something like BizTalk, you're probably looking at somebody, a directory port of a CIO or a CTO, I would say." -- Roger Session</li>
	<li>"Anything that is architecture and is specific to a particular technology is kind of an oxymoron." -- Roger Sessions</li>
	<li>Good design allows for emergent functionality, which we can also think of as purposeful evolution.</li>
	<li>The Open/Close principle doesn't mean you can't recompile. -- Allan Shalloway</li>
	<li>Fewer keystrokes != Elegant Code. Damn it! -- Dave Starr :)</li>
	<li>Architectural decisions are those that will kill your business if they are wrong.</li>
	<li>To introduce a new technology into a system, have the entire team immerse in an architectural spike, then estimate.</li>
	<li>Schedule riskiest work first. Try prioritizing a backlog by risk.</li>
	<li>The work of a developer is to uncover complexity, the work of an architect is to simplify it.</li>
	<li>A legacy system is one that is already making money.</li>
	<li>“The <a href="http://en.wikipedia.org/wiki/Winchester_Mystery_House">Winchester House</a> in San Jose is the perfect example of following a vision without a plan.”</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Ways to Stop Context Switching</title>
		<link>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-is-elegant-code-to-me</link>
		<comments>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 03:47:45 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/</guid>
		<description><![CDATA[This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&#160; It isn't easy to describe.&#160; And really, the notion of what constitutes elegance in code changes over time.&#160; There is no static "this is good code" test, and I doubt there ever will be.&#160; Plus, [...]]]></description>
			<content:encoded><![CDATA[<p>This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&nbsp; It isn't easy to describe.&nbsp; And really, the notion of what constitutes elegance in code changes over time.&nbsp; There is no static "this is good code" test, and I doubt there ever will be.&nbsp; Plus, what makes good code in one language, may not apply to the next.</p> <p>So let me state for the record: today's elegant code is tomorrow's drivel.&nbsp; Don't feel bad, many writers have the same problems.&nbsp; What was super amazing back in the day is now rubbish or near unreadable.&nbsp; I am thinking of the Victorian writing that Hemingway usurped, and now Hemingway himself is almost unreadable (to me anyway).&nbsp; Tastes change with the times.&nbsp; That is a simple fact.</p> <p>So what can you do about this?&nbsp; As I say that old writing sucks to read (read Washington Irvine lately?), great works of literature still abound (for instance, Hemingway is still a great writer -- even if I prefer Tolkien) .&nbsp; So take some notes from them, and from other crafts in looking for the answer.&nbsp; If you want a cliff notes version of what this is going to tell you, it is this: you must always push yourself to get better.</p> <ol> <li>Find a good teacher.&nbsp; Nothing is better than sitting at the feet of a master who can nudge you along in the right direction.&nbsp; While early mistakes can often be corrected easily with a little bit of guidance, after they have had some time to fester all bets are off.&nbsp; I believe a fare number of "Anit-patterns" were created by self taught developers (find <a href="http://elegantcode.com/2008/03/21/sql-ejaculation/">SQL Ejaculation</a> on this site).&nbsp; <li>Read.&nbsp;&nbsp; Good writer are first good readers.&nbsp; Start with Code Complete, move into a good Patterns book, get MSDN Magazine, find some bloggers your like, but keep moving.&nbsp; You will NEVER be done reading.&nbsp; I imagine that even Martin Fowler has a "to read" booklist a mile long.  <li>Read code.&nbsp;&nbsp; There are a plethora of open source project just waiting to be read -- do so.&nbsp; This is the single best way to expand your coding repertoire, find things your language can do that you didn't even know about..&nbsp;&nbsp; Scott Hanselman has recently popularized this idea, and I thank him for it.  <li>Practice.&nbsp; This means writing small applications at home.&nbsp; You get an idea that you want to try out -- do it.&nbsp; I don't mean you have to write finished applications, just have some exploring time.&nbsp; I remember talking with an 80 year old master woodworker (he lives down the street from me), who was telling me how many time he would practice making dovetail joints before he felt competent.&nbsp; It was years worth.  <li>Pay Attention.&nbsp; Being good at anything really amounts to that.&nbsp; And don't just pay attention when reading, writing, or talking about code.&nbsp; Inspiration come from everywhere, any good artist will tell you that.&nbsp; Pay attention when you cook, when you work on the car, when you are wood working, playing an instrument, whatever it is that you do.&nbsp; This will help you in the end, event if it is just learning the amount of dedication it really takes to become good at something.  <li>Beware of preferences.&nbsp; Any time I hear someone start a statement with "I prefer code to ..." you know things are going downhill.&nbsp; If you find someone who cares more about how your code is formatted then how it is written you have found yourself in a mess.&nbsp; More importantly, beware of them in yourself.&nbsp;&nbsp; Having code style standard is important, but it isn't worth loosing sleep over.&nbsp; This also pertains to inheritance, patterns, use of particular classes (e.g. always using the generic list class in C# when a Dictionary would be better).&nbsp; <li>No Sacred Cows. Believe no single source of information.&nbsp; This means not thinking that Microsoft, Sun, IBM, Richard Stallman, or anyone else will have all of the correct answers.&nbsp; Apply the scientific method and do some research, experiment, and question the authority.&nbsp;&nbsp; There should be no sacred cows in programming.  <li>Talk with others.&nbsp; Join a user group, show up every now and then, heckle the presenter, and -maybe- speak.&nbsp; You want a broad range of people who you can talk to and bounce ideas off of.&nbsp; This will help you from becoming that crazy guy in the corner who vehemently states that all your code should be in one file.&nbsp; Having a mentor (mentioned earlier) is great, but having people around to push you from multiple directions is also good.  <li>Learn languages.&nbsp; This gets back to the "read code" idea. Make that multiple types of languages as well.&nbsp; If you know C# or Java and SQL, learn Python or Ruby, get really good at JavaScript.&nbsp; If you want something really out there, learn MDX.&nbsp; This is also a repertoire thing.&nbsp; Seeing how other languages work will make you rethink your ideas about what your current code, in whatever languages you are working in, should look like.  <li>Keep Thinking!!!&nbsp; That is possibly the most important point.&nbsp; Keep thinking.&nbsp; Don't just evaluate something once and never return, go back and reevaluate. Did the technique work?&nbsp; How could it have been better?&nbsp;&nbsp; The idea is continual improvement.  <li>Switch jobs every now and then.&nbsp; When I announced I was leaving my first programming job out of college, the VP of R&amp;D had me sit down with him and talk.&nbsp; He wasn't trying to keep me (he knew I was moving to be closer to family), he wanted to give me some advice.&nbsp; He told me to change jobs every three years.&nbsp; After you have been with a place for three years you have probably learned everything you are going to learn and it time to move on.&nbsp; This doesn't mean changing companies either.&nbsp; I've been with the same company now for four years, but I've had three different jobs.&nbsp; If you have been writing commercial applications, become a consultant - or vise-versa, become a test engineer, expand your boundaries.&nbsp; Again, this is about pushing yourself to be better.  <li>Have a Hobby. But don't ask about me, I have too many.&nbsp;&nbsp; Creating software is about creating things.&nbsp; So I suggest picking a hobby that involves creating something.&nbsp; Popular hobbies amongst programmers I know include: cooking, music, woodworking, beer making, and BBQ (which is different than cooking).&nbsp; But don't discount sports (golf is always popular), computer games, and board games.&nbsp; Anything that promotes the development of skill levels can't be a bad thing. </li></ol> <p>And I'm stopping there.&nbsp; This is my beginner's guide to how to become the writer elegant code.&nbsp; If you have others you think I missed, add them too the comments.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Elegant Code &#187; Widgets of Wisdom</title>
	<atom:link href="http://elegantcode.com/tag/widgets-of-wisdom/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 10:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Your First Developer Job</title>
		<link>http://elegantcode.com/2008/05/06/your-first-developer-job/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=your-first-developer-job</link>
		<comments>http://elegantcode.com/2008/05/06/your-first-developer-job/#comments</comments>
		<pubDate>Wed, 07 May 2008 04:45:09 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/05/06/your-first-developer-job/</guid>
		<description><![CDATA[I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see [...]]]></description>
			<content:encoded><![CDATA[<p>I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see them learn about the aspects of real life we face in developing solutions for clients. My favorite quote of the whole semester was, &quot;I don't think the client even knows what they want. I don't get it. Why are we even here?&quot; Awesome, no? Doesn't that just sum it all up? The beautiful thing about this is how the students were surprised when this happened. But I digress...</p>  <p>As we were wrapping up the last night I received what seemed like an innocent enough question from one of the students. &quot;What kind of job do you think I should look for?&quot;</p>  <p>It really caught me off guard, although I should have seen it coming. I didn't have a good answer on the tip of my tongue, and that may be because there isn't one. The CIS program is not designed specifically to churn out developers, but introduces students to all sorts of disciplines so they can pick a specialty later. For example thy study project management, requirements analysis, some programming, some networking, you get the idea. So the question really was bigger than it seemed. </p>  <p>Let's assume for this post that the person in question wanted to be a developer. Even if the person is looking to become a developer, the question what kind of employer to seek out isn't an easy one.</p>  <p>My father has worked 45 years as a mechanic for 2 employers. He is happy doing that. Many people, in fact most, are content with an occupation just like that. There is nothing in the world wrong with this; the world turns, people still live and love, people die, babies are born, all without making a life out of their career. Other people don't see things that way. They are passionate about their work and want to contribute to a higher vision of their chosen profession. I would guess if you are reading this, you see yourself in a similar light.</p>  <p>Someone develops code for the state government agencies. In fact, I have met many competent people who do exactly that. Are those developers missing out on something? Probably not in their mind, or they wouldn't be there. The point is simply that for some people a job is a job and there is no dishonor there.</p>  <p>This means my answer can't be glib, it must be realistic. You can't just say, &quot;Go somewhere Agile,&quot; or, &quot;Find a place where you can write Ruby.&quot; This is real life and sometimes grown ups balance security and risk and boredom and excitement because they have kids at home, or need special medical accommodation, or any one of a host of other considerations.</p>  <p>All that said, if you are passionate about the craft, if you want to drink in the industry, if you do want to learn as much as you can as soon as you can, I say this: Go work for a company with fewer than 50 employees building web solutions. </p>  <h2>Locus of Control</h2>  <p>As a company grows larger, the <a href="http://en.wikipedia.org/wiki/Locus_of_control" target="_blank">locus of control</a> individuals have inside the organization grows smaller. This is easy to see. </p>  <p>In smaller organizations, people tend to be jacks of all trades. If a server goes down, you care. If a defect is found, you care. If there is a client in the picture, you tend to actually know them. In short, small organizations provide first hand experience with many aspects of developing and delivering products. </p>  <p>In larger companies and teams, people tend to be expected to focus on a small niche of expertise. I cannot begin to tell you the number of resumes I have seen from people who spent years poking at HP's test harness suite or Micron's order entry system. This kind of &quot;specialization&quot; is not usually a recipe for career growth.</p>  <h2>Technology Exposure</h2>  <p>You'll get to go deep on technology because you are part of a small group that simply must make it work. There is no passing the buck, because there is no one to pass it to. You'll get to know whatever the technology stack is inside and out.</p>  <p>I recommend web development for a simple reason, the web isn't going away! Additionally, the technology involved in delivering to the web is growing at an astounding pace. I don't know what the web will evolve to&#160; in years to come, but it will be on hulluva ride.</p>  <h2>Comradery and Mentorship</h2>  <p>In a small organization, it is easier to foster a genuine sense that we are all in this together. The esprit de' corp in a smaller organization is typically tighter than in large organizations. This means you stand a better chance of falling in with someone who can actually mentor your career and take a genuine interest in your development.</p>  <p>Of course this exists in larger companies and is lacking in many smaller ones. I do think it is more generally found in smaller organizations, though.</p>  <h2>Conclusion</h2>  <p>So, what's the right answer? There isn't one, of course. There are just too many options and factors.</p>  <p>I will say that instead of ensuring your potential employer can pass <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" target="_blank">Spolsky's Joel Test</a>, it is more important to ensure you will be empowered to help them pass it if you come aboard.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/05/06/your-first-developer-job/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Many Uses of Relative Estimation</title>
		<link>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-many-uses-of-relative-estimation</link>
		<comments>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 21:57:16 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/</guid>
		<description><![CDATA[Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety. Have you ever looked at the website HotOrNot.com? It turns out that pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety.</p>  <p>Have you ever looked at the website <a href="http://www.hotornot.com/" target="_blank">HotOrNot.com</a>? It turns out that pretty much everyone from Quazzi Modo to Angelina Jolie ranks from a 4 to a 7. This is a prime example of our poor ability to estimate on a closely related value scale. It is pretty tough to tell if something is a 2 or a 3, but it is pretty easy to see the difference in size between a 5 and a 13. 13 is more than twice as big as 5, right?</p>  <p>Think about it this way: Does it really matter if something is going to take 3 hours or six hours? In software development, it typically doesn&#8217;t matter.</p>  <p>So the relative estimation model looks like this, in pursuing an estimate for piece of work A: </p>  <ol>   <li>Is this piece of work bigger or smaller than that piece of work B that we already did? </li>    <li>Bigger? OK, how much bigger? 2X bigger? 3X? </li>    <li>OK, 4X bigger. </li>    <li>Here is piece of work C that we already did. It was estimated at 4X bigger than B. Is it roughly the same size as A? </li>    <li>Yes. </li>    <li>Cool, we are done. </li> </ol>  <p>Once we understand that we can trust these relative comparisons because we are better at them than empirical estimation, it becomes much easier to size our work. Look at things you've already done and estimate the new one in relation to the previous work. We get our relative size and convert it into time, dollars, or whatever the project managers need and we are done. This is a much faster (and accurate) thing to do than to break it down into tasks and estimate each task. Why? Because we will never get the tasking right.</p>  <p>There is a ton more that could be said (and has) on relative estimation, but remember this: The next time you have to estimate a project for your manager, make it easier on yourself by doing a relative size first. You'll get back to coding much faster and you'll find the numbers are amazingly accurate.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Opposite of a Singleton?</title>
		<link>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-opposite-of-a-singleton</link>
		<comments>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 03:42:22 +0000</pubDate>
		<dc:creator>Alex Mueller</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/</guid>
		<description><![CDATA[I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to [...]]]></description>
			<content:encoded><![CDATA[<p>I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to the inverse object as a &quot;new object.&quot; As I pondered this later in the day, I considered adjectives describing the nature of objects. They can be many things, but two concepts that popped into my head to classify them were &quot;complex&quot; and &quot;simple.&quot; </p>  <p>I started playing with the words and making them resemble singleton. &quot;Complexton&quot; did not sound right to me. I should mention that I was washing my hands as I was contemplating this. I lifted up my head, looked into the mirror, and thought, &quot;SIMPLETON.&quot; The opposite of a singleton is a &quot;simpleton.&quot;</p>  <p>If the opposite of a singleton is not a &quot;simpleton,&quot; then what is it? Until I find a plausible answer, I will try and insert this new term into my next design discussion. </p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What is Elegant Code to me?</title>
		<link>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-is-elegant-code-to-me</link>
		<comments>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 03:47:45 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/</guid>
		<description><![CDATA[This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&#160; It isn't easy to describe.&#160; And really, the notion of what constitutes elegance in code changes over time.&#160; There is no static "this is good code" test, and I doubt there ever will be.&#160; Plus, [...]]]></description>
			<content:encoded><![CDATA[<p>This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&nbsp; It isn't easy to describe.&nbsp; And really, the notion of what constitutes elegance in code changes over time.&nbsp; There is no static "this is good code" test, and I doubt there ever will be.&nbsp; Plus, what makes good code in one language, may not apply to the next.</p> <p>So let me state for the record: today's elegant code is tomorrow's drivel.&nbsp; Don't feel bad, many writers have the same problems.&nbsp; What was super amazing back in the day is now rubbish or near unreadable.&nbsp; I am thinking of the Victorian writing that Hemingway usurped, and now Hemingway himself is almost unreadable (to me anyway).&nbsp; Tastes change with the times.&nbsp; That is a simple fact.</p> <p>So what can you do about this?&nbsp; As I say that old writing sucks to read (read Washington Irvine lately?), great works of literature still abound (for instance, Hemingway is still a great writer -- even if I prefer Tolkien) .&nbsp; So take some notes from them, and from other crafts in looking for the answer.&nbsp; If you want a cliff notes version of what this is going to tell you, it is this: you must always push yourself to get better.</p> <ol> <li>Find a good teacher.&nbsp; Nothing is better than sitting at the feet of a master who can nudge you along in the right direction.&nbsp; While early mistakes can often be corrected easily with a little bit of guidance, after they have had some time to fester all bets are off.&nbsp; I believe a fare number of "Anit-patterns" were created by self taught developers (find <a href="http://elegantcode.com/2008/03/21/sql-ejaculation/">SQL Ejaculation</a> on this site).&nbsp; <li>Read.&nbsp;&nbsp; Good writer are first good readers.&nbsp; Start with Code Complete, move into a good Patterns book, get MSDN Magazine, find some bloggers your like, but keep moving.&nbsp; You will NEVER be done reading.&nbsp; I imagine that even Martin Fowler has a "to read" booklist a mile long.  <li>Read code.&nbsp;&nbsp; There are a plethora of open source project just waiting to be read -- do so.&nbsp; This is the single best way to expand your coding repertoire, find things your language can do that you didn't even know about..&nbsp;&nbsp; Scott Hanselman has recently popularized this idea, and I thank him for it.  <li>Practice.&nbsp; This means writing small applications at home.&nbsp; You get an idea that you want to try out -- do it.&nbsp; I don't mean you have to write finished applications, just have some exploring time.&nbsp; I remember talking with an 80 year old master woodworker (he lives down the street from me), who was telling me how many time he would practice making dovetail joints before he felt competent.&nbsp; It was years worth.  <li>Pay Attention.&nbsp; Being good at anything really amounts to that.&nbsp; And don't just pay attention when reading, writing, or talking about code.&nbsp; Inspiration come from everywhere, any good artist will tell you that.&nbsp; Pay attention when you cook, when you work on the car, when you are wood working, playing an instrument, whatever it is that you do.&nbsp; This will help you in the end, event if it is just learning the amount of dedication it really takes to become good at something.  <li>Beware of preferences.&nbsp; Any time I hear someone start a statement with "I prefer code to ..." you know things are going downhill.&nbsp; If you find someone who cares more about how your code is formatted then how it is written you have found yourself in a mess.&nbsp; More importantly, beware of them in yourself.&nbsp;&nbsp; Having code style standard is important, but it isn't worth loosing sleep over.&nbsp; This also pertains to inheritance, patterns, use of particular classes (e.g. always using the generic list class in C# when a Dictionary would be better).&nbsp; <li>No Sacred Cows. Believe no single source of information.&nbsp; This means not thinking that Microsoft, Sun, IBM, Richard Stallman, or anyone else will have all of the correct answers.&nbsp; Apply the scientific method and do some research, experiment, and question the authority.&nbsp;&nbsp; There should be no sacred cows in programming.  <li>Talk with others.&nbsp; Join a user group, show up every now and then, heckle the presenter, and -maybe- speak.&nbsp; You want a broad range of people who you can talk to and bounce ideas off of.&nbsp; This will help you from becoming that crazy guy in the corner who vehemently states that all your code should be in one file.&nbsp; Having a mentor (mentioned earlier) is great, but having people around to push you from multiple directions is also good.  <li>Learn languages.&nbsp; This gets back to the "read code" idea. Make that multiple types of languages as well.&nbsp; If you know C# or Java and SQL, learn Python or Ruby, get really good at JavaScript.&nbsp; If you want something really out there, learn MDX.&nbsp; This is also a repertoire thing.&nbsp; Seeing how other languages work will make you rethink your ideas about what your current code, in whatever languages you are working in, should look like.  <li>Keep Thinking!!!&nbsp; That is possibly the most important point.&nbsp; Keep thinking.&nbsp; Don't just evaluate something once and never return, go back and reevaluate. Did the technique work?&nbsp; How could it have been better?&nbsp;&nbsp; The idea is continual improvement.  <li>Switch jobs every now and then.&nbsp; When I announced I was leaving my first programming job out of college, the VP of R&amp;D had me sit down with him and talk.&nbsp; He wasn't trying to keep me (he knew I was moving to be closer to family), he wanted to give me some advice.&nbsp; He told me to change jobs every three years.&nbsp; After you have been with a place for three years you have probably learned everything you are going to learn and it time to move on.&nbsp; This doesn't mean changing companies either.&nbsp; I've been with the same company now for four years, but I've had three different jobs.&nbsp; If you have been writing commercial applications, become a consultant - or vise-versa, become a test engineer, expand your boundaries.&nbsp; Again, this is about pushing yourself to be better.  <li>Have a Hobby. But don't ask about me, I have too many.&nbsp;&nbsp; Creating software is about creating things.&nbsp; So I suggest picking a hobby that involves creating something.&nbsp; Popular hobbies amongst programmers I know include: cooking, music, woodworking, beer making, and BBQ (which is different than cooking).&nbsp; But don't discount sports (golf is always popular), computer games, and board games.&nbsp; Anything that promotes the development of skill levels can't be a bad thing. </li></ol> <p>And I'm stopping there.&nbsp; This is my beginner's guide to how to become the writer elegant code.&nbsp; If you have others you think I missed, add them too the comments.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NetDug Unit Testing</title>
		<link>http://elegantcode.com/2008/03/22/netdug-unit-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=netdug-unit-testing</link>
		<comments>http://elegantcode.com/2008/03/22/netdug-unit-testing/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 21:00:30 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/22/netdug-unit-testing/</guid>
		<description><![CDATA[So last night I had the opportunity to be the moderator at NetDug, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk [...]]]></description>
			<content:encoded><![CDATA[So last night I had the opportunity to be the moderator at <a href="http://www.netdug.com">NetDug</a>, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk with 20 slides, I think I showed about 5 of them.  I consider that a success (I threatened the audience, the less they talked, the more slides I would show).

<a href="http://elegantcode.com/wp-content/uploads/2008/03/unittestingdemo.zip">Slides and sample code</a>

What I learned from last night:
<ol>
	<li>I'm not much of a moderator (I talk to much)</li>
	<li>Code coverage is a art in divination</li>
	<li>Mock/Stub/Fake Objects are hard to explain</li>
	<li>Over use Mocks could be a code smell</li>
	<li>The discussion format actually works pretty well for talking about unit testing</li>
	<li>If you give geeks a chance to talk, they will talk</li>
</ol>
What I hope everyone else got from the topic:
<ol>
	<li>Unit testing forces you to write better code</li>
	<li>Unit testing forces you to use better object oriented principles</li>
</ol>
<h3>Test Technology</h3>
This was an early question, what technologies to use to test your code.  <a href="http://www.nunit.org/index.php">NUnit</a>, MSUnit, and <a href="http://www.mbunit.com/">MBUnit</a> were all mentioned and viable, and stable, technologies.  For mock objects (which you are going to need) there is <a href="http://www.ayende.com/projects/rhino-mocks/downloads.aspx">Rhino Mocks</a> and <a href="http://www.typemock.com/">TypeMock</a>.  I suggest Rhino Mocks over <a href="http://www.typemock.com/">TypeMock</a> for anyone who can't purchase the full version of <a href="http://www.typemock.com/">TypeMock</a> (but there is a nice free version as well).

Then there are the helper technologies: <a href="http://testdriven.net">TestDriven.Net</a> and <a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> are the main two, but apparently MSUnit's runner isn't bad either (I haven't used it yet).  All of these tools make it easier to run your unit tests from inside Visual Studio, and each has other benefits.  <a href="http://testdriven.net">TestDriven.Net</a> has wonderful Reflector integration (a better object browser), and ReSharper...<a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> is just a must have (that is me talking, not the group).
<h3>Code Coverage</h3>
Code Coverage, using tools like <a href="http://www.ncover.com/">NCover</a> (<a href="http://www.ncover.com/download/discontinued">free version</a>), tell you how much of your code base is tested.  This was one of the early questions.  How much of your code base should be tested?  Answer: it depends on the product.  My view is that a library (no UI element) should have +90% coverage, if there is a substantial amount of UI then the project can get down to 60%.  If your code coverage gets below that you just aren't trying, or you need to rethink your architecture. 

I did talk a bit about code that was not really testable (not in an automated way anyway): UI, Database code, and external resource code are all potentially untestable.  More on this in a moment.

Database code is not testable if you can't return the database to a known state (you can restore the database data). 

UI code testing should be avoided because UI tests have to be so bound to the UI that they are brittle.  So you end up spending a considerable portion of your development time fixing broken test. Brittle tests are to be avoided whenever possible.
<h3>Testing existing code</h3>
Probably the hardest question to answer from last night was: how do you test existing code bases.  And that came up over and over.  Do you start with integration tests and then work in unit tests, or the other way around. 

I will admit, most of the time when I talk about unit testing, I center it around new projects.  Unit test is hard enough with new code, testing old code that wasn't written with unit test in mind is a migraine waiting to happen.

The audience did have some good advice though.  Pick parts of the project that you need to work on (say one class) and make that testable and tested.  Essentially you start creating silos of tested code.  The other suggestion (and I actually had a slide for this) was to get the book: <a href="http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206114497&amp;sr=8-1">Working Effectively with Legacy Code</a>.  Finally, buy TypeMock -- the big boy version, not the free-be version.  You'll need it.
<h3>UI Testing</h3>
This is my treatise on writing unit tests for the User Interface:

1. Don't do it until you are done with the UI.
2. Only test that the UI works in a basic sense.
3. You still have to test the UI by hand.

If you start writing UI tests while you are developing the UI, you will continually break the tests.  Writing the test by hand is none trivial, and using tools to write them is also error prone.  Finally, these tests can't tell you if the UI is just bad.  Only exposure can tell you that.  Every developer should be forced to have to use their UI repeatedly so they know where is sucks.  You wont get that with automated UI tests.

That said, there are tools to help you test web user interfaces. <a href="http://watin.sourceforge.net/">Watin</a>, <a href="http://wtr.rubyforge.org/">Watir</a>, and <a href="http://selenium.openqa.org/">Selenium</a> are all there to help.  We shall see if Team Systems adds anything to help with this (I'm hoping it does).
<h3>Testing Database code</h3>
This is essentially, testing code that touches the database.  Could be your <a href="http://www.hibernate.org/343.html">NHibernate</a> code, could be a stored procedure, could be ADO.Net code.  But really, this is just code that must touch an outside resource (database, file system, serial connection, etc) and there is no way, or point, to abstract it out any further.

The main point here was to have a way to get the data back to a known state.  Without that everything else gets much harder.

We also came up with a new term: SQL Ejaculation.  That is a pattern smell where an excessive amount of your HTML comes from you SQL database.  Like the entire site.  All of the HTML.  And you have stored procedures that simply build the HTML -- in a 10,000 line stored procedure.  That is SQL Ejaculation.

Note: if this comes up in a Google search I might get worried.
<h3></h3>
<h3>After the meeting</h3>
We all went to Table Rock for a beer.  'nuf said, it is a great group.

Finally, to the guy who asked me a question after the meeting was over: I'm sorry, I just haven't had to draw multiple, overlapping, transparent images on a win form using GDI.Net in a really long time.  I know it involves alpha-transparency values, but I haven't done that in years.  Maybe you should look at WPF.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/22/netdug-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be Careful of Your Passion</title>
		<link>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=be-careful-of-your-passion</link>
		<comments>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 14:37:04 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Architecture and Design]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/02/27/be-careful-of-your-passion/</guid>
		<description><![CDATA[Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." Most of us got into this business because we liked making computers do things we [...]]]></description>
			<content:encoded><![CDATA[<p>Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." </p> <p>Most of us got into this business because we liked making computers do things we think of as cool. The most successful among us still get that rush when our new creation spools up and runs.</p> <p>Tinkerers like us tend to gold plate the pieces of our systems we find most interesting. This is why developers will often find themselves the go-to-guy for certain specialities. A dev likes making services, she makes good ones because it's fun, she gets to make more of them. Sounds perfectly reasonable and symbiotic, no?</p> <p>It can be.</p> <h2>Ignoring the Boring</h2> <p>When we get to focus exclusively on the parts of the system that really flip our bits, it can come at a price. Although we might be jazzed about services, that data model still needs our attention. It is fairly common to focus on that thing that really gets us excited and forget (or outright ignore) that part which seems boring. Just because you think someone else will come along and sweep up after doesn't make it happen. </p> <p>The most common instance of "Ignoring the Boring" is documentation. Let's face it, we want to write in languages other than English, right? Documentation is in the elegance of my self-describing code, right? Not so much. Whether we like it or not, documentation is often a deliverable of our system and as such deserves the respect we might give to our WSDL or interface definitions. Just because the reader is a human rather than a machine doesn't mean we should short change her because it's boring to do the work.</p> <h2>Smells of Sub-Optimizing</h2> <p>It is easy to see this kind of monocular behavior can result in a really clean UI with a messy back end, or visa versa. Whatever gets the short end of the stick will tend to show up in the system as a glaring deficit. We can then measure the deficit in the ignored sub-component in observable ways. Some failures of attention to detail might include:</p> <ul> <li>Lack of enforced constraints or relationships in database tables  <li>Code in the view, because it's just this one little thing  <li>Leaky abstractions, because wrapping that data model in business logic can be a real PITA  <li>No check in notes  <li>Not taking the time to do code reviews, even informally</li></ul> <h2>The System Isn't Your Playground</h2> <p>On the other end of the spectrum, what happens when we get to play with the things that <em>are</em> fun? The results can depend on what the implementer really enjoys.</p> <p>One recent real world story I heard told of a hardware engineer who designed 7 different chips within a device, each with a fundamentally different way of representing logic circuits. The chip engineer had a great time applying all the different techniques he read about in last month's <em>Nerd Fest Quarterly</em>, but the team assigned to test this Franken-board was rightly annoyed.</p> <p>Another symptom of playground development is needless abstraction layers or design patterns applied to simple problems. If a system is implemented with a gazillion abstraction layers where only a concrete implementation will do, you can bet someone is reading the <em>Gang of Four</em> in bed at night.</p> <p>If your passion is trying new tools and technologies, how many of these shiny new toys are incorporated into your system without deliberate attention? How many logging libraries does one team really need? How many unit test frameworks?</p> <p><a href="http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It" target="_blank">YAGNI</a>, 'nuff said.</p> <h2>Keep Your Passion Alive</h2> <p>So, what are you saying, Starr? Stop trying to extract pleasure from my work? Just bang the keys and give my 40 to the man? Of course not!</p> <p>I am simply asserting that there is a degree of professionalism needed at all levels. Let's care about the system as a whole and be good stewards to the craft, not just the shiny bits. And, yes, documentation is a justifiable deliverable. Cowboy up.</p> <p>Learn new techniques that fire you up and apply them wisely, not with wild abandon. Delayed gratification means not always getting to use WPF to make a draw a button, or SilverLight to make a logo spin (&lt;-- bad example). Sometimes this means capitulating to use the prescribed framework so we can get a systemic optimization instead of trying to roll our own multi-tenant web portal, yet again.</p> <p>Having more tools in our toolbox is a great thing. This is the essence of youthful fun in our work. Knowing when to use those shiny new tools is the wisdom part. Now go learn something new.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Confessions of a bad web developer</title>
		<link>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=confessions-of-a-bad-web-developer</link>
		<comments>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 03:57:55 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/</guid>
		<description><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately. Not a lot, just enough to get acquainted for right now. Yesterday I had my "Road to Damascus" incident. I don't know HTML. OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them [...]]]></description>
			<content:encoded><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately.  Not a lot, just enough to get acquainted for right now.  Yesterday I had my "Road to Damascus" incident.  I don't know HTML.

OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them without looking things up.  More importantly, I know a ton of asp.net controls.  What I don't know, specifically, is how they all work.

Like the form tag.  I know every Asp.Net page I have ever made has had one of them (and only one, at least as of .Net 1.1 that is all you were allowed).  But I don't remember how to use it any more.  How to read data from it, pass values from one page to the next.  I used to, did it a few times in fact.  Then came Asp.Net, and I haven't looked back.

Have I written JavaScript during this time?  Sort of.  If you count copying code from Google (and testing it of course).  Over the years I have large blocks of Googled JavaScript code in existing projects that I've move from page to page.  Cut-and-paste is a type of reuse...right?  And lately, when my JavaScript requirements have not been Google-able, <a href="http://jquery.com">JQuery</a> has become my savior (more posts on that soon).  But I haven't written a JavaScript object, Prototype, or any such tomfoolery since Netscape 4.8.

And just to clarify.  I once wrote my own tree control in JavaScript.  Or, I wrote one for Netscape 4.04, 4.08, 4.5, 4.75, 4.8, and IE.  I never thought I could hate a language until Netscape.  Netscape killed any love of JavaScript for me.

But now with Ajax on the scene I can't do without it anymore.  And as cool as the Asp.Net Ajax Library is and all of the things that the control toolkit can do for you: without a bit of JavaScript muscle, it just isn't going to work for you.  Take a look at the Google Maps API and tell me you aren't thinking of things that could be done with it.  But it ain't going no where without some JavaScript know-how.

CSS I have come to terms with.  I know the difference between .tag and #tag.  I've written a hover or two.  But there are still unknowns there as well.  I still visit <a href="http://w3schools.com/css">w3schools</a> regularly, and spend way too much time with <a href="http://www.getfirebug.com">FireBug</a> and <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a>.  And <a href="http://csszengarden.com">CssZenGarden</a> -- that is just beyond me right now.

But even in Asp.Net.  <a href="http://www.xefteri.com/articles/show.cfm?id=18">How does a post back work?</a> How is it that a button click is hooked up to an event handler? I'm a firm believer that their is no "magic" in programming.  Post back is magic to me.   Maybe once years ago I knew, but not anymore.

But things like: if you have a table, and every row has a check box on it, on the server side, how do you know which check box is which?  Heck, how do I figure that out on the client side with JavaScript?  The magic is ViewState, I know.  But...

That really is the beauty of WebForms.  It provides a nice insulating coat that insulates you from all of the goo that is html and JavaScript.  ViewState is my friend.  But what does this have to do with Asp.Net MVC?  Absolutely everything.

Asp.Net is a stripped down version of web development with .Net.  ViewState: gone.  asp:Button: hope you are familiar with submit.  The cozy jacket is gone and has been replaced with a wind breaker.  All those old techniques that we threw away with our last ASP page needs to be resurrected.

Being how I already live in a cold climate, I know that the biggest part of working in cold weather is to acclimated to the temperature.  Part of it as well, is knowing that you have to work in the cold climate.  So this isn't time to put things off.  Spring is still a ways off.  So, for Asp.Net WebForms developers, that means re-familiarizing yourself with a few technologies that we all thought we didn't need to know that well:
<ul>
	<li>XHML</li>
	<li>CSS</li>
	<li>JavaScript</li>
	<li>JSON</li>
	<li>JQuery</li>
	<li>Asp.Net Ajax framework</li>
</ul>
I'm not going to specify particular books.  I don't have time for that, and you can search Amazon as well as I can.  Actually, I bought a couple of these books for  at Hastings near my house.  Worth every cent.

Also worth noting what is not on my list: XML.  The language we thought was the lingua franca of the web.  I've had enough XML, and the Asp.Net Ajax library talks via JSON (which is much smaller).   So XML is out for me.  And that is fine, I think, there is enough to learn as is.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom IV</title>
		<link>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iv</link>
		<comments>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 04:48:42 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins. Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. [...]]]></description>
			<content:encoded><![CDATA[<p>If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a href="http://elegantcode.com/?p=646" target="_blank">here</a>.</p> <ol> <li>Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins.  <li>Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. .Net, as an example.  <li>If metrics are prescribed to a team, explain how they will be used. Metrics cause fear, mitigate that fear.  <li>You can prescribe Agility, but not hyper-performance.  <li>Part of the maturation process of Agile is the tendency for people to over-analyze the holy heck out of it. This is relly a reaction to the cost of software development and the incredible amounts of historical waste in the industry.  <li>CEOs do not care about code coverage. Speak to them appropriately about quality.  <li>Earned value reporting is ridiculous.  <li>"Don't wait until the customer is screaming to optimize for performance." <em>-- Thanks, Kevin</em>.  <li>Deliver less, but sooner and more often. <li>"Daddy, is that your new <a href="http://en.wikipedia.org/wiki/Out-Of-Box_Experience" target="_blank">OOBE</a>?" - My kid when I opened my new MacBook. "Yes, it is, son. Yes, it is."</li></ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom III</title>
		<link>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iii</link>
		<comments>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 04:14:20 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=664</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Carry a model at all times to express your understanding to others. Look for patterns in all systems at all levels. Seeing them is the very essence of insight. At the application level, architecture and design are synonymous. "BizTalk is overkill" [...]]]></description>
			<content:encoded><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a target="_blank" href="http://elegantcode.com/?p=646">here</a>.
<ol>
	<li>Carry a model at all times to express your understanding to others.</li>
	<li>Look for patterns in all systems at all levels. Seeing them is the very essence of insight.</li>
	<li>At the application level, architecture and design are synonymous.</li>
	<li>"BizTalk is overkill" is a typically overheard comment of <em>Drive by Architecture</em>.</li>
	<li>Developers would never prescribe BizTalk or a TIBCO or any other message bus system. That type of decision is typical of a CTO or someone who reports directly to one. These are strategic decisions.
"I think that, generally, if you're looking at something like BizTalk, you're probably looking at somebody, a directory port of a CIO or a CTO, I would say." -- Roger Session</li>
	<li>"Anything that is architecture and is specific to a particular technology is kind of an oxymoron." -- Roger Sessions</li>
	<li>Good design allows for emergent functionality, which we can also think of as purposeful evolution.</li>
	<li>The Open/Close principle doesn't mean you can't recompile. -- Allan Shalloway</li>
	<li>Fewer keystrokes != Elegant Code. Damn it! -- Dave Starr :)</li>
	<li>Architectural decisions are those that will kill your business if they are wrong.</li>
	<li>To introduce a new technology into a system, have the entire team immerse in an architectural spike, then estimate.</li>
	<li>Schedule riskiest work first. Try prioritizing a backlog by risk.</li>
	<li>The work of a developer is to uncover complexity, the work of an architect is to simplify it.</li>
	<li>A legacy system is one that is already making money.</li>
	<li>“The <a href="http://en.wikipedia.org/wiki/Winchester_Mystery_House">Winchester House</a> in San Jose is the perfect example of following a vision without a plan.”</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Ways to Stop Context Switching</title>
		<link>http://elegantcode.com/2008/03/22/netdug-unit-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=netdug-unit-testing</link>
		<comments>http://elegantcode.com/2008/03/22/netdug-unit-testing/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 21:00:30 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/22/netdug-unit-testing/</guid>
		<description><![CDATA[So last night I had the opportunity to be the moderator at NetDug, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk [...]]]></description>
			<content:encoded><![CDATA[So last night I had the opportunity to be the moderator at <a href="http://www.netdug.com">NetDug</a>, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk with 20 slides, I think I showed about 5 of them.  I consider that a success (I threatened the audience, the less they talked, the more slides I would show).

<a href="http://elegantcode.com/wp-content/uploads/2008/03/unittestingdemo.zip">Slides and sample code</a>

What I learned from last night:
<ol>
	<li>I'm not much of a moderator (I talk to much)</li>
	<li>Code coverage is a art in divination</li>
	<li>Mock/Stub/Fake Objects are hard to explain</li>
	<li>Over use Mocks could be a code smell</li>
	<li>The discussion format actually works pretty well for talking about unit testing</li>
	<li>If you give geeks a chance to talk, they will talk</li>
</ol>
What I hope everyone else got from the topic:
<ol>
	<li>Unit testing forces you to write better code</li>
	<li>Unit testing forces you to use better object oriented principles</li>
</ol>
<h3>Test Technology</h3>
This was an early question, what technologies to use to test your code.  <a href="http://www.nunit.org/index.php">NUnit</a>, MSUnit, and <a href="http://www.mbunit.com/">MBUnit</a> were all mentioned and viable, and stable, technologies.  For mock objects (which you are going to need) there is <a href="http://www.ayende.com/projects/rhino-mocks/downloads.aspx">Rhino Mocks</a> and <a href="http://www.typemock.com/">TypeMock</a>.  I suggest Rhino Mocks over <a href="http://www.typemock.com/">TypeMock</a> for anyone who can't purchase the full version of <a href="http://www.typemock.com/">TypeMock</a> (but there is a nice free version as well).

Then there are the helper technologies: <a href="http://testdriven.net">TestDriven.Net</a> and <a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> are the main two, but apparently MSUnit's runner isn't bad either (I haven't used it yet).  All of these tools make it easier to run your unit tests from inside Visual Studio, and each has other benefits.  <a href="http://testdriven.net">TestDriven.Net</a> has wonderful Reflector integration (a better object browser), and ReSharper...<a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> is just a must have (that is me talking, not the group).
<h3>Code Coverage</h3>
Code Coverage, using tools like <a href="http://www.ncover.com/">NCover</a> (<a href="http://www.ncover.com/download/discontinued">free version</a>), tell you how much of your code base is tested.  This was one of the early questions.  How much of your code base should be tested?  Answer: it depends on the product.  My view is that a library (no UI element) should have +90% coverage, if there is a substantial amount of UI then the project can get down to 60%.  If your code coverage gets below that you just aren't trying, or you need to rethink your architecture. 

I did talk a bit about code that was not really testable (not in an automated way anyway): UI, Database code, and external resource code are all potentially untestable.  More on this in a moment.

Database code is not testable if you can't return the database to a known state (you can restore the database data). 

UI code testing should be avoided because UI tests have to be so bound to the UI that they are brittle.  So you end up spending a considerable portion of your development time fixing broken test. Brittle tests are to be avoided whenever possible.
<h3>Testing existing code</h3>
Probably the hardest question to answer from last night was: how do you test existing code bases.  And that came up over and over.  Do you start with integration tests and then work in unit tests, or the other way around. 

I will admit, most of the time when I talk about unit testing, I center it around new projects.  Unit test is hard enough with new code, testing old code that wasn't written with unit test in mind is a migraine waiting to happen.

The audience did have some good advice though.  Pick parts of the project that you need to work on (say one class) and make that testable and tested.  Essentially you start creating silos of tested code.  The other suggestion (and I actually had a slide for this) was to get the book: <a href="http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206114497&amp;sr=8-1">Working Effectively with Legacy Code</a>.  Finally, buy TypeMock -- the big boy version, not the free-be version.  You'll need it.
<h3>UI Testing</h3>
This is my treatise on writing unit tests for the User Interface:

1. Don't do it until you are done with the UI.
2. Only test that the UI works in a basic sense.
3. You still have to test the UI by hand.

If you start writing UI tests while you are developing the UI, you will continually break the tests.  Writing the test by hand is none trivial, and using tools to write them is also error prone.  Finally, these tests can't tell you if the UI is just bad.  Only exposure can tell you that.  Every developer should be forced to have to use their UI repeatedly so they know where is sucks.  You wont get that with automated UI tests.

That said, there are tools to help you test web user interfaces. <a href="http://watin.sourceforge.net/">Watin</a>, <a href="http://wtr.rubyforge.org/">Watir</a>, and <a href="http://selenium.openqa.org/">Selenium</a> are all there to help.  We shall see if Team Systems adds anything to help with this (I'm hoping it does).
<h3>Testing Database code</h3>
This is essentially, testing code that touches the database.  Could be your <a href="http://www.hibernate.org/343.html">NHibernate</a> code, could be a stored procedure, could be ADO.Net code.  But really, this is just code that must touch an outside resource (database, file system, serial connection, etc) and there is no way, or point, to abstract it out any further.

The main point here was to have a way to get the data back to a known state.  Without that everything else gets much harder.

We also came up with a new term: SQL Ejaculation.  That is a pattern smell where an excessive amount of your HTML comes from you SQL database.  Like the entire site.  All of the HTML.  And you have stored procedures that simply build the HTML -- in a 10,000 line stored procedure.  That is SQL Ejaculation.

Note: if this comes up in a Google search I might get worried.
<h3></h3>
<h3>After the meeting</h3>
We all went to Table Rock for a beer.  'nuf said, it is a great group.

Finally, to the guy who asked me a question after the meeting was over: I'm sorry, I just haven't had to draw multiple, overlapping, transparent images on a win form using GDI.Net in a really long time.  I know it involves alpha-transparency values, but I haven't done that in years.  Maybe you should look at WPF.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/22/netdug-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Elegant Code &#187; Widgets of Wisdom</title>
	<atom:link href="http://elegantcode.com/tag/widgets-of-wisdom/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 10:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Your First Developer Job</title>
		<link>http://elegantcode.com/2008/05/06/your-first-developer-job/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=your-first-developer-job</link>
		<comments>http://elegantcode.com/2008/05/06/your-first-developer-job/#comments</comments>
		<pubDate>Wed, 07 May 2008 04:45:09 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/05/06/your-first-developer-job/</guid>
		<description><![CDATA[I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see [...]]]></description>
			<content:encoded><![CDATA[<p>I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see them learn about the aspects of real life we face in developing solutions for clients. My favorite quote of the whole semester was, &quot;I don't think the client even knows what they want. I don't get it. Why are we even here?&quot; Awesome, no? Doesn't that just sum it all up? The beautiful thing about this is how the students were surprised when this happened. But I digress...</p>  <p>As we were wrapping up the last night I received what seemed like an innocent enough question from one of the students. &quot;What kind of job do you think I should look for?&quot;</p>  <p>It really caught me off guard, although I should have seen it coming. I didn't have a good answer on the tip of my tongue, and that may be because there isn't one. The CIS program is not designed specifically to churn out developers, but introduces students to all sorts of disciplines so they can pick a specialty later. For example thy study project management, requirements analysis, some programming, some networking, you get the idea. So the question really was bigger than it seemed. </p>  <p>Let's assume for this post that the person in question wanted to be a developer. Even if the person is looking to become a developer, the question what kind of employer to seek out isn't an easy one.</p>  <p>My father has worked 45 years as a mechanic for 2 employers. He is happy doing that. Many people, in fact most, are content with an occupation just like that. There is nothing in the world wrong with this; the world turns, people still live and love, people die, babies are born, all without making a life out of their career. Other people don't see things that way. They are passionate about their work and want to contribute to a higher vision of their chosen profession. I would guess if you are reading this, you see yourself in a similar light.</p>  <p>Someone develops code for the state government agencies. In fact, I have met many competent people who do exactly that. Are those developers missing out on something? Probably not in their mind, or they wouldn't be there. The point is simply that for some people a job is a job and there is no dishonor there.</p>  <p>This means my answer can't be glib, it must be realistic. You can't just say, &quot;Go somewhere Agile,&quot; or, &quot;Find a place where you can write Ruby.&quot; This is real life and sometimes grown ups balance security and risk and boredom and excitement because they have kids at home, or need special medical accommodation, or any one of a host of other considerations.</p>  <p>All that said, if you are passionate about the craft, if you want to drink in the industry, if you do want to learn as much as you can as soon as you can, I say this: Go work for a company with fewer than 50 employees building web solutions. </p>  <h2>Locus of Control</h2>  <p>As a company grows larger, the <a href="http://en.wikipedia.org/wiki/Locus_of_control" target="_blank">locus of control</a> individuals have inside the organization grows smaller. This is easy to see. </p>  <p>In smaller organizations, people tend to be jacks of all trades. If a server goes down, you care. If a defect is found, you care. If there is a client in the picture, you tend to actually know them. In short, small organizations provide first hand experience with many aspects of developing and delivering products. </p>  <p>In larger companies and teams, people tend to be expected to focus on a small niche of expertise. I cannot begin to tell you the number of resumes I have seen from people who spent years poking at HP's test harness suite or Micron's order entry system. This kind of &quot;specialization&quot; is not usually a recipe for career growth.</p>  <h2>Technology Exposure</h2>  <p>You'll get to go deep on technology because you are part of a small group that simply must make it work. There is no passing the buck, because there is no one to pass it to. You'll get to know whatever the technology stack is inside and out.</p>  <p>I recommend web development for a simple reason, the web isn't going away! Additionally, the technology involved in delivering to the web is growing at an astounding pace. I don't know what the web will evolve to&#160; in years to come, but it will be on hulluva ride.</p>  <h2>Comradery and Mentorship</h2>  <p>In a small organization, it is easier to foster a genuine sense that we are all in this together. The esprit de' corp in a smaller organization is typically tighter than in large organizations. This means you stand a better chance of falling in with someone who can actually mentor your career and take a genuine interest in your development.</p>  <p>Of course this exists in larger companies and is lacking in many smaller ones. I do think it is more generally found in smaller organizations, though.</p>  <h2>Conclusion</h2>  <p>So, what's the right answer? There isn't one, of course. There are just too many options and factors.</p>  <p>I will say that instead of ensuring your potential employer can pass <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" target="_blank">Spolsky's Joel Test</a>, it is more important to ensure you will be empowered to help them pass it if you come aboard.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/05/06/your-first-developer-job/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Many Uses of Relative Estimation</title>
		<link>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-many-uses-of-relative-estimation</link>
		<comments>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 21:57:16 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/</guid>
		<description><![CDATA[Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety. Have you ever looked at the website HotOrNot.com? It turns out that pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety.</p>  <p>Have you ever looked at the website <a href="http://www.hotornot.com/" target="_blank">HotOrNot.com</a>? It turns out that pretty much everyone from Quazzi Modo to Angelina Jolie ranks from a 4 to a 7. This is a prime example of our poor ability to estimate on a closely related value scale. It is pretty tough to tell if something is a 2 or a 3, but it is pretty easy to see the difference in size between a 5 and a 13. 13 is more than twice as big as 5, right?</p>  <p>Think about it this way: Does it really matter if something is going to take 3 hours or six hours? In software development, it typically doesn&#8217;t matter.</p>  <p>So the relative estimation model looks like this, in pursuing an estimate for piece of work A: </p>  <ol>   <li>Is this piece of work bigger or smaller than that piece of work B that we already did? </li>    <li>Bigger? OK, how much bigger? 2X bigger? 3X? </li>    <li>OK, 4X bigger. </li>    <li>Here is piece of work C that we already did. It was estimated at 4X bigger than B. Is it roughly the same size as A? </li>    <li>Yes. </li>    <li>Cool, we are done. </li> </ol>  <p>Once we understand that we can trust these relative comparisons because we are better at them than empirical estimation, it becomes much easier to size our work. Look at things you've already done and estimate the new one in relation to the previous work. We get our relative size and convert it into time, dollars, or whatever the project managers need and we are done. This is a much faster (and accurate) thing to do than to break it down into tasks and estimate each task. Why? Because we will never get the tasking right.</p>  <p>There is a ton more that could be said (and has) on relative estimation, but remember this: The next time you have to estimate a project for your manager, make it easier on yourself by doing a relative size first. You'll get back to coding much faster and you'll find the numbers are amazingly accurate.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Opposite of a Singleton?</title>
		<link>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-opposite-of-a-singleton</link>
		<comments>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 03:42:22 +0000</pubDate>
		<dc:creator>Alex Mueller</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/</guid>
		<description><![CDATA[I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to [...]]]></description>
			<content:encoded><![CDATA[<p>I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to the inverse object as a &quot;new object.&quot; As I pondered this later in the day, I considered adjectives describing the nature of objects. They can be many things, but two concepts that popped into my head to classify them were &quot;complex&quot; and &quot;simple.&quot; </p>  <p>I started playing with the words and making them resemble singleton. &quot;Complexton&quot; did not sound right to me. I should mention that I was washing my hands as I was contemplating this. I lifted up my head, looked into the mirror, and thought, &quot;SIMPLETON.&quot; The opposite of a singleton is a &quot;simpleton.&quot;</p>  <p>If the opposite of a singleton is not a &quot;simpleton,&quot; then what is it? Until I find a plausible answer, I will try and insert this new term into my next design discussion. </p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What is Elegant Code to me?</title>
		<link>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-is-elegant-code-to-me</link>
		<comments>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 03:47:45 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/</guid>
		<description><![CDATA[This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&#160; It isn't easy to describe.&#160; And really, the notion of what constitutes elegance in code changes over time.&#160; There is no static "this is good code" test, and I doubt there ever will be.&#160; Plus, [...]]]></description>
			<content:encoded><![CDATA[<p>This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&nbsp; It isn't easy to describe.&nbsp; And really, the notion of what constitutes elegance in code changes over time.&nbsp; There is no static "this is good code" test, and I doubt there ever will be.&nbsp; Plus, what makes good code in one language, may not apply to the next.</p> <p>So let me state for the record: today's elegant code is tomorrow's drivel.&nbsp; Don't feel bad, many writers have the same problems.&nbsp; What was super amazing back in the day is now rubbish or near unreadable.&nbsp; I am thinking of the Victorian writing that Hemingway usurped, and now Hemingway himself is almost unreadable (to me anyway).&nbsp; Tastes change with the times.&nbsp; That is a simple fact.</p> <p>So what can you do about this?&nbsp; As I say that old writing sucks to read (read Washington Irvine lately?), great works of literature still abound (for instance, Hemingway is still a great writer -- even if I prefer Tolkien) .&nbsp; So take some notes from them, and from other crafts in looking for the answer.&nbsp; If you want a cliff notes version of what this is going to tell you, it is this: you must always push yourself to get better.</p> <ol> <li>Find a good teacher.&nbsp; Nothing is better than sitting at the feet of a master who can nudge you along in the right direction.&nbsp; While early mistakes can often be corrected easily with a little bit of guidance, after they have had some time to fester all bets are off.&nbsp; I believe a fare number of "Anit-patterns" were created by self taught developers (find <a href="http://elegantcode.com/2008/03/21/sql-ejaculation/">SQL Ejaculation</a> on this site).&nbsp; <li>Read.&nbsp;&nbsp; Good writer are first good readers.&nbsp; Start with Code Complete, move into a good Patterns book, get MSDN Magazine, find some bloggers your like, but keep moving.&nbsp; You will NEVER be done reading.&nbsp; I imagine that even Martin Fowler has a "to read" booklist a mile long.  <li>Read code.&nbsp;&nbsp; There are a plethora of open source project just waiting to be read -- do so.&nbsp; This is the single best way to expand your coding repertoire, find things your language can do that you didn't even know about..&nbsp;&nbsp; Scott Hanselman has recently popularized this idea, and I thank him for it.  <li>Practice.&nbsp; This means writing small applications at home.&nbsp; You get an idea that you want to try out -- do it.&nbsp; I don't mean you have to write finished applications, just have some exploring time.&nbsp; I remember talking with an 80 year old master woodworker (he lives down the street from me), who was telling me how many time he would practice making dovetail joints before he felt competent.&nbsp; It was years worth.  <li>Pay Attention.&nbsp; Being good at anything really amounts to that.&nbsp; And don't just pay attention when reading, writing, or talking about code.&nbsp; Inspiration come from everywhere, any good artist will tell you that.&nbsp; Pay attention when you cook, when you work on the car, when you are wood working, playing an instrument, whatever it is that you do.&nbsp; This will help you in the end, event if it is just learning the amount of dedication it really takes to become good at something.  <li>Beware of preferences.&nbsp; Any time I hear someone start a statement with "I prefer code to ..." you know things are going downhill.&nbsp; If you find someone who cares more about how your code is formatted then how it is written you have found yourself in a mess.&nbsp; More importantly, beware of them in yourself.&nbsp;&nbsp; Having code style standard is important, but it isn't worth loosing sleep over.&nbsp; This also pertains to inheritance, patterns, use of particular classes (e.g. always using the generic list class in C# when a Dictionary would be better).&nbsp; <li>No Sacred Cows. Believe no single source of information.&nbsp; This means not thinking that Microsoft, Sun, IBM, Richard Stallman, or anyone else will have all of the correct answers.&nbsp; Apply the scientific method and do some research, experiment, and question the authority.&nbsp;&nbsp; There should be no sacred cows in programming.  <li>Talk with others.&nbsp; Join a user group, show up every now and then, heckle the presenter, and -maybe- speak.&nbsp; You want a broad range of people who you can talk to and bounce ideas off of.&nbsp; This will help you from becoming that crazy guy in the corner who vehemently states that all your code should be in one file.&nbsp; Having a mentor (mentioned earlier) is great, but having people around to push you from multiple directions is also good.  <li>Learn languages.&nbsp; This gets back to the "read code" idea. Make that multiple types of languages as well.&nbsp; If you know C# or Java and SQL, learn Python or Ruby, get really good at JavaScript.&nbsp; If you want something really out there, learn MDX.&nbsp; This is also a repertoire thing.&nbsp; Seeing how other languages work will make you rethink your ideas about what your current code, in whatever languages you are working in, should look like.  <li>Keep Thinking!!!&nbsp; That is possibly the most important point.&nbsp; Keep thinking.&nbsp; Don't just evaluate something once and never return, go back and reevaluate. Did the technique work?&nbsp; How could it have been better?&nbsp;&nbsp; The idea is continual improvement.  <li>Switch jobs every now and then.&nbsp; When I announced I was leaving my first programming job out of college, the VP of R&amp;D had me sit down with him and talk.&nbsp; He wasn't trying to keep me (he knew I was moving to be closer to family), he wanted to give me some advice.&nbsp; He told me to change jobs every three years.&nbsp; After you have been with a place for three years you have probably learned everything you are going to learn and it time to move on.&nbsp; This doesn't mean changing companies either.&nbsp; I've been with the same company now for four years, but I've had three different jobs.&nbsp; If you have been writing commercial applications, become a consultant - or vise-versa, become a test engineer, expand your boundaries.&nbsp; Again, this is about pushing yourself to be better.  <li>Have a Hobby. But don't ask about me, I have too many.&nbsp;&nbsp; Creating software is about creating things.&nbsp; So I suggest picking a hobby that involves creating something.&nbsp; Popular hobbies amongst programmers I know include: cooking, music, woodworking, beer making, and BBQ (which is different than cooking).&nbsp; But don't discount sports (golf is always popular), computer games, and board games.&nbsp; Anything that promotes the development of skill levels can't be a bad thing. </li></ol> <p>And I'm stopping there.&nbsp; This is my beginner's guide to how to become the writer elegant code.&nbsp; If you have others you think I missed, add them too the comments.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NetDug Unit Testing</title>
		<link>http://elegantcode.com/2008/03/22/netdug-unit-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=netdug-unit-testing</link>
		<comments>http://elegantcode.com/2008/03/22/netdug-unit-testing/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 21:00:30 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/22/netdug-unit-testing/</guid>
		<description><![CDATA[So last night I had the opportunity to be the moderator at NetDug, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk [...]]]></description>
			<content:encoded><![CDATA[So last night I had the opportunity to be the moderator at <a href="http://www.netdug.com">NetDug</a>, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk with 20 slides, I think I showed about 5 of them.  I consider that a success (I threatened the audience, the less they talked, the more slides I would show).

<a href="http://elegantcode.com/wp-content/uploads/2008/03/unittestingdemo.zip">Slides and sample code</a>

What I learned from last night:
<ol>
	<li>I'm not much of a moderator (I talk to much)</li>
	<li>Code coverage is a art in divination</li>
	<li>Mock/Stub/Fake Objects are hard to explain</li>
	<li>Over use Mocks could be a code smell</li>
	<li>The discussion format actually works pretty well for talking about unit testing</li>
	<li>If you give geeks a chance to talk, they will talk</li>
</ol>
What I hope everyone else got from the topic:
<ol>
	<li>Unit testing forces you to write better code</li>
	<li>Unit testing forces you to use better object oriented principles</li>
</ol>
<h3>Test Technology</h3>
This was an early question, what technologies to use to test your code.  <a href="http://www.nunit.org/index.php">NUnit</a>, MSUnit, and <a href="http://www.mbunit.com/">MBUnit</a> were all mentioned and viable, and stable, technologies.  For mock objects (which you are going to need) there is <a href="http://www.ayende.com/projects/rhino-mocks/downloads.aspx">Rhino Mocks</a> and <a href="http://www.typemock.com/">TypeMock</a>.  I suggest Rhino Mocks over <a href="http://www.typemock.com/">TypeMock</a> for anyone who can't purchase the full version of <a href="http://www.typemock.com/">TypeMock</a> (but there is a nice free version as well).

Then there are the helper technologies: <a href="http://testdriven.net">TestDriven.Net</a> and <a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> are the main two, but apparently MSUnit's runner isn't bad either (I haven't used it yet).  All of these tools make it easier to run your unit tests from inside Visual Studio, and each has other benefits.  <a href="http://testdriven.net">TestDriven.Net</a> has wonderful Reflector integration (a better object browser), and ReSharper...<a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> is just a must have (that is me talking, not the group).
<h3>Code Coverage</h3>
Code Coverage, using tools like <a href="http://www.ncover.com/">NCover</a> (<a href="http://www.ncover.com/download/discontinued">free version</a>), tell you how much of your code base is tested.  This was one of the early questions.  How much of your code base should be tested?  Answer: it depends on the product.  My view is that a library (no UI element) should have +90% coverage, if there is a substantial amount of UI then the project can get down to 60%.  If your code coverage gets below that you just aren't trying, or you need to rethink your architecture. 

I did talk a bit about code that was not really testable (not in an automated way anyway): UI, Database code, and external resource code are all potentially untestable.  More on this in a moment.

Database code is not testable if you can't return the database to a known state (you can restore the database data). 

UI code testing should be avoided because UI tests have to be so bound to the UI that they are brittle.  So you end up spending a considerable portion of your development time fixing broken test. Brittle tests are to be avoided whenever possible.
<h3>Testing existing code</h3>
Probably the hardest question to answer from last night was: how do you test existing code bases.  And that came up over and over.  Do you start with integration tests and then work in unit tests, or the other way around. 

I will admit, most of the time when I talk about unit testing, I center it around new projects.  Unit test is hard enough with new code, testing old code that wasn't written with unit test in mind is a migraine waiting to happen.

The audience did have some good advice though.  Pick parts of the project that you need to work on (say one class) and make that testable and tested.  Essentially you start creating silos of tested code.  The other suggestion (and I actually had a slide for this) was to get the book: <a href="http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206114497&amp;sr=8-1">Working Effectively with Legacy Code</a>.  Finally, buy TypeMock -- the big boy version, not the free-be version.  You'll need it.
<h3>UI Testing</h3>
This is my treatise on writing unit tests for the User Interface:

1. Don't do it until you are done with the UI.
2. Only test that the UI works in a basic sense.
3. You still have to test the UI by hand.

If you start writing UI tests while you are developing the UI, you will continually break the tests.  Writing the test by hand is none trivial, and using tools to write them is also error prone.  Finally, these tests can't tell you if the UI is just bad.  Only exposure can tell you that.  Every developer should be forced to have to use their UI repeatedly so they know where is sucks.  You wont get that with automated UI tests.

That said, there are tools to help you test web user interfaces. <a href="http://watin.sourceforge.net/">Watin</a>, <a href="http://wtr.rubyforge.org/">Watir</a>, and <a href="http://selenium.openqa.org/">Selenium</a> are all there to help.  We shall see if Team Systems adds anything to help with this (I'm hoping it does).
<h3>Testing Database code</h3>
This is essentially, testing code that touches the database.  Could be your <a href="http://www.hibernate.org/343.html">NHibernate</a> code, could be a stored procedure, could be ADO.Net code.  But really, this is just code that must touch an outside resource (database, file system, serial connection, etc) and there is no way, or point, to abstract it out any further.

The main point here was to have a way to get the data back to a known state.  Without that everything else gets much harder.

We also came up with a new term: SQL Ejaculation.  That is a pattern smell where an excessive amount of your HTML comes from you SQL database.  Like the entire site.  All of the HTML.  And you have stored procedures that simply build the HTML -- in a 10,000 line stored procedure.  That is SQL Ejaculation.

Note: if this comes up in a Google search I might get worried.
<h3></h3>
<h3>After the meeting</h3>
We all went to Table Rock for a beer.  'nuf said, it is a great group.

Finally, to the guy who asked me a question after the meeting was over: I'm sorry, I just haven't had to draw multiple, overlapping, transparent images on a win form using GDI.Net in a really long time.  I know it involves alpha-transparency values, but I haven't done that in years.  Maybe you should look at WPF.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/22/netdug-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be Careful of Your Passion</title>
		<link>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=be-careful-of-your-passion</link>
		<comments>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 14:37:04 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Architecture and Design]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/02/27/be-careful-of-your-passion/</guid>
		<description><![CDATA[Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." Most of us got into this business because we liked making computers do things we [...]]]></description>
			<content:encoded><![CDATA[<p>Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." </p> <p>Most of us got into this business because we liked making computers do things we think of as cool. The most successful among us still get that rush when our new creation spools up and runs.</p> <p>Tinkerers like us tend to gold plate the pieces of our systems we find most interesting. This is why developers will often find themselves the go-to-guy for certain specialities. A dev likes making services, she makes good ones because it's fun, she gets to make more of them. Sounds perfectly reasonable and symbiotic, no?</p> <p>It can be.</p> <h2>Ignoring the Boring</h2> <p>When we get to focus exclusively on the parts of the system that really flip our bits, it can come at a price. Although we might be jazzed about services, that data model still needs our attention. It is fairly common to focus on that thing that really gets us excited and forget (or outright ignore) that part which seems boring. Just because you think someone else will come along and sweep up after doesn't make it happen. </p> <p>The most common instance of "Ignoring the Boring" is documentation. Let's face it, we want to write in languages other than English, right? Documentation is in the elegance of my self-describing code, right? Not so much. Whether we like it or not, documentation is often a deliverable of our system and as such deserves the respect we might give to our WSDL or interface definitions. Just because the reader is a human rather than a machine doesn't mean we should short change her because it's boring to do the work.</p> <h2>Smells of Sub-Optimizing</h2> <p>It is easy to see this kind of monocular behavior can result in a really clean UI with a messy back end, or visa versa. Whatever gets the short end of the stick will tend to show up in the system as a glaring deficit. We can then measure the deficit in the ignored sub-component in observable ways. Some failures of attention to detail might include:</p> <ul> <li>Lack of enforced constraints or relationships in database tables  <li>Code in the view, because it's just this one little thing  <li>Leaky abstractions, because wrapping that data model in business logic can be a real PITA  <li>No check in notes  <li>Not taking the time to do code reviews, even informally</li></ul> <h2>The System Isn't Your Playground</h2> <p>On the other end of the spectrum, what happens when we get to play with the things that <em>are</em> fun? The results can depend on what the implementer really enjoys.</p> <p>One recent real world story I heard told of a hardware engineer who designed 7 different chips within a device, each with a fundamentally different way of representing logic circuits. The chip engineer had a great time applying all the different techniques he read about in last month's <em>Nerd Fest Quarterly</em>, but the team assigned to test this Franken-board was rightly annoyed.</p> <p>Another symptom of playground development is needless abstraction layers or design patterns applied to simple problems. If a system is implemented with a gazillion abstraction layers where only a concrete implementation will do, you can bet someone is reading the <em>Gang of Four</em> in bed at night.</p> <p>If your passion is trying new tools and technologies, how many of these shiny new toys are incorporated into your system without deliberate attention? How many logging libraries does one team really need? How many unit test frameworks?</p> <p><a href="http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It" target="_blank">YAGNI</a>, 'nuff said.</p> <h2>Keep Your Passion Alive</h2> <p>So, what are you saying, Starr? Stop trying to extract pleasure from my work? Just bang the keys and give my 40 to the man? Of course not!</p> <p>I am simply asserting that there is a degree of professionalism needed at all levels. Let's care about the system as a whole and be good stewards to the craft, not just the shiny bits. And, yes, documentation is a justifiable deliverable. Cowboy up.</p> <p>Learn new techniques that fire you up and apply them wisely, not with wild abandon. Delayed gratification means not always getting to use WPF to make a draw a button, or SilverLight to make a logo spin (&lt;-- bad example). Sometimes this means capitulating to use the prescribed framework so we can get a systemic optimization instead of trying to roll our own multi-tenant web portal, yet again.</p> <p>Having more tools in our toolbox is a great thing. This is the essence of youthful fun in our work. Knowing when to use those shiny new tools is the wisdom part. Now go learn something new.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Confessions of a bad web developer</title>
		<link>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=confessions-of-a-bad-web-developer</link>
		<comments>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 03:57:55 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/</guid>
		<description><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately. Not a lot, just enough to get acquainted for right now. Yesterday I had my "Road to Damascus" incident. I don't know HTML. OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them [...]]]></description>
			<content:encoded><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately.  Not a lot, just enough to get acquainted for right now.  Yesterday I had my "Road to Damascus" incident.  I don't know HTML.

OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them without looking things up.  More importantly, I know a ton of asp.net controls.  What I don't know, specifically, is how they all work.

Like the form tag.  I know every Asp.Net page I have ever made has had one of them (and only one, at least as of .Net 1.1 that is all you were allowed).  But I don't remember how to use it any more.  How to read data from it, pass values from one page to the next.  I used to, did it a few times in fact.  Then came Asp.Net, and I haven't looked back.

Have I written JavaScript during this time?  Sort of.  If you count copying code from Google (and testing it of course).  Over the years I have large blocks of Googled JavaScript code in existing projects that I've move from page to page.  Cut-and-paste is a type of reuse...right?  And lately, when my JavaScript requirements have not been Google-able, <a href="http://jquery.com">JQuery</a> has become my savior (more posts on that soon).  But I haven't written a JavaScript object, Prototype, or any such tomfoolery since Netscape 4.8.

And just to clarify.  I once wrote my own tree control in JavaScript.  Or, I wrote one for Netscape 4.04, 4.08, 4.5, 4.75, 4.8, and IE.  I never thought I could hate a language until Netscape.  Netscape killed any love of JavaScript for me.

But now with Ajax on the scene I can't do without it anymore.  And as cool as the Asp.Net Ajax Library is and all of the things that the control toolkit can do for you: without a bit of JavaScript muscle, it just isn't going to work for you.  Take a look at the Google Maps API and tell me you aren't thinking of things that could be done with it.  But it ain't going no where without some JavaScript know-how.

CSS I have come to terms with.  I know the difference between .tag and #tag.  I've written a hover or two.  But there are still unknowns there as well.  I still visit <a href="http://w3schools.com/css">w3schools</a> regularly, and spend way too much time with <a href="http://www.getfirebug.com">FireBug</a> and <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a>.  And <a href="http://csszengarden.com">CssZenGarden</a> -- that is just beyond me right now.

But even in Asp.Net.  <a href="http://www.xefteri.com/articles/show.cfm?id=18">How does a post back work?</a> How is it that a button click is hooked up to an event handler? I'm a firm believer that their is no "magic" in programming.  Post back is magic to me.   Maybe once years ago I knew, but not anymore.

But things like: if you have a table, and every row has a check box on it, on the server side, how do you know which check box is which?  Heck, how do I figure that out on the client side with JavaScript?  The magic is ViewState, I know.  But...

That really is the beauty of WebForms.  It provides a nice insulating coat that insulates you from all of the goo that is html and JavaScript.  ViewState is my friend.  But what does this have to do with Asp.Net MVC?  Absolutely everything.

Asp.Net is a stripped down version of web development with .Net.  ViewState: gone.  asp:Button: hope you are familiar with submit.  The cozy jacket is gone and has been replaced with a wind breaker.  All those old techniques that we threw away with our last ASP page needs to be resurrected.

Being how I already live in a cold climate, I know that the biggest part of working in cold weather is to acclimated to the temperature.  Part of it as well, is knowing that you have to work in the cold climate.  So this isn't time to put things off.  Spring is still a ways off.  So, for Asp.Net WebForms developers, that means re-familiarizing yourself with a few technologies that we all thought we didn't need to know that well:
<ul>
	<li>XHML</li>
	<li>CSS</li>
	<li>JavaScript</li>
	<li>JSON</li>
	<li>JQuery</li>
	<li>Asp.Net Ajax framework</li>
</ul>
I'm not going to specify particular books.  I don't have time for that, and you can search Amazon as well as I can.  Actually, I bought a couple of these books for  at Hastings near my house.  Worth every cent.

Also worth noting what is not on my list: XML.  The language we thought was the lingua franca of the web.  I've had enough XML, and the Asp.Net Ajax library talks via JSON (which is much smaller).   So XML is out for me.  And that is fine, I think, there is enough to learn as is.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom IV</title>
		<link>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iv</link>
		<comments>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 04:48:42 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins. Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. [...]]]></description>
			<content:encoded><![CDATA[<p>If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a href="http://elegantcode.com/?p=646" target="_blank">here</a>.</p> <ol> <li>Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins.  <li>Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. .Net, as an example.  <li>If metrics are prescribed to a team, explain how they will be used. Metrics cause fear, mitigate that fear.  <li>You can prescribe Agility, but not hyper-performance.  <li>Part of the maturation process of Agile is the tendency for people to over-analyze the holy heck out of it. This is relly a reaction to the cost of software development and the incredible amounts of historical waste in the industry.  <li>CEOs do not care about code coverage. Speak to them appropriately about quality.  <li>Earned value reporting is ridiculous.  <li>"Don't wait until the customer is screaming to optimize for performance." <em>-- Thanks, Kevin</em>.  <li>Deliver less, but sooner and more often. <li>"Daddy, is that your new <a href="http://en.wikipedia.org/wiki/Out-Of-Box_Experience" target="_blank">OOBE</a>?" - My kid when I opened my new MacBook. "Yes, it is, son. Yes, it is."</li></ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom III</title>
		<link>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iii</link>
		<comments>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 04:14:20 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=664</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Carry a model at all times to express your understanding to others. Look for patterns in all systems at all levels. Seeing them is the very essence of insight. At the application level, architecture and design are synonymous. "BizTalk is overkill" [...]]]></description>
			<content:encoded><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a target="_blank" href="http://elegantcode.com/?p=646">here</a>.
<ol>
	<li>Carry a model at all times to express your understanding to others.</li>
	<li>Look for patterns in all systems at all levels. Seeing them is the very essence of insight.</li>
	<li>At the application level, architecture and design are synonymous.</li>
	<li>"BizTalk is overkill" is a typically overheard comment of <em>Drive by Architecture</em>.</li>
	<li>Developers would never prescribe BizTalk or a TIBCO or any other message bus system. That type of decision is typical of a CTO or someone who reports directly to one. These are strategic decisions.
"I think that, generally, if you're looking at something like BizTalk, you're probably looking at somebody, a directory port of a CIO or a CTO, I would say." -- Roger Session</li>
	<li>"Anything that is architecture and is specific to a particular technology is kind of an oxymoron." -- Roger Sessions</li>
	<li>Good design allows for emergent functionality, which we can also think of as purposeful evolution.</li>
	<li>The Open/Close principle doesn't mean you can't recompile. -- Allan Shalloway</li>
	<li>Fewer keystrokes != Elegant Code. Damn it! -- Dave Starr :)</li>
	<li>Architectural decisions are those that will kill your business if they are wrong.</li>
	<li>To introduce a new technology into a system, have the entire team immerse in an architectural spike, then estimate.</li>
	<li>Schedule riskiest work first. Try prioritizing a backlog by risk.</li>
	<li>The work of a developer is to uncover complexity, the work of an architect is to simplify it.</li>
	<li>A legacy system is one that is already making money.</li>
	<li>“The <a href="http://en.wikipedia.org/wiki/Winchester_Mystery_House">Winchester House</a> in San Jose is the perfect example of following a vision without a plan.”</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Ways to Stop Context Switching</title>
		<link>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=be-careful-of-your-passion</link>
		<comments>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 14:37:04 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Architecture and Design]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/02/27/be-careful-of-your-passion/</guid>
		<description><![CDATA[Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." Most of us got into this business because we liked making computers do things we [...]]]></description>
			<content:encoded><![CDATA[<p>Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." </p> <p>Most of us got into this business because we liked making computers do things we think of as cool. The most successful among us still get that rush when our new creation spools up and runs.</p> <p>Tinkerers like us tend to gold plate the pieces of our systems we find most interesting. This is why developers will often find themselves the go-to-guy for certain specialities. A dev likes making services, she makes good ones because it's fun, she gets to make more of them. Sounds perfectly reasonable and symbiotic, no?</p> <p>It can be.</p> <h2>Ignoring the Boring</h2> <p>When we get to focus exclusively on the parts of the system that really flip our bits, it can come at a price. Although we might be jazzed about services, that data model still needs our attention. It is fairly common to focus on that thing that really gets us excited and forget (or outright ignore) that part which seems boring. Just because you think someone else will come along and sweep up after doesn't make it happen. </p> <p>The most common instance of "Ignoring the Boring" is documentation. Let's face it, we want to write in languages other than English, right? Documentation is in the elegance of my self-describing code, right? Not so much. Whether we like it or not, documentation is often a deliverable of our system and as such deserves the respect we might give to our WSDL or interface definitions. Just because the reader is a human rather than a machine doesn't mean we should short change her because it's boring to do the work.</p> <h2>Smells of Sub-Optimizing</h2> <p>It is easy to see this kind of monocular behavior can result in a really clean UI with a messy back end, or visa versa. Whatever gets the short end of the stick will tend to show up in the system as a glaring deficit. We can then measure the deficit in the ignored sub-component in observable ways. Some failures of attention to detail might include:</p> <ul> <li>Lack of enforced constraints or relationships in database tables  <li>Code in the view, because it's just this one little thing  <li>Leaky abstractions, because wrapping that data model in business logic can be a real PITA  <li>No check in notes  <li>Not taking the time to do code reviews, even informally</li></ul> <h2>The System Isn't Your Playground</h2> <p>On the other end of the spectrum, what happens when we get to play with the things that <em>are</em> fun? The results can depend on what the implementer really enjoys.</p> <p>One recent real world story I heard told of a hardware engineer who designed 7 different chips within a device, each with a fundamentally different way of representing logic circuits. The chip engineer had a great time applying all the different techniques he read about in last month's <em>Nerd Fest Quarterly</em>, but the team assigned to test this Franken-board was rightly annoyed.</p> <p>Another symptom of playground development is needless abstraction layers or design patterns applied to simple problems. If a system is implemented with a gazillion abstraction layers where only a concrete implementation will do, you can bet someone is reading the <em>Gang of Four</em> in bed at night.</p> <p>If your passion is trying new tools and technologies, how many of these shiny new toys are incorporated into your system without deliberate attention? How many logging libraries does one team really need? How many unit test frameworks?</p> <p><a href="http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It" target="_blank">YAGNI</a>, 'nuff said.</p> <h2>Keep Your Passion Alive</h2> <p>So, what are you saying, Starr? Stop trying to extract pleasure from my work? Just bang the keys and give my 40 to the man? Of course not!</p> <p>I am simply asserting that there is a degree of professionalism needed at all levels. Let's care about the system as a whole and be good stewards to the craft, not just the shiny bits. And, yes, documentation is a justifiable deliverable. Cowboy up.</p> <p>Learn new techniques that fire you up and apply them wisely, not with wild abandon. Delayed gratification means not always getting to use WPF to make a draw a button, or SilverLight to make a logo spin (&lt;-- bad example). Sometimes this means capitulating to use the prescribed framework so we can get a systemic optimization instead of trying to roll our own multi-tenant web portal, yet again.</p> <p>Having more tools in our toolbox is a great thing. This is the essence of youthful fun in our work. Knowing when to use those shiny new tools is the wisdom part. Now go learn something new.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Elegant Code &#187; Widgets of Wisdom</title>
	<atom:link href="http://elegantcode.com/tag/widgets-of-wisdom/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 10:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Your First Developer Job</title>
		<link>http://elegantcode.com/2008/05/06/your-first-developer-job/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=your-first-developer-job</link>
		<comments>http://elegantcode.com/2008/05/06/your-first-developer-job/#comments</comments>
		<pubDate>Wed, 07 May 2008 04:45:09 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/05/06/your-first-developer-job/</guid>
		<description><![CDATA[I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see [...]]]></description>
			<content:encoded><![CDATA[<p>I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see them learn about the aspects of real life we face in developing solutions for clients. My favorite quote of the whole semester was, &quot;I don't think the client even knows what they want. I don't get it. Why are we even here?&quot; Awesome, no? Doesn't that just sum it all up? The beautiful thing about this is how the students were surprised when this happened. But I digress...</p>  <p>As we were wrapping up the last night I received what seemed like an innocent enough question from one of the students. &quot;What kind of job do you think I should look for?&quot;</p>  <p>It really caught me off guard, although I should have seen it coming. I didn't have a good answer on the tip of my tongue, and that may be because there isn't one. The CIS program is not designed specifically to churn out developers, but introduces students to all sorts of disciplines so they can pick a specialty later. For example thy study project management, requirements analysis, some programming, some networking, you get the idea. So the question really was bigger than it seemed. </p>  <p>Let's assume for this post that the person in question wanted to be a developer. Even if the person is looking to become a developer, the question what kind of employer to seek out isn't an easy one.</p>  <p>My father has worked 45 years as a mechanic for 2 employers. He is happy doing that. Many people, in fact most, are content with an occupation just like that. There is nothing in the world wrong with this; the world turns, people still live and love, people die, babies are born, all without making a life out of their career. Other people don't see things that way. They are passionate about their work and want to contribute to a higher vision of their chosen profession. I would guess if you are reading this, you see yourself in a similar light.</p>  <p>Someone develops code for the state government agencies. In fact, I have met many competent people who do exactly that. Are those developers missing out on something? Probably not in their mind, or they wouldn't be there. The point is simply that for some people a job is a job and there is no dishonor there.</p>  <p>This means my answer can't be glib, it must be realistic. You can't just say, &quot;Go somewhere Agile,&quot; or, &quot;Find a place where you can write Ruby.&quot; This is real life and sometimes grown ups balance security and risk and boredom and excitement because they have kids at home, or need special medical accommodation, or any one of a host of other considerations.</p>  <p>All that said, if you are passionate about the craft, if you want to drink in the industry, if you do want to learn as much as you can as soon as you can, I say this: Go work for a company with fewer than 50 employees building web solutions. </p>  <h2>Locus of Control</h2>  <p>As a company grows larger, the <a href="http://en.wikipedia.org/wiki/Locus_of_control" target="_blank">locus of control</a> individuals have inside the organization grows smaller. This is easy to see. </p>  <p>In smaller organizations, people tend to be jacks of all trades. If a server goes down, you care. If a defect is found, you care. If there is a client in the picture, you tend to actually know them. In short, small organizations provide first hand experience with many aspects of developing and delivering products. </p>  <p>In larger companies and teams, people tend to be expected to focus on a small niche of expertise. I cannot begin to tell you the number of resumes I have seen from people who spent years poking at HP's test harness suite or Micron's order entry system. This kind of &quot;specialization&quot; is not usually a recipe for career growth.</p>  <h2>Technology Exposure</h2>  <p>You'll get to go deep on technology because you are part of a small group that simply must make it work. There is no passing the buck, because there is no one to pass it to. You'll get to know whatever the technology stack is inside and out.</p>  <p>I recommend web development for a simple reason, the web isn't going away! Additionally, the technology involved in delivering to the web is growing at an astounding pace. I don't know what the web will evolve to&#160; in years to come, but it will be on hulluva ride.</p>  <h2>Comradery and Mentorship</h2>  <p>In a small organization, it is easier to foster a genuine sense that we are all in this together. The esprit de' corp in a smaller organization is typically tighter than in large organizations. This means you stand a better chance of falling in with someone who can actually mentor your career and take a genuine interest in your development.</p>  <p>Of course this exists in larger companies and is lacking in many smaller ones. I do think it is more generally found in smaller organizations, though.</p>  <h2>Conclusion</h2>  <p>So, what's the right answer? There isn't one, of course. There are just too many options and factors.</p>  <p>I will say that instead of ensuring your potential employer can pass <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" target="_blank">Spolsky's Joel Test</a>, it is more important to ensure you will be empowered to help them pass it if you come aboard.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/05/06/your-first-developer-job/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Many Uses of Relative Estimation</title>
		<link>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-many-uses-of-relative-estimation</link>
		<comments>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 21:57:16 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/</guid>
		<description><![CDATA[Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety. Have you ever looked at the website HotOrNot.com? It turns out that pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety.</p>  <p>Have you ever looked at the website <a href="http://www.hotornot.com/" target="_blank">HotOrNot.com</a>? It turns out that pretty much everyone from Quazzi Modo to Angelina Jolie ranks from a 4 to a 7. This is a prime example of our poor ability to estimate on a closely related value scale. It is pretty tough to tell if something is a 2 or a 3, but it is pretty easy to see the difference in size between a 5 and a 13. 13 is more than twice as big as 5, right?</p>  <p>Think about it this way: Does it really matter if something is going to take 3 hours or six hours? In software development, it typically doesn&#8217;t matter.</p>  <p>So the relative estimation model looks like this, in pursuing an estimate for piece of work A: </p>  <ol>   <li>Is this piece of work bigger or smaller than that piece of work B that we already did? </li>    <li>Bigger? OK, how much bigger? 2X bigger? 3X? </li>    <li>OK, 4X bigger. </li>    <li>Here is piece of work C that we already did. It was estimated at 4X bigger than B. Is it roughly the same size as A? </li>    <li>Yes. </li>    <li>Cool, we are done. </li> </ol>  <p>Once we understand that we can trust these relative comparisons because we are better at them than empirical estimation, it becomes much easier to size our work. Look at things you've already done and estimate the new one in relation to the previous work. We get our relative size and convert it into time, dollars, or whatever the project managers need and we are done. This is a much faster (and accurate) thing to do than to break it down into tasks and estimate each task. Why? Because we will never get the tasking right.</p>  <p>There is a ton more that could be said (and has) on relative estimation, but remember this: The next time you have to estimate a project for your manager, make it easier on yourself by doing a relative size first. You'll get back to coding much faster and you'll find the numbers are amazingly accurate.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Opposite of a Singleton?</title>
		<link>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-opposite-of-a-singleton</link>
		<comments>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 03:42:22 +0000</pubDate>
		<dc:creator>Alex Mueller</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/</guid>
		<description><![CDATA[I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to [...]]]></description>
			<content:encoded><![CDATA[<p>I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to the inverse object as a &quot;new object.&quot; As I pondered this later in the day, I considered adjectives describing the nature of objects. They can be many things, but two concepts that popped into my head to classify them were &quot;complex&quot; and &quot;simple.&quot; </p>  <p>I started playing with the words and making them resemble singleton. &quot;Complexton&quot; did not sound right to me. I should mention that I was washing my hands as I was contemplating this. I lifted up my head, looked into the mirror, and thought, &quot;SIMPLETON.&quot; The opposite of a singleton is a &quot;simpleton.&quot;</p>  <p>If the opposite of a singleton is not a &quot;simpleton,&quot; then what is it? Until I find a plausible answer, I will try and insert this new term into my next design discussion. </p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What is Elegant Code to me?</title>
		<link>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-is-elegant-code-to-me</link>
		<comments>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 03:47:45 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/</guid>
		<description><![CDATA[This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&#160; It isn't easy to describe.&#160; And really, the notion of what constitutes elegance in code changes over time.&#160; There is no static "this is good code" test, and I doubt there ever will be.&#160; Plus, [...]]]></description>
			<content:encoded><![CDATA[<p>This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&nbsp; It isn't easy to describe.&nbsp; And really, the notion of what constitutes elegance in code changes over time.&nbsp; There is no static "this is good code" test, and I doubt there ever will be.&nbsp; Plus, what makes good code in one language, may not apply to the next.</p> <p>So let me state for the record: today's elegant code is tomorrow's drivel.&nbsp; Don't feel bad, many writers have the same problems.&nbsp; What was super amazing back in the day is now rubbish or near unreadable.&nbsp; I am thinking of the Victorian writing that Hemingway usurped, and now Hemingway himself is almost unreadable (to me anyway).&nbsp; Tastes change with the times.&nbsp; That is a simple fact.</p> <p>So what can you do about this?&nbsp; As I say that old writing sucks to read (read Washington Irvine lately?), great works of literature still abound (for instance, Hemingway is still a great writer -- even if I prefer Tolkien) .&nbsp; So take some notes from them, and from other crafts in looking for the answer.&nbsp; If you want a cliff notes version of what this is going to tell you, it is this: you must always push yourself to get better.</p> <ol> <li>Find a good teacher.&nbsp; Nothing is better than sitting at the feet of a master who can nudge you along in the right direction.&nbsp; While early mistakes can often be corrected easily with a little bit of guidance, after they have had some time to fester all bets are off.&nbsp; I believe a fare number of "Anit-patterns" were created by self taught developers (find <a href="http://elegantcode.com/2008/03/21/sql-ejaculation/">SQL Ejaculation</a> on this site).&nbsp; <li>Read.&nbsp;&nbsp; Good writer are first good readers.&nbsp; Start with Code Complete, move into a good Patterns book, get MSDN Magazine, find some bloggers your like, but keep moving.&nbsp; You will NEVER be done reading.&nbsp; I imagine that even Martin Fowler has a "to read" booklist a mile long.  <li>Read code.&nbsp;&nbsp; There are a plethora of open source project just waiting to be read -- do so.&nbsp; This is the single best way to expand your coding repertoire, find things your language can do that you didn't even know about..&nbsp;&nbsp; Scott Hanselman has recently popularized this idea, and I thank him for it.  <li>Practice.&nbsp; This means writing small applications at home.&nbsp; You get an idea that you want to try out -- do it.&nbsp; I don't mean you have to write finished applications, just have some exploring time.&nbsp; I remember talking with an 80 year old master woodworker (he lives down the street from me), who was telling me how many time he would practice making dovetail joints before he felt competent.&nbsp; It was years worth.  <li>Pay Attention.&nbsp; Being good at anything really amounts to that.&nbsp; And don't just pay attention when reading, writing, or talking about code.&nbsp; Inspiration come from everywhere, any good artist will tell you that.&nbsp; Pay attention when you cook, when you work on the car, when you are wood working, playing an instrument, whatever it is that you do.&nbsp; This will help you in the end, event if it is just learning the amount of dedication it really takes to become good at something.  <li>Beware of preferences.&nbsp; Any time I hear someone start a statement with "I prefer code to ..." you know things are going downhill.&nbsp; If you find someone who cares more about how your code is formatted then how it is written you have found yourself in a mess.&nbsp; More importantly, beware of them in yourself.&nbsp;&nbsp; Having code style standard is important, but it isn't worth loosing sleep over.&nbsp; This also pertains to inheritance, patterns, use of particular classes (e.g. always using the generic list class in C# when a Dictionary would be better).&nbsp; <li>No Sacred Cows. Believe no single source of information.&nbsp; This means not thinking that Microsoft, Sun, IBM, Richard Stallman, or anyone else will have all of the correct answers.&nbsp; Apply the scientific method and do some research, experiment, and question the authority.&nbsp;&nbsp; There should be no sacred cows in programming.  <li>Talk with others.&nbsp; Join a user group, show up every now and then, heckle the presenter, and -maybe- speak.&nbsp; You want a broad range of people who you can talk to and bounce ideas off of.&nbsp; This will help you from becoming that crazy guy in the corner who vehemently states that all your code should be in one file.&nbsp; Having a mentor (mentioned earlier) is great, but having people around to push you from multiple directions is also good.  <li>Learn languages.&nbsp; This gets back to the "read code" idea. Make that multiple types of languages as well.&nbsp; If you know C# or Java and SQL, learn Python or Ruby, get really good at JavaScript.&nbsp; If you want something really out there, learn MDX.&nbsp; This is also a repertoire thing.&nbsp; Seeing how other languages work will make you rethink your ideas about what your current code, in whatever languages you are working in, should look like.  <li>Keep Thinking!!!&nbsp; That is possibly the most important point.&nbsp; Keep thinking.&nbsp; Don't just evaluate something once and never return, go back and reevaluate. Did the technique work?&nbsp; How could it have been better?&nbsp;&nbsp; The idea is continual improvement.  <li>Switch jobs every now and then.&nbsp; When I announced I was leaving my first programming job out of college, the VP of R&amp;D had me sit down with him and talk.&nbsp; He wasn't trying to keep me (he knew I was moving to be closer to family), he wanted to give me some advice.&nbsp; He told me to change jobs every three years.&nbsp; After you have been with a place for three years you have probably learned everything you are going to learn and it time to move on.&nbsp; This doesn't mean changing companies either.&nbsp; I've been with the same company now for four years, but I've had three different jobs.&nbsp; If you have been writing commercial applications, become a consultant - or vise-versa, become a test engineer, expand your boundaries.&nbsp; Again, this is about pushing yourself to be better.  <li>Have a Hobby. But don't ask about me, I have too many.&nbsp;&nbsp; Creating software is about creating things.&nbsp; So I suggest picking a hobby that involves creating something.&nbsp; Popular hobbies amongst programmers I know include: cooking, music, woodworking, beer making, and BBQ (which is different than cooking).&nbsp; But don't discount sports (golf is always popular), computer games, and board games.&nbsp; Anything that promotes the development of skill levels can't be a bad thing. </li></ol> <p>And I'm stopping there.&nbsp; This is my beginner's guide to how to become the writer elegant code.&nbsp; If you have others you think I missed, add them too the comments.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NetDug Unit Testing</title>
		<link>http://elegantcode.com/2008/03/22/netdug-unit-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=netdug-unit-testing</link>
		<comments>http://elegantcode.com/2008/03/22/netdug-unit-testing/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 21:00:30 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/22/netdug-unit-testing/</guid>
		<description><![CDATA[So last night I had the opportunity to be the moderator at NetDug, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk [...]]]></description>
			<content:encoded><![CDATA[So last night I had the opportunity to be the moderator at <a href="http://www.netdug.com">NetDug</a>, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk with 20 slides, I think I showed about 5 of them.  I consider that a success (I threatened the audience, the less they talked, the more slides I would show).

<a href="http://elegantcode.com/wp-content/uploads/2008/03/unittestingdemo.zip">Slides and sample code</a>

What I learned from last night:
<ol>
	<li>I'm not much of a moderator (I talk to much)</li>
	<li>Code coverage is a art in divination</li>
	<li>Mock/Stub/Fake Objects are hard to explain</li>
	<li>Over use Mocks could be a code smell</li>
	<li>The discussion format actually works pretty well for talking about unit testing</li>
	<li>If you give geeks a chance to talk, they will talk</li>
</ol>
What I hope everyone else got from the topic:
<ol>
	<li>Unit testing forces you to write better code</li>
	<li>Unit testing forces you to use better object oriented principles</li>
</ol>
<h3>Test Technology</h3>
This was an early question, what technologies to use to test your code.  <a href="http://www.nunit.org/index.php">NUnit</a>, MSUnit, and <a href="http://www.mbunit.com/">MBUnit</a> were all mentioned and viable, and stable, technologies.  For mock objects (which you are going to need) there is <a href="http://www.ayende.com/projects/rhino-mocks/downloads.aspx">Rhino Mocks</a> and <a href="http://www.typemock.com/">TypeMock</a>.  I suggest Rhino Mocks over <a href="http://www.typemock.com/">TypeMock</a> for anyone who can't purchase the full version of <a href="http://www.typemock.com/">TypeMock</a> (but there is a nice free version as well).

Then there are the helper technologies: <a href="http://testdriven.net">TestDriven.Net</a> and <a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> are the main two, but apparently MSUnit's runner isn't bad either (I haven't used it yet).  All of these tools make it easier to run your unit tests from inside Visual Studio, and each has other benefits.  <a href="http://testdriven.net">TestDriven.Net</a> has wonderful Reflector integration (a better object browser), and ReSharper...<a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> is just a must have (that is me talking, not the group).
<h3>Code Coverage</h3>
Code Coverage, using tools like <a href="http://www.ncover.com/">NCover</a> (<a href="http://www.ncover.com/download/discontinued">free version</a>), tell you how much of your code base is tested.  This was one of the early questions.  How much of your code base should be tested?  Answer: it depends on the product.  My view is that a library (no UI element) should have +90% coverage, if there is a substantial amount of UI then the project can get down to 60%.  If your code coverage gets below that you just aren't trying, or you need to rethink your architecture. 

I did talk a bit about code that was not really testable (not in an automated way anyway): UI, Database code, and external resource code are all potentially untestable.  More on this in a moment.

Database code is not testable if you can't return the database to a known state (you can restore the database data). 

UI code testing should be avoided because UI tests have to be so bound to the UI that they are brittle.  So you end up spending a considerable portion of your development time fixing broken test. Brittle tests are to be avoided whenever possible.
<h3>Testing existing code</h3>
Probably the hardest question to answer from last night was: how do you test existing code bases.  And that came up over and over.  Do you start with integration tests and then work in unit tests, or the other way around. 

I will admit, most of the time when I talk about unit testing, I center it around new projects.  Unit test is hard enough with new code, testing old code that wasn't written with unit test in mind is a migraine waiting to happen.

The audience did have some good advice though.  Pick parts of the project that you need to work on (say one class) and make that testable and tested.  Essentially you start creating silos of tested code.  The other suggestion (and I actually had a slide for this) was to get the book: <a href="http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206114497&amp;sr=8-1">Working Effectively with Legacy Code</a>.  Finally, buy TypeMock -- the big boy version, not the free-be version.  You'll need it.
<h3>UI Testing</h3>
This is my treatise on writing unit tests for the User Interface:

1. Don't do it until you are done with the UI.
2. Only test that the UI works in a basic sense.
3. You still have to test the UI by hand.

If you start writing UI tests while you are developing the UI, you will continually break the tests.  Writing the test by hand is none trivial, and using tools to write them is also error prone.  Finally, these tests can't tell you if the UI is just bad.  Only exposure can tell you that.  Every developer should be forced to have to use their UI repeatedly so they know where is sucks.  You wont get that with automated UI tests.

That said, there are tools to help you test web user interfaces. <a href="http://watin.sourceforge.net/">Watin</a>, <a href="http://wtr.rubyforge.org/">Watir</a>, and <a href="http://selenium.openqa.org/">Selenium</a> are all there to help.  We shall see if Team Systems adds anything to help with this (I'm hoping it does).
<h3>Testing Database code</h3>
This is essentially, testing code that touches the database.  Could be your <a href="http://www.hibernate.org/343.html">NHibernate</a> code, could be a stored procedure, could be ADO.Net code.  But really, this is just code that must touch an outside resource (database, file system, serial connection, etc) and there is no way, or point, to abstract it out any further.

The main point here was to have a way to get the data back to a known state.  Without that everything else gets much harder.

We also came up with a new term: SQL Ejaculation.  That is a pattern smell where an excessive amount of your HTML comes from you SQL database.  Like the entire site.  All of the HTML.  And you have stored procedures that simply build the HTML -- in a 10,000 line stored procedure.  That is SQL Ejaculation.

Note: if this comes up in a Google search I might get worried.
<h3></h3>
<h3>After the meeting</h3>
We all went to Table Rock for a beer.  'nuf said, it is a great group.

Finally, to the guy who asked me a question after the meeting was over: I'm sorry, I just haven't had to draw multiple, overlapping, transparent images on a win form using GDI.Net in a really long time.  I know it involves alpha-transparency values, but I haven't done that in years.  Maybe you should look at WPF.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/22/netdug-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be Careful of Your Passion</title>
		<link>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=be-careful-of-your-passion</link>
		<comments>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 14:37:04 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Architecture and Design]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/02/27/be-careful-of-your-passion/</guid>
		<description><![CDATA[Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." Most of us got into this business because we liked making computers do things we [...]]]></description>
			<content:encoded><![CDATA[<p>Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." </p> <p>Most of us got into this business because we liked making computers do things we think of as cool. The most successful among us still get that rush when our new creation spools up and runs.</p> <p>Tinkerers like us tend to gold plate the pieces of our systems we find most interesting. This is why developers will often find themselves the go-to-guy for certain specialities. A dev likes making services, she makes good ones because it's fun, she gets to make more of them. Sounds perfectly reasonable and symbiotic, no?</p> <p>It can be.</p> <h2>Ignoring the Boring</h2> <p>When we get to focus exclusively on the parts of the system that really flip our bits, it can come at a price. Although we might be jazzed about services, that data model still needs our attention. It is fairly common to focus on that thing that really gets us excited and forget (or outright ignore) that part which seems boring. Just because you think someone else will come along and sweep up after doesn't make it happen. </p> <p>The most common instance of "Ignoring the Boring" is documentation. Let's face it, we want to write in languages other than English, right? Documentation is in the elegance of my self-describing code, right? Not so much. Whether we like it or not, documentation is often a deliverable of our system and as such deserves the respect we might give to our WSDL or interface definitions. Just because the reader is a human rather than a machine doesn't mean we should short change her because it's boring to do the work.</p> <h2>Smells of Sub-Optimizing</h2> <p>It is easy to see this kind of monocular behavior can result in a really clean UI with a messy back end, or visa versa. Whatever gets the short end of the stick will tend to show up in the system as a glaring deficit. We can then measure the deficit in the ignored sub-component in observable ways. Some failures of attention to detail might include:</p> <ul> <li>Lack of enforced constraints or relationships in database tables  <li>Code in the view, because it's just this one little thing  <li>Leaky abstractions, because wrapping that data model in business logic can be a real PITA  <li>No check in notes  <li>Not taking the time to do code reviews, even informally</li></ul> <h2>The System Isn't Your Playground</h2> <p>On the other end of the spectrum, what happens when we get to play with the things that <em>are</em> fun? The results can depend on what the implementer really enjoys.</p> <p>One recent real world story I heard told of a hardware engineer who designed 7 different chips within a device, each with a fundamentally different way of representing logic circuits. The chip engineer had a great time applying all the different techniques he read about in last month's <em>Nerd Fest Quarterly</em>, but the team assigned to test this Franken-board was rightly annoyed.</p> <p>Another symptom of playground development is needless abstraction layers or design patterns applied to simple problems. If a system is implemented with a gazillion abstraction layers where only a concrete implementation will do, you can bet someone is reading the <em>Gang of Four</em> in bed at night.</p> <p>If your passion is trying new tools and technologies, how many of these shiny new toys are incorporated into your system without deliberate attention? How many logging libraries does one team really need? How many unit test frameworks?</p> <p><a href="http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It" target="_blank">YAGNI</a>, 'nuff said.</p> <h2>Keep Your Passion Alive</h2> <p>So, what are you saying, Starr? Stop trying to extract pleasure from my work? Just bang the keys and give my 40 to the man? Of course not!</p> <p>I am simply asserting that there is a degree of professionalism needed at all levels. Let's care about the system as a whole and be good stewards to the craft, not just the shiny bits. And, yes, documentation is a justifiable deliverable. Cowboy up.</p> <p>Learn new techniques that fire you up and apply them wisely, not with wild abandon. Delayed gratification means not always getting to use WPF to make a draw a button, or SilverLight to make a logo spin (&lt;-- bad example). Sometimes this means capitulating to use the prescribed framework so we can get a systemic optimization instead of trying to roll our own multi-tenant web portal, yet again.</p> <p>Having more tools in our toolbox is a great thing. This is the essence of youthful fun in our work. Knowing when to use those shiny new tools is the wisdom part. Now go learn something new.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Confessions of a bad web developer</title>
		<link>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=confessions-of-a-bad-web-developer</link>
		<comments>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 03:57:55 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/</guid>
		<description><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately. Not a lot, just enough to get acquainted for right now. Yesterday I had my "Road to Damascus" incident. I don't know HTML. OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them [...]]]></description>
			<content:encoded><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately.  Not a lot, just enough to get acquainted for right now.  Yesterday I had my "Road to Damascus" incident.  I don't know HTML.

OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them without looking things up.  More importantly, I know a ton of asp.net controls.  What I don't know, specifically, is how they all work.

Like the form tag.  I know every Asp.Net page I have ever made has had one of them (and only one, at least as of .Net 1.1 that is all you were allowed).  But I don't remember how to use it any more.  How to read data from it, pass values from one page to the next.  I used to, did it a few times in fact.  Then came Asp.Net, and I haven't looked back.

Have I written JavaScript during this time?  Sort of.  If you count copying code from Google (and testing it of course).  Over the years I have large blocks of Googled JavaScript code in existing projects that I've move from page to page.  Cut-and-paste is a type of reuse...right?  And lately, when my JavaScript requirements have not been Google-able, <a href="http://jquery.com">JQuery</a> has become my savior (more posts on that soon).  But I haven't written a JavaScript object, Prototype, or any such tomfoolery since Netscape 4.8.

And just to clarify.  I once wrote my own tree control in JavaScript.  Or, I wrote one for Netscape 4.04, 4.08, 4.5, 4.75, 4.8, and IE.  I never thought I could hate a language until Netscape.  Netscape killed any love of JavaScript for me.

But now with Ajax on the scene I can't do without it anymore.  And as cool as the Asp.Net Ajax Library is and all of the things that the control toolkit can do for you: without a bit of JavaScript muscle, it just isn't going to work for you.  Take a look at the Google Maps API and tell me you aren't thinking of things that could be done with it.  But it ain't going no where without some JavaScript know-how.

CSS I have come to terms with.  I know the difference between .tag and #tag.  I've written a hover or two.  But there are still unknowns there as well.  I still visit <a href="http://w3schools.com/css">w3schools</a> regularly, and spend way too much time with <a href="http://www.getfirebug.com">FireBug</a> and <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a>.  And <a href="http://csszengarden.com">CssZenGarden</a> -- that is just beyond me right now.

But even in Asp.Net.  <a href="http://www.xefteri.com/articles/show.cfm?id=18">How does a post back work?</a> How is it that a button click is hooked up to an event handler? I'm a firm believer that their is no "magic" in programming.  Post back is magic to me.   Maybe once years ago I knew, but not anymore.

But things like: if you have a table, and every row has a check box on it, on the server side, how do you know which check box is which?  Heck, how do I figure that out on the client side with JavaScript?  The magic is ViewState, I know.  But...

That really is the beauty of WebForms.  It provides a nice insulating coat that insulates you from all of the goo that is html and JavaScript.  ViewState is my friend.  But what does this have to do with Asp.Net MVC?  Absolutely everything.

Asp.Net is a stripped down version of web development with .Net.  ViewState: gone.  asp:Button: hope you are familiar with submit.  The cozy jacket is gone and has been replaced with a wind breaker.  All those old techniques that we threw away with our last ASP page needs to be resurrected.

Being how I already live in a cold climate, I know that the biggest part of working in cold weather is to acclimated to the temperature.  Part of it as well, is knowing that you have to work in the cold climate.  So this isn't time to put things off.  Spring is still a ways off.  So, for Asp.Net WebForms developers, that means re-familiarizing yourself with a few technologies that we all thought we didn't need to know that well:
<ul>
	<li>XHML</li>
	<li>CSS</li>
	<li>JavaScript</li>
	<li>JSON</li>
	<li>JQuery</li>
	<li>Asp.Net Ajax framework</li>
</ul>
I'm not going to specify particular books.  I don't have time for that, and you can search Amazon as well as I can.  Actually, I bought a couple of these books for  at Hastings near my house.  Worth every cent.

Also worth noting what is not on my list: XML.  The language we thought was the lingua franca of the web.  I've had enough XML, and the Asp.Net Ajax library talks via JSON (which is much smaller).   So XML is out for me.  And that is fine, I think, there is enough to learn as is.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom IV</title>
		<link>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iv</link>
		<comments>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 04:48:42 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins. Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. [...]]]></description>
			<content:encoded><![CDATA[<p>If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a href="http://elegantcode.com/?p=646" target="_blank">here</a>.</p> <ol> <li>Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins.  <li>Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. .Net, as an example.  <li>If metrics are prescribed to a team, explain how they will be used. Metrics cause fear, mitigate that fear.  <li>You can prescribe Agility, but not hyper-performance.  <li>Part of the maturation process of Agile is the tendency for people to over-analyze the holy heck out of it. This is relly a reaction to the cost of software development and the incredible amounts of historical waste in the industry.  <li>CEOs do not care about code coverage. Speak to them appropriately about quality.  <li>Earned value reporting is ridiculous.  <li>"Don't wait until the customer is screaming to optimize for performance." <em>-- Thanks, Kevin</em>.  <li>Deliver less, but sooner and more often. <li>"Daddy, is that your new <a href="http://en.wikipedia.org/wiki/Out-Of-Box_Experience" target="_blank">OOBE</a>?" - My kid when I opened my new MacBook. "Yes, it is, son. Yes, it is."</li></ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom III</title>
		<link>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iii</link>
		<comments>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 04:14:20 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=664</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Carry a model at all times to express your understanding to others. Look for patterns in all systems at all levels. Seeing them is the very essence of insight. At the application level, architecture and design are synonymous. "BizTalk is overkill" [...]]]></description>
			<content:encoded><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a target="_blank" href="http://elegantcode.com/?p=646">here</a>.
<ol>
	<li>Carry a model at all times to express your understanding to others.</li>
	<li>Look for patterns in all systems at all levels. Seeing them is the very essence of insight.</li>
	<li>At the application level, architecture and design are synonymous.</li>
	<li>"BizTalk is overkill" is a typically overheard comment of <em>Drive by Architecture</em>.</li>
	<li>Developers would never prescribe BizTalk or a TIBCO or any other message bus system. That type of decision is typical of a CTO or someone who reports directly to one. These are strategic decisions.
"I think that, generally, if you're looking at something like BizTalk, you're probably looking at somebody, a directory port of a CIO or a CTO, I would say." -- Roger Session</li>
	<li>"Anything that is architecture and is specific to a particular technology is kind of an oxymoron." -- Roger Sessions</li>
	<li>Good design allows for emergent functionality, which we can also think of as purposeful evolution.</li>
	<li>The Open/Close principle doesn't mean you can't recompile. -- Allan Shalloway</li>
	<li>Fewer keystrokes != Elegant Code. Damn it! -- Dave Starr :)</li>
	<li>Architectural decisions are those that will kill your business if they are wrong.</li>
	<li>To introduce a new technology into a system, have the entire team immerse in an architectural spike, then estimate.</li>
	<li>Schedule riskiest work first. Try prioritizing a backlog by risk.</li>
	<li>The work of a developer is to uncover complexity, the work of an architect is to simplify it.</li>
	<li>A legacy system is one that is already making money.</li>
	<li>“The <a href="http://en.wikipedia.org/wiki/Winchester_Mystery_House">Winchester House</a> in San Jose is the perfect example of following a vision without a plan.”</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Ways to Stop Context Switching</title>
		<link>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=confessions-of-a-bad-web-developer</link>
		<comments>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 03:57:55 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/</guid>
		<description><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately. Not a lot, just enough to get acquainted for right now. Yesterday I had my "Road to Damascus" incident. I don't know HTML. OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them [...]]]></description>
			<content:encoded><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately.  Not a lot, just enough to get acquainted for right now.  Yesterday I had my "Road to Damascus" incident.  I don't know HTML.

OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them without looking things up.  More importantly, I know a ton of asp.net controls.  What I don't know, specifically, is how they all work.

Like the form tag.  I know every Asp.Net page I have ever made has had one of them (and only one, at least as of .Net 1.1 that is all you were allowed).  But I don't remember how to use it any more.  How to read data from it, pass values from one page to the next.  I used to, did it a few times in fact.  Then came Asp.Net, and I haven't looked back.

Have I written JavaScript during this time?  Sort of.  If you count copying code from Google (and testing it of course).  Over the years I have large blocks of Googled JavaScript code in existing projects that I've move from page to page.  Cut-and-paste is a type of reuse...right?  And lately, when my JavaScript requirements have not been Google-able, <a href="http://jquery.com">JQuery</a> has become my savior (more posts on that soon).  But I haven't written a JavaScript object, Prototype, or any such tomfoolery since Netscape 4.8.

And just to clarify.  I once wrote my own tree control in JavaScript.  Or, I wrote one for Netscape 4.04, 4.08, 4.5, 4.75, 4.8, and IE.  I never thought I could hate a language until Netscape.  Netscape killed any love of JavaScript for me.

But now with Ajax on the scene I can't do without it anymore.  And as cool as the Asp.Net Ajax Library is and all of the things that the control toolkit can do for you: without a bit of JavaScript muscle, it just isn't going to work for you.  Take a look at the Google Maps API and tell me you aren't thinking of things that could be done with it.  But it ain't going no where without some JavaScript know-how.

CSS I have come to terms with.  I know the difference between .tag and #tag.  I've written a hover or two.  But there are still unknowns there as well.  I still visit <a href="http://w3schools.com/css">w3schools</a> regularly, and spend way too much time with <a href="http://www.getfirebug.com">FireBug</a> and <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a>.  And <a href="http://csszengarden.com">CssZenGarden</a> -- that is just beyond me right now.

But even in Asp.Net.  <a href="http://www.xefteri.com/articles/show.cfm?id=18">How does a post back work?</a> How is it that a button click is hooked up to an event handler? I'm a firm believer that their is no "magic" in programming.  Post back is magic to me.   Maybe once years ago I knew, but not anymore.

But things like: if you have a table, and every row has a check box on it, on the server side, how do you know which check box is which?  Heck, how do I figure that out on the client side with JavaScript?  The magic is ViewState, I know.  But...

That really is the beauty of WebForms.  It provides a nice insulating coat that insulates you from all of the goo that is html and JavaScript.  ViewState is my friend.  But what does this have to do with Asp.Net MVC?  Absolutely everything.

Asp.Net is a stripped down version of web development with .Net.  ViewState: gone.  asp:Button: hope you are familiar with submit.  The cozy jacket is gone and has been replaced with a wind breaker.  All those old techniques that we threw away with our last ASP page needs to be resurrected.

Being how I already live in a cold climate, I know that the biggest part of working in cold weather is to acclimated to the temperature.  Part of it as well, is knowing that you have to work in the cold climate.  So this isn't time to put things off.  Spring is still a ways off.  So, for Asp.Net WebForms developers, that means re-familiarizing yourself with a few technologies that we all thought we didn't need to know that well:
<ul>
	<li>XHML</li>
	<li>CSS</li>
	<li>JavaScript</li>
	<li>JSON</li>
	<li>JQuery</li>
	<li>Asp.Net Ajax framework</li>
</ul>
I'm not going to specify particular books.  I don't have time for that, and you can search Amazon as well as I can.  Actually, I bought a couple of these books for $1 at Hastings near my house.  Worth every cent.

Also worth noting what is not on my list: XML.  The language we thought was the lingua franca of the web.  I've had enough XML, and the Asp.Net Ajax library talks via JSON (which is much smaller).   So XML is out for me.  And that is fine, I think, there is enough to learn as is.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Elegant Code &#187; Widgets of Wisdom</title>
	<atom:link href="http://elegantcode.com/tag/widgets-of-wisdom/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 10:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Your First Developer Job</title>
		<link>http://elegantcode.com/2008/05/06/your-first-developer-job/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=your-first-developer-job</link>
		<comments>http://elegantcode.com/2008/05/06/your-first-developer-job/#comments</comments>
		<pubDate>Wed, 07 May 2008 04:45:09 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/05/06/your-first-developer-job/</guid>
		<description><![CDATA[I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see [...]]]></description>
			<content:encoded><![CDATA[<p>I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see them learn about the aspects of real life we face in developing solutions for clients. My favorite quote of the whole semester was, &quot;I don't think the client even knows what they want. I don't get it. Why are we even here?&quot; Awesome, no? Doesn't that just sum it all up? The beautiful thing about this is how the students were surprised when this happened. But I digress...</p>  <p>As we were wrapping up the last night I received what seemed like an innocent enough question from one of the students. &quot;What kind of job do you think I should look for?&quot;</p>  <p>It really caught me off guard, although I should have seen it coming. I didn't have a good answer on the tip of my tongue, and that may be because there isn't one. The CIS program is not designed specifically to churn out developers, but introduces students to all sorts of disciplines so they can pick a specialty later. For example thy study project management, requirements analysis, some programming, some networking, you get the idea. So the question really was bigger than it seemed. </p>  <p>Let's assume for this post that the person in question wanted to be a developer. Even if the person is looking to become a developer, the question what kind of employer to seek out isn't an easy one.</p>  <p>My father has worked 45 years as a mechanic for 2 employers. He is happy doing that. Many people, in fact most, are content with an occupation just like that. There is nothing in the world wrong with this; the world turns, people still live and love, people die, babies are born, all without making a life out of their career. Other people don't see things that way. They are passionate about their work and want to contribute to a higher vision of their chosen profession. I would guess if you are reading this, you see yourself in a similar light.</p>  <p>Someone develops code for the state government agencies. In fact, I have met many competent people who do exactly that. Are those developers missing out on something? Probably not in their mind, or they wouldn't be there. The point is simply that for some people a job is a job and there is no dishonor there.</p>  <p>This means my answer can't be glib, it must be realistic. You can't just say, &quot;Go somewhere Agile,&quot; or, &quot;Find a place where you can write Ruby.&quot; This is real life and sometimes grown ups balance security and risk and boredom and excitement because they have kids at home, or need special medical accommodation, or any one of a host of other considerations.</p>  <p>All that said, if you are passionate about the craft, if you want to drink in the industry, if you do want to learn as much as you can as soon as you can, I say this: Go work for a company with fewer than 50 employees building web solutions. </p>  <h2>Locus of Control</h2>  <p>As a company grows larger, the <a href="http://en.wikipedia.org/wiki/Locus_of_control" target="_blank">locus of control</a> individuals have inside the organization grows smaller. This is easy to see. </p>  <p>In smaller organizations, people tend to be jacks of all trades. If a server goes down, you care. If a defect is found, you care. If there is a client in the picture, you tend to actually know them. In short, small organizations provide first hand experience with many aspects of developing and delivering products. </p>  <p>In larger companies and teams, people tend to be expected to focus on a small niche of expertise. I cannot begin to tell you the number of resumes I have seen from people who spent years poking at HP's test harness suite or Micron's order entry system. This kind of &quot;specialization&quot; is not usually a recipe for career growth.</p>  <h2>Technology Exposure</h2>  <p>You'll get to go deep on technology because you are part of a small group that simply must make it work. There is no passing the buck, because there is no one to pass it to. You'll get to know whatever the technology stack is inside and out.</p>  <p>I recommend web development for a simple reason, the web isn't going away! Additionally, the technology involved in delivering to the web is growing at an astounding pace. I don't know what the web will evolve to&#160; in years to come, but it will be on hulluva ride.</p>  <h2>Comradery and Mentorship</h2>  <p>In a small organization, it is easier to foster a genuine sense that we are all in this together. The esprit de' corp in a smaller organization is typically tighter than in large organizations. This means you stand a better chance of falling in with someone who can actually mentor your career and take a genuine interest in your development.</p>  <p>Of course this exists in larger companies and is lacking in many smaller ones. I do think it is more generally found in smaller organizations, though.</p>  <h2>Conclusion</h2>  <p>So, what's the right answer? There isn't one, of course. There are just too many options and factors.</p>  <p>I will say that instead of ensuring your potential employer can pass <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" target="_blank">Spolsky's Joel Test</a>, it is more important to ensure you will be empowered to help them pass it if you come aboard.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/05/06/your-first-developer-job/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Many Uses of Relative Estimation</title>
		<link>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-many-uses-of-relative-estimation</link>
		<comments>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 21:57:16 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/</guid>
		<description><![CDATA[Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety. Have you ever looked at the website HotOrNot.com? It turns out that pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety.</p>  <p>Have you ever looked at the website <a href="http://www.hotornot.com/" target="_blank">HotOrNot.com</a>? It turns out that pretty much everyone from Quazzi Modo to Angelina Jolie ranks from a 4 to a 7. This is a prime example of our poor ability to estimate on a closely related value scale. It is pretty tough to tell if something is a 2 or a 3, but it is pretty easy to see the difference in size between a 5 and a 13. 13 is more than twice as big as 5, right?</p>  <p>Think about it this way: Does it really matter if something is going to take 3 hours or six hours? In software development, it typically doesn&#8217;t matter.</p>  <p>So the relative estimation model looks like this, in pursuing an estimate for piece of work A: </p>  <ol>   <li>Is this piece of work bigger or smaller than that piece of work B that we already did? </li>    <li>Bigger? OK, how much bigger? 2X bigger? 3X? </li>    <li>OK, 4X bigger. </li>    <li>Here is piece of work C that we already did. It was estimated at 4X bigger than B. Is it roughly the same size as A? </li>    <li>Yes. </li>    <li>Cool, we are done. </li> </ol>  <p>Once we understand that we can trust these relative comparisons because we are better at them than empirical estimation, it becomes much easier to size our work. Look at things you've already done and estimate the new one in relation to the previous work. We get our relative size and convert it into time, dollars, or whatever the project managers need and we are done. This is a much faster (and accurate) thing to do than to break it down into tasks and estimate each task. Why? Because we will never get the tasking right.</p>  <p>There is a ton more that could be said (and has) on relative estimation, but remember this: The next time you have to estimate a project for your manager, make it easier on yourself by doing a relative size first. You'll get back to coding much faster and you'll find the numbers are amazingly accurate.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Opposite of a Singleton?</title>
		<link>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-opposite-of-a-singleton</link>
		<comments>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 03:42:22 +0000</pubDate>
		<dc:creator>Alex Mueller</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/</guid>
		<description><![CDATA[I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to [...]]]></description>
			<content:encoded><![CDATA[<p>I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to the inverse object as a &quot;new object.&quot; As I pondered this later in the day, I considered adjectives describing the nature of objects. They can be many things, but two concepts that popped into my head to classify them were &quot;complex&quot; and &quot;simple.&quot; </p>  <p>I started playing with the words and making them resemble singleton. &quot;Complexton&quot; did not sound right to me. I should mention that I was washing my hands as I was contemplating this. I lifted up my head, looked into the mirror, and thought, &quot;SIMPLETON.&quot; The opposite of a singleton is a &quot;simpleton.&quot;</p>  <p>If the opposite of a singleton is not a &quot;simpleton,&quot; then what is it? Until I find a plausible answer, I will try and insert this new term into my next design discussion. </p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What is Elegant Code to me?</title>
		<link>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-is-elegant-code-to-me</link>
		<comments>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 03:47:45 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/</guid>
		<description><![CDATA[This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&#160; It isn't easy to describe.&#160; And really, the notion of what constitutes elegance in code changes over time.&#160; There is no static "this is good code" test, and I doubt there ever will be.&#160; Plus, [...]]]></description>
			<content:encoded><![CDATA[<p>This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&nbsp; It isn't easy to describe.&nbsp; And really, the notion of what constitutes elegance in code changes over time.&nbsp; There is no static "this is good code" test, and I doubt there ever will be.&nbsp; Plus, what makes good code in one language, may not apply to the next.</p> <p>So let me state for the record: today's elegant code is tomorrow's drivel.&nbsp; Don't feel bad, many writers have the same problems.&nbsp; What was super amazing back in the day is now rubbish or near unreadable.&nbsp; I am thinking of the Victorian writing that Hemingway usurped, and now Hemingway himself is almost unreadable (to me anyway).&nbsp; Tastes change with the times.&nbsp; That is a simple fact.</p> <p>So what can you do about this?&nbsp; As I say that old writing sucks to read (read Washington Irvine lately?), great works of literature still abound (for instance, Hemingway is still a great writer -- even if I prefer Tolkien) .&nbsp; So take some notes from them, and from other crafts in looking for the answer.&nbsp; If you want a cliff notes version of what this is going to tell you, it is this: you must always push yourself to get better.</p> <ol> <li>Find a good teacher.&nbsp; Nothing is better than sitting at the feet of a master who can nudge you along in the right direction.&nbsp; While early mistakes can often be corrected easily with a little bit of guidance, after they have had some time to fester all bets are off.&nbsp; I believe a fare number of "Anit-patterns" were created by self taught developers (find <a href="http://elegantcode.com/2008/03/21/sql-ejaculation/">SQL Ejaculation</a> on this site).&nbsp; <li>Read.&nbsp;&nbsp; Good writer are first good readers.&nbsp; Start with Code Complete, move into a good Patterns book, get MSDN Magazine, find some bloggers your like, but keep moving.&nbsp; You will NEVER be done reading.&nbsp; I imagine that even Martin Fowler has a "to read" booklist a mile long.  <li>Read code.&nbsp;&nbsp; There are a plethora of open source project just waiting to be read -- do so.&nbsp; This is the single best way to expand your coding repertoire, find things your language can do that you didn't even know about..&nbsp;&nbsp; Scott Hanselman has recently popularized this idea, and I thank him for it.  <li>Practice.&nbsp; This means writing small applications at home.&nbsp; You get an idea that you want to try out -- do it.&nbsp; I don't mean you have to write finished applications, just have some exploring time.&nbsp; I remember talking with an 80 year old master woodworker (he lives down the street from me), who was telling me how many time he would practice making dovetail joints before he felt competent.&nbsp; It was years worth.  <li>Pay Attention.&nbsp; Being good at anything really amounts to that.&nbsp; And don't just pay attention when reading, writing, or talking about code.&nbsp; Inspiration come from everywhere, any good artist will tell you that.&nbsp; Pay attention when you cook, when you work on the car, when you are wood working, playing an instrument, whatever it is that you do.&nbsp; This will help you in the end, event if it is just learning the amount of dedication it really takes to become good at something.  <li>Beware of preferences.&nbsp; Any time I hear someone start a statement with "I prefer code to ..." you know things are going downhill.&nbsp; If you find someone who cares more about how your code is formatted then how it is written you have found yourself in a mess.&nbsp; More importantly, beware of them in yourself.&nbsp;&nbsp; Having code style standard is important, but it isn't worth loosing sleep over.&nbsp; This also pertains to inheritance, patterns, use of particular classes (e.g. always using the generic list class in C# when a Dictionary would be better).&nbsp; <li>No Sacred Cows. Believe no single source of information.&nbsp; This means not thinking that Microsoft, Sun, IBM, Richard Stallman, or anyone else will have all of the correct answers.&nbsp; Apply the scientific method and do some research, experiment, and question the authority.&nbsp;&nbsp; There should be no sacred cows in programming.  <li>Talk with others.&nbsp; Join a user group, show up every now and then, heckle the presenter, and -maybe- speak.&nbsp; You want a broad range of people who you can talk to and bounce ideas off of.&nbsp; This will help you from becoming that crazy guy in the corner who vehemently states that all your code should be in one file.&nbsp; Having a mentor (mentioned earlier) is great, but having people around to push you from multiple directions is also good.  <li>Learn languages.&nbsp; This gets back to the "read code" idea. Make that multiple types of languages as well.&nbsp; If you know C# or Java and SQL, learn Python or Ruby, get really good at JavaScript.&nbsp; If you want something really out there, learn MDX.&nbsp; This is also a repertoire thing.&nbsp; Seeing how other languages work will make you rethink your ideas about what your current code, in whatever languages you are working in, should look like.  <li>Keep Thinking!!!&nbsp; That is possibly the most important point.&nbsp; Keep thinking.&nbsp; Don't just evaluate something once and never return, go back and reevaluate. Did the technique work?&nbsp; How could it have been better?&nbsp;&nbsp; The idea is continual improvement.  <li>Switch jobs every now and then.&nbsp; When I announced I was leaving my first programming job out of college, the VP of R&amp;D had me sit down with him and talk.&nbsp; He wasn't trying to keep me (he knew I was moving to be closer to family), he wanted to give me some advice.&nbsp; He told me to change jobs every three years.&nbsp; After you have been with a place for three years you have probably learned everything you are going to learn and it time to move on.&nbsp; This doesn't mean changing companies either.&nbsp; I've been with the same company now for four years, but I've had three different jobs.&nbsp; If you have been writing commercial applications, become a consultant - or vise-versa, become a test engineer, expand your boundaries.&nbsp; Again, this is about pushing yourself to be better.  <li>Have a Hobby. But don't ask about me, I have too many.&nbsp;&nbsp; Creating software is about creating things.&nbsp; So I suggest picking a hobby that involves creating something.&nbsp; Popular hobbies amongst programmers I know include: cooking, music, woodworking, beer making, and BBQ (which is different than cooking).&nbsp; But don't discount sports (golf is always popular), computer games, and board games.&nbsp; Anything that promotes the development of skill levels can't be a bad thing. </li></ol> <p>And I'm stopping there.&nbsp; This is my beginner's guide to how to become the writer elegant code.&nbsp; If you have others you think I missed, add them too the comments.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NetDug Unit Testing</title>
		<link>http://elegantcode.com/2008/03/22/netdug-unit-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=netdug-unit-testing</link>
		<comments>http://elegantcode.com/2008/03/22/netdug-unit-testing/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 21:00:30 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/22/netdug-unit-testing/</guid>
		<description><![CDATA[So last night I had the opportunity to be the moderator at NetDug, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk [...]]]></description>
			<content:encoded><![CDATA[So last night I had the opportunity to be the moderator at <a href="http://www.netdug.com">NetDug</a>, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk with 20 slides, I think I showed about 5 of them.  I consider that a success (I threatened the audience, the less they talked, the more slides I would show).

<a href="http://elegantcode.com/wp-content/uploads/2008/03/unittestingdemo.zip">Slides and sample code</a>

What I learned from last night:
<ol>
	<li>I'm not much of a moderator (I talk to much)</li>
	<li>Code coverage is a art in divination</li>
	<li>Mock/Stub/Fake Objects are hard to explain</li>
	<li>Over use Mocks could be a code smell</li>
	<li>The discussion format actually works pretty well for talking about unit testing</li>
	<li>If you give geeks a chance to talk, they will talk</li>
</ol>
What I hope everyone else got from the topic:
<ol>
	<li>Unit testing forces you to write better code</li>
	<li>Unit testing forces you to use better object oriented principles</li>
</ol>
<h3>Test Technology</h3>
This was an early question, what technologies to use to test your code.  <a href="http://www.nunit.org/index.php">NUnit</a>, MSUnit, and <a href="http://www.mbunit.com/">MBUnit</a> were all mentioned and viable, and stable, technologies.  For mock objects (which you are going to need) there is <a href="http://www.ayende.com/projects/rhino-mocks/downloads.aspx">Rhino Mocks</a> and <a href="http://www.typemock.com/">TypeMock</a>.  I suggest Rhino Mocks over <a href="http://www.typemock.com/">TypeMock</a> for anyone who can't purchase the full version of <a href="http://www.typemock.com/">TypeMock</a> (but there is a nice free version as well).

Then there are the helper technologies: <a href="http://testdriven.net">TestDriven.Net</a> and <a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> are the main two, but apparently MSUnit's runner isn't bad either (I haven't used it yet).  All of these tools make it easier to run your unit tests from inside Visual Studio, and each has other benefits.  <a href="http://testdriven.net">TestDriven.Net</a> has wonderful Reflector integration (a better object browser), and ReSharper...<a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> is just a must have (that is me talking, not the group).
<h3>Code Coverage</h3>
Code Coverage, using tools like <a href="http://www.ncover.com/">NCover</a> (<a href="http://www.ncover.com/download/discontinued">free version</a>), tell you how much of your code base is tested.  This was one of the early questions.  How much of your code base should be tested?  Answer: it depends on the product.  My view is that a library (no UI element) should have +90% coverage, if there is a substantial amount of UI then the project can get down to 60%.  If your code coverage gets below that you just aren't trying, or you need to rethink your architecture. 

I did talk a bit about code that was not really testable (not in an automated way anyway): UI, Database code, and external resource code are all potentially untestable.  More on this in a moment.

Database code is not testable if you can't return the database to a known state (you can restore the database data). 

UI code testing should be avoided because UI tests have to be so bound to the UI that they are brittle.  So you end up spending a considerable portion of your development time fixing broken test. Brittle tests are to be avoided whenever possible.
<h3>Testing existing code</h3>
Probably the hardest question to answer from last night was: how do you test existing code bases.  And that came up over and over.  Do you start with integration tests and then work in unit tests, or the other way around. 

I will admit, most of the time when I talk about unit testing, I center it around new projects.  Unit test is hard enough with new code, testing old code that wasn't written with unit test in mind is a migraine waiting to happen.

The audience did have some good advice though.  Pick parts of the project that you need to work on (say one class) and make that testable and tested.  Essentially you start creating silos of tested code.  The other suggestion (and I actually had a slide for this) was to get the book: <a href="http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206114497&amp;sr=8-1">Working Effectively with Legacy Code</a>.  Finally, buy TypeMock -- the big boy version, not the free-be version.  You'll need it.
<h3>UI Testing</h3>
This is my treatise on writing unit tests for the User Interface:

1. Don't do it until you are done with the UI.
2. Only test that the UI works in a basic sense.
3. You still have to test the UI by hand.

If you start writing UI tests while you are developing the UI, you will continually break the tests.  Writing the test by hand is none trivial, and using tools to write them is also error prone.  Finally, these tests can't tell you if the UI is just bad.  Only exposure can tell you that.  Every developer should be forced to have to use their UI repeatedly so they know where is sucks.  You wont get that with automated UI tests.

That said, there are tools to help you test web user interfaces. <a href="http://watin.sourceforge.net/">Watin</a>, <a href="http://wtr.rubyforge.org/">Watir</a>, and <a href="http://selenium.openqa.org/">Selenium</a> are all there to help.  We shall see if Team Systems adds anything to help with this (I'm hoping it does).
<h3>Testing Database code</h3>
This is essentially, testing code that touches the database.  Could be your <a href="http://www.hibernate.org/343.html">NHibernate</a> code, could be a stored procedure, could be ADO.Net code.  But really, this is just code that must touch an outside resource (database, file system, serial connection, etc) and there is no way, or point, to abstract it out any further.

The main point here was to have a way to get the data back to a known state.  Without that everything else gets much harder.

We also came up with a new term: SQL Ejaculation.  That is a pattern smell where an excessive amount of your HTML comes from you SQL database.  Like the entire site.  All of the HTML.  And you have stored procedures that simply build the HTML -- in a 10,000 line stored procedure.  That is SQL Ejaculation.

Note: if this comes up in a Google search I might get worried.
<h3></h3>
<h3>After the meeting</h3>
We all went to Table Rock for a beer.  'nuf said, it is a great group.

Finally, to the guy who asked me a question after the meeting was over: I'm sorry, I just haven't had to draw multiple, overlapping, transparent images on a win form using GDI.Net in a really long time.  I know it involves alpha-transparency values, but I haven't done that in years.  Maybe you should look at WPF.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/22/netdug-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be Careful of Your Passion</title>
		<link>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=be-careful-of-your-passion</link>
		<comments>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 14:37:04 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Architecture and Design]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/02/27/be-careful-of-your-passion/</guid>
		<description><![CDATA[Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." Most of us got into this business because we liked making computers do things we [...]]]></description>
			<content:encoded><![CDATA[<p>Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." </p> <p>Most of us got into this business because we liked making computers do things we think of as cool. The most successful among us still get that rush when our new creation spools up and runs.</p> <p>Tinkerers like us tend to gold plate the pieces of our systems we find most interesting. This is why developers will often find themselves the go-to-guy for certain specialities. A dev likes making services, she makes good ones because it's fun, she gets to make more of them. Sounds perfectly reasonable and symbiotic, no?</p> <p>It can be.</p> <h2>Ignoring the Boring</h2> <p>When we get to focus exclusively on the parts of the system that really flip our bits, it can come at a price. Although we might be jazzed about services, that data model still needs our attention. It is fairly common to focus on that thing that really gets us excited and forget (or outright ignore) that part which seems boring. Just because you think someone else will come along and sweep up after doesn't make it happen. </p> <p>The most common instance of "Ignoring the Boring" is documentation. Let's face it, we want to write in languages other than English, right? Documentation is in the elegance of my self-describing code, right? Not so much. Whether we like it or not, documentation is often a deliverable of our system and as such deserves the respect we might give to our WSDL or interface definitions. Just because the reader is a human rather than a machine doesn't mean we should short change her because it's boring to do the work.</p> <h2>Smells of Sub-Optimizing</h2> <p>It is easy to see this kind of monocular behavior can result in a really clean UI with a messy back end, or visa versa. Whatever gets the short end of the stick will tend to show up in the system as a glaring deficit. We can then measure the deficit in the ignored sub-component in observable ways. Some failures of attention to detail might include:</p> <ul> <li>Lack of enforced constraints or relationships in database tables  <li>Code in the view, because it's just this one little thing  <li>Leaky abstractions, because wrapping that data model in business logic can be a real PITA  <li>No check in notes  <li>Not taking the time to do code reviews, even informally</li></ul> <h2>The System Isn't Your Playground</h2> <p>On the other end of the spectrum, what happens when we get to play with the things that <em>are</em> fun? The results can depend on what the implementer really enjoys.</p> <p>One recent real world story I heard told of a hardware engineer who designed 7 different chips within a device, each with a fundamentally different way of representing logic circuits. The chip engineer had a great time applying all the different techniques he read about in last month's <em>Nerd Fest Quarterly</em>, but the team assigned to test this Franken-board was rightly annoyed.</p> <p>Another symptom of playground development is needless abstraction layers or design patterns applied to simple problems. If a system is implemented with a gazillion abstraction layers where only a concrete implementation will do, you can bet someone is reading the <em>Gang of Four</em> in bed at night.</p> <p>If your passion is trying new tools and technologies, how many of these shiny new toys are incorporated into your system without deliberate attention? How many logging libraries does one team really need? How many unit test frameworks?</p> <p><a href="http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It" target="_blank">YAGNI</a>, 'nuff said.</p> <h2>Keep Your Passion Alive</h2> <p>So, what are you saying, Starr? Stop trying to extract pleasure from my work? Just bang the keys and give my 40 to the man? Of course not!</p> <p>I am simply asserting that there is a degree of professionalism needed at all levels. Let's care about the system as a whole and be good stewards to the craft, not just the shiny bits. And, yes, documentation is a justifiable deliverable. Cowboy up.</p> <p>Learn new techniques that fire you up and apply them wisely, not with wild abandon. Delayed gratification means not always getting to use WPF to make a draw a button, or SilverLight to make a logo spin (&lt;-- bad example). Sometimes this means capitulating to use the prescribed framework so we can get a systemic optimization instead of trying to roll our own multi-tenant web portal, yet again.</p> <p>Having more tools in our toolbox is a great thing. This is the essence of youthful fun in our work. Knowing when to use those shiny new tools is the wisdom part. Now go learn something new.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Confessions of a bad web developer</title>
		<link>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=confessions-of-a-bad-web-developer</link>
		<comments>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 03:57:55 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/</guid>
		<description><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately. Not a lot, just enough to get acquainted for right now. Yesterday I had my "Road to Damascus" incident. I don't know HTML. OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them [...]]]></description>
			<content:encoded><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately.  Not a lot, just enough to get acquainted for right now.  Yesterday I had my "Road to Damascus" incident.  I don't know HTML.

OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them without looking things up.  More importantly, I know a ton of asp.net controls.  What I don't know, specifically, is how they all work.

Like the form tag.  I know every Asp.Net page I have ever made has had one of them (and only one, at least as of .Net 1.1 that is all you were allowed).  But I don't remember how to use it any more.  How to read data from it, pass values from one page to the next.  I used to, did it a few times in fact.  Then came Asp.Net, and I haven't looked back.

Have I written JavaScript during this time?  Sort of.  If you count copying code from Google (and testing it of course).  Over the years I have large blocks of Googled JavaScript code in existing projects that I've move from page to page.  Cut-and-paste is a type of reuse...right?  And lately, when my JavaScript requirements have not been Google-able, <a href="http://jquery.com">JQuery</a> has become my savior (more posts on that soon).  But I haven't written a JavaScript object, Prototype, or any such tomfoolery since Netscape 4.8.

And just to clarify.  I once wrote my own tree control in JavaScript.  Or, I wrote one for Netscape 4.04, 4.08, 4.5, 4.75, 4.8, and IE.  I never thought I could hate a language until Netscape.  Netscape killed any love of JavaScript for me.

But now with Ajax on the scene I can't do without it anymore.  And as cool as the Asp.Net Ajax Library is and all of the things that the control toolkit can do for you: without a bit of JavaScript muscle, it just isn't going to work for you.  Take a look at the Google Maps API and tell me you aren't thinking of things that could be done with it.  But it ain't going no where without some JavaScript know-how.

CSS I have come to terms with.  I know the difference between .tag and #tag.  I've written a hover or two.  But there are still unknowns there as well.  I still visit <a href="http://w3schools.com/css">w3schools</a> regularly, and spend way too much time with <a href="http://www.getfirebug.com">FireBug</a> and <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a>.  And <a href="http://csszengarden.com">CssZenGarden</a> -- that is just beyond me right now.

But even in Asp.Net.  <a href="http://www.xefteri.com/articles/show.cfm?id=18">How does a post back work?</a> How is it that a button click is hooked up to an event handler? I'm a firm believer that their is no "magic" in programming.  Post back is magic to me.   Maybe once years ago I knew, but not anymore.

But things like: if you have a table, and every row has a check box on it, on the server side, how do you know which check box is which?  Heck, how do I figure that out on the client side with JavaScript?  The magic is ViewState, I know.  But...

That really is the beauty of WebForms.  It provides a nice insulating coat that insulates you from all of the goo that is html and JavaScript.  ViewState is my friend.  But what does this have to do with Asp.Net MVC?  Absolutely everything.

Asp.Net is a stripped down version of web development with .Net.  ViewState: gone.  asp:Button: hope you are familiar with submit.  The cozy jacket is gone and has been replaced with a wind breaker.  All those old techniques that we threw away with our last ASP page needs to be resurrected.

Being how I already live in a cold climate, I know that the biggest part of working in cold weather is to acclimated to the temperature.  Part of it as well, is knowing that you have to work in the cold climate.  So this isn't time to put things off.  Spring is still a ways off.  So, for Asp.Net WebForms developers, that means re-familiarizing yourself with a few technologies that we all thought we didn't need to know that well:
<ul>
	<li>XHML</li>
	<li>CSS</li>
	<li>JavaScript</li>
	<li>JSON</li>
	<li>JQuery</li>
	<li>Asp.Net Ajax framework</li>
</ul>
I'm not going to specify particular books.  I don't have time for that, and you can search Amazon as well as I can.  Actually, I bought a couple of these books for  at Hastings near my house.  Worth every cent.

Also worth noting what is not on my list: XML.  The language we thought was the lingua franca of the web.  I've had enough XML, and the Asp.Net Ajax library talks via JSON (which is much smaller).   So XML is out for me.  And that is fine, I think, there is enough to learn as is.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom IV</title>
		<link>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iv</link>
		<comments>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 04:48:42 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins. Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. [...]]]></description>
			<content:encoded><![CDATA[<p>If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a href="http://elegantcode.com/?p=646" target="_blank">here</a>.</p> <ol> <li>Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins.  <li>Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. .Net, as an example.  <li>If metrics are prescribed to a team, explain how they will be used. Metrics cause fear, mitigate that fear.  <li>You can prescribe Agility, but not hyper-performance.  <li>Part of the maturation process of Agile is the tendency for people to over-analyze the holy heck out of it. This is relly a reaction to the cost of software development and the incredible amounts of historical waste in the industry.  <li>CEOs do not care about code coverage. Speak to them appropriately about quality.  <li>Earned value reporting is ridiculous.  <li>"Don't wait until the customer is screaming to optimize for performance." <em>-- Thanks, Kevin</em>.  <li>Deliver less, but sooner and more often. <li>"Daddy, is that your new <a href="http://en.wikipedia.org/wiki/Out-Of-Box_Experience" target="_blank">OOBE</a>?" - My kid when I opened my new MacBook. "Yes, it is, son. Yes, it is."</li></ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom III</title>
		<link>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iii</link>
		<comments>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 04:14:20 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=664</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Carry a model at all times to express your understanding to others. Look for patterns in all systems at all levels. Seeing them is the very essence of insight. At the application level, architecture and design are synonymous. "BizTalk is overkill" [...]]]></description>
			<content:encoded><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a target="_blank" href="http://elegantcode.com/?p=646">here</a>.
<ol>
	<li>Carry a model at all times to express your understanding to others.</li>
	<li>Look for patterns in all systems at all levels. Seeing them is the very essence of insight.</li>
	<li>At the application level, architecture and design are synonymous.</li>
	<li>"BizTalk is overkill" is a typically overheard comment of <em>Drive by Architecture</em>.</li>
	<li>Developers would never prescribe BizTalk or a TIBCO or any other message bus system. That type of decision is typical of a CTO or someone who reports directly to one. These are strategic decisions.
"I think that, generally, if you're looking at something like BizTalk, you're probably looking at somebody, a directory port of a CIO or a CTO, I would say." -- Roger Session</li>
	<li>"Anything that is architecture and is specific to a particular technology is kind of an oxymoron." -- Roger Sessions</li>
	<li>Good design allows for emergent functionality, which we can also think of as purposeful evolution.</li>
	<li>The Open/Close principle doesn't mean you can't recompile. -- Allan Shalloway</li>
	<li>Fewer keystrokes != Elegant Code. Damn it! -- Dave Starr :)</li>
	<li>Architectural decisions are those that will kill your business if they are wrong.</li>
	<li>To introduce a new technology into a system, have the entire team immerse in an architectural spike, then estimate.</li>
	<li>Schedule riskiest work first. Try prioritizing a backlog by risk.</li>
	<li>The work of a developer is to uncover complexity, the work of an architect is to simplify it.</li>
	<li>A legacy system is one that is already making money.</li>
	<li>“The <a href="http://en.wikipedia.org/wiki/Winchester_Mystery_House">Winchester House</a> in San Jose is the perfect example of following a vision without a plan.”</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Ways to Stop Context Switching</title>
		<link>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iv</link>
		<comments>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 04:48:42 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins. Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. [...]]]></description>
			<content:encoded><![CDATA[<p>If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a href="http://elegantcode.com/?p=646" target="_blank">here</a>.</p> <ol> <li>Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins.  <li>Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. .Net, as an example.  <li>If metrics are prescribed to a team, explain how they will be used. Metrics cause fear, mitigate that fear.  <li>You can prescribe Agility, but not hyper-performance.  <li>Part of the maturation process of Agile is the tendency for people to over-analyze the holy heck out of it. This is relly a reaction to the cost of software development and the incredible amounts of historical waste in the industry.  <li>CEOs do not care about code coverage. Speak to them appropriately about quality.  <li>Earned value reporting is ridiculous.  <li>"Don't wait until the customer is screaming to optimize for performance." <em>-- Thanks, Kevin</em>.  <li>Deliver less, but sooner and more often. <li>"Daddy, is that your new <a href="http://en.wikipedia.org/wiki/Out-Of-Box_Experience" target="_blank">OOBE</a>?" - My kid when I opened my new MacBook. "Yes, it is, son. Yes, it is."</li></ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Elegant Code &#187; Widgets of Wisdom</title>
	<atom:link href="http://elegantcode.com/tag/widgets-of-wisdom/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 10:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Your First Developer Job</title>
		<link>http://elegantcode.com/2008/05/06/your-first-developer-job/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=your-first-developer-job</link>
		<comments>http://elegantcode.com/2008/05/06/your-first-developer-job/#comments</comments>
		<pubDate>Wed, 07 May 2008 04:45:09 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/05/06/your-first-developer-job/</guid>
		<description><![CDATA[I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see [...]]]></description>
			<content:encoded><![CDATA[<p>I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see them learn about the aspects of real life we face in developing solutions for clients. My favorite quote of the whole semester was, &quot;I don't think the client even knows what they want. I don't get it. Why are we even here?&quot; Awesome, no? Doesn't that just sum it all up? The beautiful thing about this is how the students were surprised when this happened. But I digress...</p>  <p>As we were wrapping up the last night I received what seemed like an innocent enough question from one of the students. &quot;What kind of job do you think I should look for?&quot;</p>  <p>It really caught me off guard, although I should have seen it coming. I didn't have a good answer on the tip of my tongue, and that may be because there isn't one. The CIS program is not designed specifically to churn out developers, but introduces students to all sorts of disciplines so they can pick a specialty later. For example thy study project management, requirements analysis, some programming, some networking, you get the idea. So the question really was bigger than it seemed. </p>  <p>Let's assume for this post that the person in question wanted to be a developer. Even if the person is looking to become a developer, the question what kind of employer to seek out isn't an easy one.</p>  <p>My father has worked 45 years as a mechanic for 2 employers. He is happy doing that. Many people, in fact most, are content with an occupation just like that. There is nothing in the world wrong with this; the world turns, people still live and love, people die, babies are born, all without making a life out of their career. Other people don't see things that way. They are passionate about their work and want to contribute to a higher vision of their chosen profession. I would guess if you are reading this, you see yourself in a similar light.</p>  <p>Someone develops code for the state government agencies. In fact, I have met many competent people who do exactly that. Are those developers missing out on something? Probably not in their mind, or they wouldn't be there. The point is simply that for some people a job is a job and there is no dishonor there.</p>  <p>This means my answer can't be glib, it must be realistic. You can't just say, &quot;Go somewhere Agile,&quot; or, &quot;Find a place where you can write Ruby.&quot; This is real life and sometimes grown ups balance security and risk and boredom and excitement because they have kids at home, or need special medical accommodation, or any one of a host of other considerations.</p>  <p>All that said, if you are passionate about the craft, if you want to drink in the industry, if you do want to learn as much as you can as soon as you can, I say this: Go work for a company with fewer than 50 employees building web solutions. </p>  <h2>Locus of Control</h2>  <p>As a company grows larger, the <a href="http://en.wikipedia.org/wiki/Locus_of_control" target="_blank">locus of control</a> individuals have inside the organization grows smaller. This is easy to see. </p>  <p>In smaller organizations, people tend to be jacks of all trades. If a server goes down, you care. If a defect is found, you care. If there is a client in the picture, you tend to actually know them. In short, small organizations provide first hand experience with many aspects of developing and delivering products. </p>  <p>In larger companies and teams, people tend to be expected to focus on a small niche of expertise. I cannot begin to tell you the number of resumes I have seen from people who spent years poking at HP's test harness suite or Micron's order entry system. This kind of &quot;specialization&quot; is not usually a recipe for career growth.</p>  <h2>Technology Exposure</h2>  <p>You'll get to go deep on technology because you are part of a small group that simply must make it work. There is no passing the buck, because there is no one to pass it to. You'll get to know whatever the technology stack is inside and out.</p>  <p>I recommend web development for a simple reason, the web isn't going away! Additionally, the technology involved in delivering to the web is growing at an astounding pace. I don't know what the web will evolve to&#160; in years to come, but it will be on hulluva ride.</p>  <h2>Comradery and Mentorship</h2>  <p>In a small organization, it is easier to foster a genuine sense that we are all in this together. The esprit de' corp in a smaller organization is typically tighter than in large organizations. This means you stand a better chance of falling in with someone who can actually mentor your career and take a genuine interest in your development.</p>  <p>Of course this exists in larger companies and is lacking in many smaller ones. I do think it is more generally found in smaller organizations, though.</p>  <h2>Conclusion</h2>  <p>So, what's the right answer? There isn't one, of course. There are just too many options and factors.</p>  <p>I will say that instead of ensuring your potential employer can pass <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" target="_blank">Spolsky's Joel Test</a>, it is more important to ensure you will be empowered to help them pass it if you come aboard.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/05/06/your-first-developer-job/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Many Uses of Relative Estimation</title>
		<link>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-many-uses-of-relative-estimation</link>
		<comments>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 21:57:16 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/</guid>
		<description><![CDATA[Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety. Have you ever looked at the website HotOrNot.com? It turns out that pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety.</p>  <p>Have you ever looked at the website <a href="http://www.hotornot.com/" target="_blank">HotOrNot.com</a>? It turns out that pretty much everyone from Quazzi Modo to Angelina Jolie ranks from a 4 to a 7. This is a prime example of our poor ability to estimate on a closely related value scale. It is pretty tough to tell if something is a 2 or a 3, but it is pretty easy to see the difference in size between a 5 and a 13. 13 is more than twice as big as 5, right?</p>  <p>Think about it this way: Does it really matter if something is going to take 3 hours or six hours? In software development, it typically doesn&#8217;t matter.</p>  <p>So the relative estimation model looks like this, in pursuing an estimate for piece of work A: </p>  <ol>   <li>Is this piece of work bigger or smaller than that piece of work B that we already did? </li>    <li>Bigger? OK, how much bigger? 2X bigger? 3X? </li>    <li>OK, 4X bigger. </li>    <li>Here is piece of work C that we already did. It was estimated at 4X bigger than B. Is it roughly the same size as A? </li>    <li>Yes. </li>    <li>Cool, we are done. </li> </ol>  <p>Once we understand that we can trust these relative comparisons because we are better at them than empirical estimation, it becomes much easier to size our work. Look at things you've already done and estimate the new one in relation to the previous work. We get our relative size and convert it into time, dollars, or whatever the project managers need and we are done. This is a much faster (and accurate) thing to do than to break it down into tasks and estimate each task. Why? Because we will never get the tasking right.</p>  <p>There is a ton more that could be said (and has) on relative estimation, but remember this: The next time you have to estimate a project for your manager, make it easier on yourself by doing a relative size first. You'll get back to coding much faster and you'll find the numbers are amazingly accurate.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Opposite of a Singleton?</title>
		<link>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-opposite-of-a-singleton</link>
		<comments>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 03:42:22 +0000</pubDate>
		<dc:creator>Alex Mueller</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/</guid>
		<description><![CDATA[I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to [...]]]></description>
			<content:encoded><![CDATA[<p>I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to the inverse object as a &quot;new object.&quot; As I pondered this later in the day, I considered adjectives describing the nature of objects. They can be many things, but two concepts that popped into my head to classify them were &quot;complex&quot; and &quot;simple.&quot; </p>  <p>I started playing with the words and making them resemble singleton. &quot;Complexton&quot; did not sound right to me. I should mention that I was washing my hands as I was contemplating this. I lifted up my head, looked into the mirror, and thought, &quot;SIMPLETON.&quot; The opposite of a singleton is a &quot;simpleton.&quot;</p>  <p>If the opposite of a singleton is not a &quot;simpleton,&quot; then what is it? Until I find a plausible answer, I will try and insert this new term into my next design discussion. </p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What is Elegant Code to me?</title>
		<link>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-is-elegant-code-to-me</link>
		<comments>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 03:47:45 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/</guid>
		<description><![CDATA[This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&#160; It isn't easy to describe.&#160; And really, the notion of what constitutes elegance in code changes over time.&#160; There is no static "this is good code" test, and I doubt there ever will be.&#160; Plus, [...]]]></description>
			<content:encoded><![CDATA[<p>This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&nbsp; It isn't easy to describe.&nbsp; And really, the notion of what constitutes elegance in code changes over time.&nbsp; There is no static "this is good code" test, and I doubt there ever will be.&nbsp; Plus, what makes good code in one language, may not apply to the next.</p> <p>So let me state for the record: today's elegant code is tomorrow's drivel.&nbsp; Don't feel bad, many writers have the same problems.&nbsp; What was super amazing back in the day is now rubbish or near unreadable.&nbsp; I am thinking of the Victorian writing that Hemingway usurped, and now Hemingway himself is almost unreadable (to me anyway).&nbsp; Tastes change with the times.&nbsp; That is a simple fact.</p> <p>So what can you do about this?&nbsp; As I say that old writing sucks to read (read Washington Irvine lately?), great works of literature still abound (for instance, Hemingway is still a great writer -- even if I prefer Tolkien) .&nbsp; So take some notes from them, and from other crafts in looking for the answer.&nbsp; If you want a cliff notes version of what this is going to tell you, it is this: you must always push yourself to get better.</p> <ol> <li>Find a good teacher.&nbsp; Nothing is better than sitting at the feet of a master who can nudge you along in the right direction.&nbsp; While early mistakes can often be corrected easily with a little bit of guidance, after they have had some time to fester all bets are off.&nbsp; I believe a fare number of "Anit-patterns" were created by self taught developers (find <a href="http://elegantcode.com/2008/03/21/sql-ejaculation/">SQL Ejaculation</a> on this site).&nbsp; <li>Read.&nbsp;&nbsp; Good writer are first good readers.&nbsp; Start with Code Complete, move into a good Patterns book, get MSDN Magazine, find some bloggers your like, but keep moving.&nbsp; You will NEVER be done reading.&nbsp; I imagine that even Martin Fowler has a "to read" booklist a mile long.  <li>Read code.&nbsp;&nbsp; There are a plethora of open source project just waiting to be read -- do so.&nbsp; This is the single best way to expand your coding repertoire, find things your language can do that you didn't even know about..&nbsp;&nbsp; Scott Hanselman has recently popularized this idea, and I thank him for it.  <li>Practice.&nbsp; This means writing small applications at home.&nbsp; You get an idea that you want to try out -- do it.&nbsp; I don't mean you have to write finished applications, just have some exploring time.&nbsp; I remember talking with an 80 year old master woodworker (he lives down the street from me), who was telling me how many time he would practice making dovetail joints before he felt competent.&nbsp; It was years worth.  <li>Pay Attention.&nbsp; Being good at anything really amounts to that.&nbsp; And don't just pay attention when reading, writing, or talking about code.&nbsp; Inspiration come from everywhere, any good artist will tell you that.&nbsp; Pay attention when you cook, when you work on the car, when you are wood working, playing an instrument, whatever it is that you do.&nbsp; This will help you in the end, event if it is just learning the amount of dedication it really takes to become good at something.  <li>Beware of preferences.&nbsp; Any time I hear someone start a statement with "I prefer code to ..." you know things are going downhill.&nbsp; If you find someone who cares more about how your code is formatted then how it is written you have found yourself in a mess.&nbsp; More importantly, beware of them in yourself.&nbsp;&nbsp; Having code style standard is important, but it isn't worth loosing sleep over.&nbsp; This also pertains to inheritance, patterns, use of particular classes (e.g. always using the generic list class in C# when a Dictionary would be better).&nbsp; <li>No Sacred Cows. Believe no single source of information.&nbsp; This means not thinking that Microsoft, Sun, IBM, Richard Stallman, or anyone else will have all of the correct answers.&nbsp; Apply the scientific method and do some research, experiment, and question the authority.&nbsp;&nbsp; There should be no sacred cows in programming.  <li>Talk with others.&nbsp; Join a user group, show up every now and then, heckle the presenter, and -maybe- speak.&nbsp; You want a broad range of people who you can talk to and bounce ideas off of.&nbsp; This will help you from becoming that crazy guy in the corner who vehemently states that all your code should be in one file.&nbsp; Having a mentor (mentioned earlier) is great, but having people around to push you from multiple directions is also good.  <li>Learn languages.&nbsp; This gets back to the "read code" idea. Make that multiple types of languages as well.&nbsp; If you know C# or Java and SQL, learn Python or Ruby, get really good at JavaScript.&nbsp; If you want something really out there, learn MDX.&nbsp; This is also a repertoire thing.&nbsp; Seeing how other languages work will make you rethink your ideas about what your current code, in whatever languages you are working in, should look like.  <li>Keep Thinking!!!&nbsp; That is possibly the most important point.&nbsp; Keep thinking.&nbsp; Don't just evaluate something once and never return, go back and reevaluate. Did the technique work?&nbsp; How could it have been better?&nbsp;&nbsp; The idea is continual improvement.  <li>Switch jobs every now and then.&nbsp; When I announced I was leaving my first programming job out of college, the VP of R&amp;D had me sit down with him and talk.&nbsp; He wasn't trying to keep me (he knew I was moving to be closer to family), he wanted to give me some advice.&nbsp; He told me to change jobs every three years.&nbsp; After you have been with a place for three years you have probably learned everything you are going to learn and it time to move on.&nbsp; This doesn't mean changing companies either.&nbsp; I've been with the same company now for four years, but I've had three different jobs.&nbsp; If you have been writing commercial applications, become a consultant - or vise-versa, become a test engineer, expand your boundaries.&nbsp; Again, this is about pushing yourself to be better.  <li>Have a Hobby. But don't ask about me, I have too many.&nbsp;&nbsp; Creating software is about creating things.&nbsp; So I suggest picking a hobby that involves creating something.&nbsp; Popular hobbies amongst programmers I know include: cooking, music, woodworking, beer making, and BBQ (which is different than cooking).&nbsp; But don't discount sports (golf is always popular), computer games, and board games.&nbsp; Anything that promotes the development of skill levels can't be a bad thing. </li></ol> <p>And I'm stopping there.&nbsp; This is my beginner's guide to how to become the writer elegant code.&nbsp; If you have others you think I missed, add them too the comments.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NetDug Unit Testing</title>
		<link>http://elegantcode.com/2008/03/22/netdug-unit-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=netdug-unit-testing</link>
		<comments>http://elegantcode.com/2008/03/22/netdug-unit-testing/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 21:00:30 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/22/netdug-unit-testing/</guid>
		<description><![CDATA[So last night I had the opportunity to be the moderator at NetDug, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk [...]]]></description>
			<content:encoded><![CDATA[So last night I had the opportunity to be the moderator at <a href="http://www.netdug.com">NetDug</a>, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk with 20 slides, I think I showed about 5 of them.  I consider that a success (I threatened the audience, the less they talked, the more slides I would show).

<a href="http://elegantcode.com/wp-content/uploads/2008/03/unittestingdemo.zip">Slides and sample code</a>

What I learned from last night:
<ol>
	<li>I'm not much of a moderator (I talk to much)</li>
	<li>Code coverage is a art in divination</li>
	<li>Mock/Stub/Fake Objects are hard to explain</li>
	<li>Over use Mocks could be a code smell</li>
	<li>The discussion format actually works pretty well for talking about unit testing</li>
	<li>If you give geeks a chance to talk, they will talk</li>
</ol>
What I hope everyone else got from the topic:
<ol>
	<li>Unit testing forces you to write better code</li>
	<li>Unit testing forces you to use better object oriented principles</li>
</ol>
<h3>Test Technology</h3>
This was an early question, what technologies to use to test your code.  <a href="http://www.nunit.org/index.php">NUnit</a>, MSUnit, and <a href="http://www.mbunit.com/">MBUnit</a> were all mentioned and viable, and stable, technologies.  For mock objects (which you are going to need) there is <a href="http://www.ayende.com/projects/rhino-mocks/downloads.aspx">Rhino Mocks</a> and <a href="http://www.typemock.com/">TypeMock</a>.  I suggest Rhino Mocks over <a href="http://www.typemock.com/">TypeMock</a> for anyone who can't purchase the full version of <a href="http://www.typemock.com/">TypeMock</a> (but there is a nice free version as well).

Then there are the helper technologies: <a href="http://testdriven.net">TestDriven.Net</a> and <a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> are the main two, but apparently MSUnit's runner isn't bad either (I haven't used it yet).  All of these tools make it easier to run your unit tests from inside Visual Studio, and each has other benefits.  <a href="http://testdriven.net">TestDriven.Net</a> has wonderful Reflector integration (a better object browser), and ReSharper...<a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> is just a must have (that is me talking, not the group).
<h3>Code Coverage</h3>
Code Coverage, using tools like <a href="http://www.ncover.com/">NCover</a> (<a href="http://www.ncover.com/download/discontinued">free version</a>), tell you how much of your code base is tested.  This was one of the early questions.  How much of your code base should be tested?  Answer: it depends on the product.  My view is that a library (no UI element) should have +90% coverage, if there is a substantial amount of UI then the project can get down to 60%.  If your code coverage gets below that you just aren't trying, or you need to rethink your architecture. 

I did talk a bit about code that was not really testable (not in an automated way anyway): UI, Database code, and external resource code are all potentially untestable.  More on this in a moment.

Database code is not testable if you can't return the database to a known state (you can restore the database data). 

UI code testing should be avoided because UI tests have to be so bound to the UI that they are brittle.  So you end up spending a considerable portion of your development time fixing broken test. Brittle tests are to be avoided whenever possible.
<h3>Testing existing code</h3>
Probably the hardest question to answer from last night was: how do you test existing code bases.  And that came up over and over.  Do you start with integration tests and then work in unit tests, or the other way around. 

I will admit, most of the time when I talk about unit testing, I center it around new projects.  Unit test is hard enough with new code, testing old code that wasn't written with unit test in mind is a migraine waiting to happen.

The audience did have some good advice though.  Pick parts of the project that you need to work on (say one class) and make that testable and tested.  Essentially you start creating silos of tested code.  The other suggestion (and I actually had a slide for this) was to get the book: <a href="http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206114497&amp;sr=8-1">Working Effectively with Legacy Code</a>.  Finally, buy TypeMock -- the big boy version, not the free-be version.  You'll need it.
<h3>UI Testing</h3>
This is my treatise on writing unit tests for the User Interface:

1. Don't do it until you are done with the UI.
2. Only test that the UI works in a basic sense.
3. You still have to test the UI by hand.

If you start writing UI tests while you are developing the UI, you will continually break the tests.  Writing the test by hand is none trivial, and using tools to write them is also error prone.  Finally, these tests can't tell you if the UI is just bad.  Only exposure can tell you that.  Every developer should be forced to have to use their UI repeatedly so they know where is sucks.  You wont get that with automated UI tests.

That said, there are tools to help you test web user interfaces. <a href="http://watin.sourceforge.net/">Watin</a>, <a href="http://wtr.rubyforge.org/">Watir</a>, and <a href="http://selenium.openqa.org/">Selenium</a> are all there to help.  We shall see if Team Systems adds anything to help with this (I'm hoping it does).
<h3>Testing Database code</h3>
This is essentially, testing code that touches the database.  Could be your <a href="http://www.hibernate.org/343.html">NHibernate</a> code, could be a stored procedure, could be ADO.Net code.  But really, this is just code that must touch an outside resource (database, file system, serial connection, etc) and there is no way, or point, to abstract it out any further.

The main point here was to have a way to get the data back to a known state.  Without that everything else gets much harder.

We also came up with a new term: SQL Ejaculation.  That is a pattern smell where an excessive amount of your HTML comes from you SQL database.  Like the entire site.  All of the HTML.  And you have stored procedures that simply build the HTML -- in a 10,000 line stored procedure.  That is SQL Ejaculation.

Note: if this comes up in a Google search I might get worried.
<h3></h3>
<h3>After the meeting</h3>
We all went to Table Rock for a beer.  'nuf said, it is a great group.

Finally, to the guy who asked me a question after the meeting was over: I'm sorry, I just haven't had to draw multiple, overlapping, transparent images on a win form using GDI.Net in a really long time.  I know it involves alpha-transparency values, but I haven't done that in years.  Maybe you should look at WPF.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/22/netdug-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be Careful of Your Passion</title>
		<link>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=be-careful-of-your-passion</link>
		<comments>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 14:37:04 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Architecture and Design]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/02/27/be-careful-of-your-passion/</guid>
		<description><![CDATA[Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." Most of us got into this business because we liked making computers do things we [...]]]></description>
			<content:encoded><![CDATA[<p>Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." </p> <p>Most of us got into this business because we liked making computers do things we think of as cool. The most successful among us still get that rush when our new creation spools up and runs.</p> <p>Tinkerers like us tend to gold plate the pieces of our systems we find most interesting. This is why developers will often find themselves the go-to-guy for certain specialities. A dev likes making services, she makes good ones because it's fun, she gets to make more of them. Sounds perfectly reasonable and symbiotic, no?</p> <p>It can be.</p> <h2>Ignoring the Boring</h2> <p>When we get to focus exclusively on the parts of the system that really flip our bits, it can come at a price. Although we might be jazzed about services, that data model still needs our attention. It is fairly common to focus on that thing that really gets us excited and forget (or outright ignore) that part which seems boring. Just because you think someone else will come along and sweep up after doesn't make it happen. </p> <p>The most common instance of "Ignoring the Boring" is documentation. Let's face it, we want to write in languages other than English, right? Documentation is in the elegance of my self-describing code, right? Not so much. Whether we like it or not, documentation is often a deliverable of our system and as such deserves the respect we might give to our WSDL or interface definitions. Just because the reader is a human rather than a machine doesn't mean we should short change her because it's boring to do the work.</p> <h2>Smells of Sub-Optimizing</h2> <p>It is easy to see this kind of monocular behavior can result in a really clean UI with a messy back end, or visa versa. Whatever gets the short end of the stick will tend to show up in the system as a glaring deficit. We can then measure the deficit in the ignored sub-component in observable ways. Some failures of attention to detail might include:</p> <ul> <li>Lack of enforced constraints or relationships in database tables  <li>Code in the view, because it's just this one little thing  <li>Leaky abstractions, because wrapping that data model in business logic can be a real PITA  <li>No check in notes  <li>Not taking the time to do code reviews, even informally</li></ul> <h2>The System Isn't Your Playground</h2> <p>On the other end of the spectrum, what happens when we get to play with the things that <em>are</em> fun? The results can depend on what the implementer really enjoys.</p> <p>One recent real world story I heard told of a hardware engineer who designed 7 different chips within a device, each with a fundamentally different way of representing logic circuits. The chip engineer had a great time applying all the different techniques he read about in last month's <em>Nerd Fest Quarterly</em>, but the team assigned to test this Franken-board was rightly annoyed.</p> <p>Another symptom of playground development is needless abstraction layers or design patterns applied to simple problems. If a system is implemented with a gazillion abstraction layers where only a concrete implementation will do, you can bet someone is reading the <em>Gang of Four</em> in bed at night.</p> <p>If your passion is trying new tools and technologies, how many of these shiny new toys are incorporated into your system without deliberate attention? How many logging libraries does one team really need? How many unit test frameworks?</p> <p><a href="http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It" target="_blank">YAGNI</a>, 'nuff said.</p> <h2>Keep Your Passion Alive</h2> <p>So, what are you saying, Starr? Stop trying to extract pleasure from my work? Just bang the keys and give my 40 to the man? Of course not!</p> <p>I am simply asserting that there is a degree of professionalism needed at all levels. Let's care about the system as a whole and be good stewards to the craft, not just the shiny bits. And, yes, documentation is a justifiable deliverable. Cowboy up.</p> <p>Learn new techniques that fire you up and apply them wisely, not with wild abandon. Delayed gratification means not always getting to use WPF to make a draw a button, or SilverLight to make a logo spin (&lt;-- bad example). Sometimes this means capitulating to use the prescribed framework so we can get a systemic optimization instead of trying to roll our own multi-tenant web portal, yet again.</p> <p>Having more tools in our toolbox is a great thing. This is the essence of youthful fun in our work. Knowing when to use those shiny new tools is the wisdom part. Now go learn something new.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Confessions of a bad web developer</title>
		<link>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=confessions-of-a-bad-web-developer</link>
		<comments>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 03:57:55 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/</guid>
		<description><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately. Not a lot, just enough to get acquainted for right now. Yesterday I had my "Road to Damascus" incident. I don't know HTML. OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them [...]]]></description>
			<content:encoded><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately.  Not a lot, just enough to get acquainted for right now.  Yesterday I had my "Road to Damascus" incident.  I don't know HTML.

OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them without looking things up.  More importantly, I know a ton of asp.net controls.  What I don't know, specifically, is how they all work.

Like the form tag.  I know every Asp.Net page I have ever made has had one of them (and only one, at least as of .Net 1.1 that is all you were allowed).  But I don't remember how to use it any more.  How to read data from it, pass values from one page to the next.  I used to, did it a few times in fact.  Then came Asp.Net, and I haven't looked back.

Have I written JavaScript during this time?  Sort of.  If you count copying code from Google (and testing it of course).  Over the years I have large blocks of Googled JavaScript code in existing projects that I've move from page to page.  Cut-and-paste is a type of reuse...right?  And lately, when my JavaScript requirements have not been Google-able, <a href="http://jquery.com">JQuery</a> has become my savior (more posts on that soon).  But I haven't written a JavaScript object, Prototype, or any such tomfoolery since Netscape 4.8.

And just to clarify.  I once wrote my own tree control in JavaScript.  Or, I wrote one for Netscape 4.04, 4.08, 4.5, 4.75, 4.8, and IE.  I never thought I could hate a language until Netscape.  Netscape killed any love of JavaScript for me.

But now with Ajax on the scene I can't do without it anymore.  And as cool as the Asp.Net Ajax Library is and all of the things that the control toolkit can do for you: without a bit of JavaScript muscle, it just isn't going to work for you.  Take a look at the Google Maps API and tell me you aren't thinking of things that could be done with it.  But it ain't going no where without some JavaScript know-how.

CSS I have come to terms with.  I know the difference between .tag and #tag.  I've written a hover or two.  But there are still unknowns there as well.  I still visit <a href="http://w3schools.com/css">w3schools</a> regularly, and spend way too much time with <a href="http://www.getfirebug.com">FireBug</a> and <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a>.  And <a href="http://csszengarden.com">CssZenGarden</a> -- that is just beyond me right now.

But even in Asp.Net.  <a href="http://www.xefteri.com/articles/show.cfm?id=18">How does a post back work?</a> How is it that a button click is hooked up to an event handler? I'm a firm believer that their is no "magic" in programming.  Post back is magic to me.   Maybe once years ago I knew, but not anymore.

But things like: if you have a table, and every row has a check box on it, on the server side, how do you know which check box is which?  Heck, how do I figure that out on the client side with JavaScript?  The magic is ViewState, I know.  But...

That really is the beauty of WebForms.  It provides a nice insulating coat that insulates you from all of the goo that is html and JavaScript.  ViewState is my friend.  But what does this have to do with Asp.Net MVC?  Absolutely everything.

Asp.Net is a stripped down version of web development with .Net.  ViewState: gone.  asp:Button: hope you are familiar with submit.  The cozy jacket is gone and has been replaced with a wind breaker.  All those old techniques that we threw away with our last ASP page needs to be resurrected.

Being how I already live in a cold climate, I know that the biggest part of working in cold weather is to acclimated to the temperature.  Part of it as well, is knowing that you have to work in the cold climate.  So this isn't time to put things off.  Spring is still a ways off.  So, for Asp.Net WebForms developers, that means re-familiarizing yourself with a few technologies that we all thought we didn't need to know that well:
<ul>
	<li>XHML</li>
	<li>CSS</li>
	<li>JavaScript</li>
	<li>JSON</li>
	<li>JQuery</li>
	<li>Asp.Net Ajax framework</li>
</ul>
I'm not going to specify particular books.  I don't have time for that, and you can search Amazon as well as I can.  Actually, I bought a couple of these books for  at Hastings near my house.  Worth every cent.

Also worth noting what is not on my list: XML.  The language we thought was the lingua franca of the web.  I've had enough XML, and the Asp.Net Ajax library talks via JSON (which is much smaller).   So XML is out for me.  And that is fine, I think, there is enough to learn as is.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom IV</title>
		<link>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iv</link>
		<comments>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 04:48:42 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins. Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. [...]]]></description>
			<content:encoded><![CDATA[<p>If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a href="http://elegantcode.com/?p=646" target="_blank">here</a>.</p> <ol> <li>Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins.  <li>Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. .Net, as an example.  <li>If metrics are prescribed to a team, explain how they will be used. Metrics cause fear, mitigate that fear.  <li>You can prescribe Agility, but not hyper-performance.  <li>Part of the maturation process of Agile is the tendency for people to over-analyze the holy heck out of it. This is relly a reaction to the cost of software development and the incredible amounts of historical waste in the industry.  <li>CEOs do not care about code coverage. Speak to them appropriately about quality.  <li>Earned value reporting is ridiculous.  <li>"Don't wait until the customer is screaming to optimize for performance." <em>-- Thanks, Kevin</em>.  <li>Deliver less, but sooner and more often. <li>"Daddy, is that your new <a href="http://en.wikipedia.org/wiki/Out-Of-Box_Experience" target="_blank">OOBE</a>?" - My kid when I opened my new MacBook. "Yes, it is, son. Yes, it is."</li></ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom III</title>
		<link>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iii</link>
		<comments>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 04:14:20 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=664</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Carry a model at all times to express your understanding to others. Look for patterns in all systems at all levels. Seeing them is the very essence of insight. At the application level, architecture and design are synonymous. "BizTalk is overkill" [...]]]></description>
			<content:encoded><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a target="_blank" href="http://elegantcode.com/?p=646">here</a>.
<ol>
	<li>Carry a model at all times to express your understanding to others.</li>
	<li>Look for patterns in all systems at all levels. Seeing them is the very essence of insight.</li>
	<li>At the application level, architecture and design are synonymous.</li>
	<li>"BizTalk is overkill" is a typically overheard comment of <em>Drive by Architecture</em>.</li>
	<li>Developers would never prescribe BizTalk or a TIBCO or any other message bus system. That type of decision is typical of a CTO or someone who reports directly to one. These are strategic decisions.
"I think that, generally, if you're looking at something like BizTalk, you're probably looking at somebody, a directory port of a CIO or a CTO, I would say." -- Roger Session</li>
	<li>"Anything that is architecture and is specific to a particular technology is kind of an oxymoron." -- Roger Sessions</li>
	<li>Good design allows for emergent functionality, which we can also think of as purposeful evolution.</li>
	<li>The Open/Close principle doesn't mean you can't recompile. -- Allan Shalloway</li>
	<li>Fewer keystrokes != Elegant Code. Damn it! -- Dave Starr :)</li>
	<li>Architectural decisions are those that will kill your business if they are wrong.</li>
	<li>To introduce a new technology into a system, have the entire team immerse in an architectural spike, then estimate.</li>
	<li>Schedule riskiest work first. Try prioritizing a backlog by risk.</li>
	<li>The work of a developer is to uncover complexity, the work of an architect is to simplify it.</li>
	<li>A legacy system is one that is already making money.</li>
	<li>“The <a href="http://en.wikipedia.org/wiki/Winchester_Mystery_House">Winchester House</a> in San Jose is the perfect example of following a vision without a plan.”</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Ways to Stop Context Switching</title>
		<link>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iii</link>
		<comments>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 04:14:20 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=664</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Carry a model at all times to express your understanding to others. Look for patterns in all systems at all levels. Seeing them is the very essence of insight. At the application level, architecture and design are synonymous. "BizTalk is overkill" [...]]]></description>
			<content:encoded><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a target="_blank" href="http://elegantcode.com/?p=646">here</a>.
<ol>
	<li>Carry a model at all times to express your understanding to others.</li>
	<li>Look for patterns in all systems at all levels. Seeing them is the very essence of insight.</li>
	<li>At the application level, architecture and design are synonymous.</li>
	<li>"BizTalk is overkill" is a typically overheard comment of <em>Drive by Architecture</em>.</li>
	<li>Developers would never prescribe BizTalk or a TIBCO or any other message bus system. That type of decision is typical of a CTO or someone who reports directly to one. These are strategic decisions.
"I think that, generally, if you're looking at something like BizTalk, you're probably looking at somebody, a directory port of a CIO or a CTO, I would say." -- Roger Session</li>
	<li>"Anything that is architecture and is specific to a particular technology is kind of an oxymoron." -- Roger Sessions</li>
	<li>Good design allows for emergent functionality, which we can also think of as purposeful evolution.</li>
	<li>The Open/Close principle doesn't mean you can't recompile. -- Allan Shalloway</li>
	<li>Fewer keystrokes != Elegant Code. Damn it! -- Dave Starr :)</li>
	<li>Architectural decisions are those that will kill your business if they are wrong.</li>
	<li>To introduce a new technology into a system, have the entire team immerse in an architectural spike, then estimate.</li>
	<li>Schedule riskiest work first. Try prioritizing a backlog by risk.</li>
	<li>The work of a developer is to uncover complexity, the work of an architect is to simplify it.</li>
	<li>A legacy system is one that is already making money.</li>
	<li>“The <a href="http://en.wikipedia.org/wiki/Winchester_Mystery_House">Winchester House</a> in San Jose is the perfect example of following a vision without a plan.”</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Elegant Code &#187; Widgets of Wisdom</title>
	<atom:link href="http://elegantcode.com/tag/widgets-of-wisdom/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 10:00:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Your First Developer Job</title>
		<link>http://elegantcode.com/2008/05/06/your-first-developer-job/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=your-first-developer-job</link>
		<comments>http://elegantcode.com/2008/05/06/your-first-developer-job/#comments</comments>
		<pubDate>Wed, 07 May 2008 04:45:09 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/05/06/your-first-developer-job/</guid>
		<description><![CDATA[I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see [...]]]></description>
			<content:encoded><![CDATA[<p>I worked with a class of graduating seniors in the CIS program at Boise State University this last semester and really enjoyed the experience. The students were working on real projects with actual clients applying the skills they received throughout their program. I learned some things from the students and it was interesting to see them learn about the aspects of real life we face in developing solutions for clients. My favorite quote of the whole semester was, &quot;I don't think the client even knows what they want. I don't get it. Why are we even here?&quot; Awesome, no? Doesn't that just sum it all up? The beautiful thing about this is how the students were surprised when this happened. But I digress...</p>  <p>As we were wrapping up the last night I received what seemed like an innocent enough question from one of the students. &quot;What kind of job do you think I should look for?&quot;</p>  <p>It really caught me off guard, although I should have seen it coming. I didn't have a good answer on the tip of my tongue, and that may be because there isn't one. The CIS program is not designed specifically to churn out developers, but introduces students to all sorts of disciplines so they can pick a specialty later. For example thy study project management, requirements analysis, some programming, some networking, you get the idea. So the question really was bigger than it seemed. </p>  <p>Let's assume for this post that the person in question wanted to be a developer. Even if the person is looking to become a developer, the question what kind of employer to seek out isn't an easy one.</p>  <p>My father has worked 45 years as a mechanic for 2 employers. He is happy doing that. Many people, in fact most, are content with an occupation just like that. There is nothing in the world wrong with this; the world turns, people still live and love, people die, babies are born, all without making a life out of their career. Other people don't see things that way. They are passionate about their work and want to contribute to a higher vision of their chosen profession. I would guess if you are reading this, you see yourself in a similar light.</p>  <p>Someone develops code for the state government agencies. In fact, I have met many competent people who do exactly that. Are those developers missing out on something? Probably not in their mind, or they wouldn't be there. The point is simply that for some people a job is a job and there is no dishonor there.</p>  <p>This means my answer can't be glib, it must be realistic. You can't just say, &quot;Go somewhere Agile,&quot; or, &quot;Find a place where you can write Ruby.&quot; This is real life and sometimes grown ups balance security and risk and boredom and excitement because they have kids at home, or need special medical accommodation, or any one of a host of other considerations.</p>  <p>All that said, if you are passionate about the craft, if you want to drink in the industry, if you do want to learn as much as you can as soon as you can, I say this: Go work for a company with fewer than 50 employees building web solutions. </p>  <h2>Locus of Control</h2>  <p>As a company grows larger, the <a href="http://en.wikipedia.org/wiki/Locus_of_control" target="_blank">locus of control</a> individuals have inside the organization grows smaller. This is easy to see. </p>  <p>In smaller organizations, people tend to be jacks of all trades. If a server goes down, you care. If a defect is found, you care. If there is a client in the picture, you tend to actually know them. In short, small organizations provide first hand experience with many aspects of developing and delivering products. </p>  <p>In larger companies and teams, people tend to be expected to focus on a small niche of expertise. I cannot begin to tell you the number of resumes I have seen from people who spent years poking at HP's test harness suite or Micron's order entry system. This kind of &quot;specialization&quot; is not usually a recipe for career growth.</p>  <h2>Technology Exposure</h2>  <p>You'll get to go deep on technology because you are part of a small group that simply must make it work. There is no passing the buck, because there is no one to pass it to. You'll get to know whatever the technology stack is inside and out.</p>  <p>I recommend web development for a simple reason, the web isn't going away! Additionally, the technology involved in delivering to the web is growing at an astounding pace. I don't know what the web will evolve to&#160; in years to come, but it will be on hulluva ride.</p>  <h2>Comradery and Mentorship</h2>  <p>In a small organization, it is easier to foster a genuine sense that we are all in this together. The esprit de' corp in a smaller organization is typically tighter than in large organizations. This means you stand a better chance of falling in with someone who can actually mentor your career and take a genuine interest in your development.</p>  <p>Of course this exists in larger companies and is lacking in many smaller ones. I do think it is more generally found in smaller organizations, though.</p>  <h2>Conclusion</h2>  <p>So, what's the right answer? There isn't one, of course. There are just too many options and factors.</p>  <p>I will say that instead of ensuring your potential employer can pass <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" target="_blank">Spolsky's Joel Test</a>, it is more important to ensure you will be empowered to help them pass it if you come aboard.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/05/06/your-first-developer-job/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Many Uses of Relative Estimation</title>
		<link>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-many-uses-of-relative-estimation</link>
		<comments>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 21:57:16 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/</guid>
		<description><![CDATA[Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety. Have you ever looked at the website HotOrNot.com? It turns out that pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Poker Planning is a favorite technique of many people, including me. I like this technique of estimation because it lets us make estimates in relative terms. People are notoriously bad at absolute estimation of the &#8220;rank this item one to ten&#8221;, variety.</p>  <p>Have you ever looked at the website <a href="http://www.hotornot.com/" target="_blank">HotOrNot.com</a>? It turns out that pretty much everyone from Quazzi Modo to Angelina Jolie ranks from a 4 to a 7. This is a prime example of our poor ability to estimate on a closely related value scale. It is pretty tough to tell if something is a 2 or a 3, but it is pretty easy to see the difference in size between a 5 and a 13. 13 is more than twice as big as 5, right?</p>  <p>Think about it this way: Does it really matter if something is going to take 3 hours or six hours? In software development, it typically doesn&#8217;t matter.</p>  <p>So the relative estimation model looks like this, in pursuing an estimate for piece of work A: </p>  <ol>   <li>Is this piece of work bigger or smaller than that piece of work B that we already did? </li>    <li>Bigger? OK, how much bigger? 2X bigger? 3X? </li>    <li>OK, 4X bigger. </li>    <li>Here is piece of work C that we already did. It was estimated at 4X bigger than B. Is it roughly the same size as A? </li>    <li>Yes. </li>    <li>Cool, we are done. </li> </ol>  <p>Once we understand that we can trust these relative comparisons because we are better at them than empirical estimation, it becomes much easier to size our work. Look at things you've already done and estimate the new one in relation to the previous work. We get our relative size and convert it into time, dollars, or whatever the project managers need and we are done. This is a much faster (and accurate) thing to do than to break it down into tasks and estimate each task. Why? Because we will never get the tasking right.</p>  <p>There is a ton more that could be said (and has) on relative estimation, but remember this: The next time you have to estimate a project for your manager, make it easier on yourself by doing a relative size first. You'll get back to coding much faster and you'll find the numbers are amazingly accurate.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/25/the-many-uses-of-relative-estimation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Opposite of a Singleton?</title>
		<link>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-opposite-of-a-singleton</link>
		<comments>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 03:42:22 +0000</pubDate>
		<dc:creator>Alex Mueller</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/</guid>
		<description><![CDATA[I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to [...]]]></description>
			<content:encoded><![CDATA[<p>I was in a design discussion today and mentioned the need for a singleton object in our solution. Further along in the discussion I was trying to find a word that describes the opposite of a singleton, but alas, I struggled to find a word that may or may not exist. I just referred to the inverse object as a &quot;new object.&quot; As I pondered this later in the day, I considered adjectives describing the nature of objects. They can be many things, but two concepts that popped into my head to classify them were &quot;complex&quot; and &quot;simple.&quot; </p>  <p>I started playing with the words and making them resemble singleton. &quot;Complexton&quot; did not sound right to me. I should mention that I was washing my hands as I was contemplating this. I lifted up my head, looked into the mirror, and thought, &quot;SIMPLETON.&quot; The opposite of a singleton is a &quot;simpleton.&quot;</p>  <p>If the opposite of a singleton is not a &quot;simpleton,&quot; then what is it? Until I find a plausible answer, I will try and insert this new term into my next design discussion. </p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/04/17/the-opposite-of-a-singleton/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>What is Elegant Code to me?</title>
		<link>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-is-elegant-code-to-me</link>
		<comments>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 03:47:45 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Patterns and Practices]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/</guid>
		<description><![CDATA[This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&#160; It isn't easy to describe.&#160; And really, the notion of what constitutes elegance in code changes over time.&#160; There is no static "this is good code" test, and I doubt there ever will be.&#160; Plus, [...]]]></description>
			<content:encoded><![CDATA[<p>This question keeps popping up around here ("around here" being the loose conglomeration that makes up the Elegant Code group).&nbsp; It isn't easy to describe.&nbsp; And really, the notion of what constitutes elegance in code changes over time.&nbsp; There is no static "this is good code" test, and I doubt there ever will be.&nbsp; Plus, what makes good code in one language, may not apply to the next.</p> <p>So let me state for the record: today's elegant code is tomorrow's drivel.&nbsp; Don't feel bad, many writers have the same problems.&nbsp; What was super amazing back in the day is now rubbish or near unreadable.&nbsp; I am thinking of the Victorian writing that Hemingway usurped, and now Hemingway himself is almost unreadable (to me anyway).&nbsp; Tastes change with the times.&nbsp; That is a simple fact.</p> <p>So what can you do about this?&nbsp; As I say that old writing sucks to read (read Washington Irvine lately?), great works of literature still abound (for instance, Hemingway is still a great writer -- even if I prefer Tolkien) .&nbsp; So take some notes from them, and from other crafts in looking for the answer.&nbsp; If you want a cliff notes version of what this is going to tell you, it is this: you must always push yourself to get better.</p> <ol> <li>Find a good teacher.&nbsp; Nothing is better than sitting at the feet of a master who can nudge you along in the right direction.&nbsp; While early mistakes can often be corrected easily with a little bit of guidance, after they have had some time to fester all bets are off.&nbsp; I believe a fare number of "Anit-patterns" were created by self taught developers (find <a href="http://elegantcode.com/2008/03/21/sql-ejaculation/">SQL Ejaculation</a> on this site).&nbsp; <li>Read.&nbsp;&nbsp; Good writer are first good readers.&nbsp; Start with Code Complete, move into a good Patterns book, get MSDN Magazine, find some bloggers your like, but keep moving.&nbsp; You will NEVER be done reading.&nbsp; I imagine that even Martin Fowler has a "to read" booklist a mile long.  <li>Read code.&nbsp;&nbsp; There are a plethora of open source project just waiting to be read -- do so.&nbsp; This is the single best way to expand your coding repertoire, find things your language can do that you didn't even know about..&nbsp;&nbsp; Scott Hanselman has recently popularized this idea, and I thank him for it.  <li>Practice.&nbsp; This means writing small applications at home.&nbsp; You get an idea that you want to try out -- do it.&nbsp; I don't mean you have to write finished applications, just have some exploring time.&nbsp; I remember talking with an 80 year old master woodworker (he lives down the street from me), who was telling me how many time he would practice making dovetail joints before he felt competent.&nbsp; It was years worth.  <li>Pay Attention.&nbsp; Being good at anything really amounts to that.&nbsp; And don't just pay attention when reading, writing, or talking about code.&nbsp; Inspiration come from everywhere, any good artist will tell you that.&nbsp; Pay attention when you cook, when you work on the car, when you are wood working, playing an instrument, whatever it is that you do.&nbsp; This will help you in the end, event if it is just learning the amount of dedication it really takes to become good at something.  <li>Beware of preferences.&nbsp; Any time I hear someone start a statement with "I prefer code to ..." you know things are going downhill.&nbsp; If you find someone who cares more about how your code is formatted then how it is written you have found yourself in a mess.&nbsp; More importantly, beware of them in yourself.&nbsp;&nbsp; Having code style standard is important, but it isn't worth loosing sleep over.&nbsp; This also pertains to inheritance, patterns, use of particular classes (e.g. always using the generic list class in C# when a Dictionary would be better).&nbsp; <li>No Sacred Cows. Believe no single source of information.&nbsp; This means not thinking that Microsoft, Sun, IBM, Richard Stallman, or anyone else will have all of the correct answers.&nbsp; Apply the scientific method and do some research, experiment, and question the authority.&nbsp;&nbsp; There should be no sacred cows in programming.  <li>Talk with others.&nbsp; Join a user group, show up every now and then, heckle the presenter, and -maybe- speak.&nbsp; You want a broad range of people who you can talk to and bounce ideas off of.&nbsp; This will help you from becoming that crazy guy in the corner who vehemently states that all your code should be in one file.&nbsp; Having a mentor (mentioned earlier) is great, but having people around to push you from multiple directions is also good.  <li>Learn languages.&nbsp; This gets back to the "read code" idea. Make that multiple types of languages as well.&nbsp; If you know C# or Java and SQL, learn Python or Ruby, get really good at JavaScript.&nbsp; If you want something really out there, learn MDX.&nbsp; This is also a repertoire thing.&nbsp; Seeing how other languages work will make you rethink your ideas about what your current code, in whatever languages you are working in, should look like.  <li>Keep Thinking!!!&nbsp; That is possibly the most important point.&nbsp; Keep thinking.&nbsp; Don't just evaluate something once and never return, go back and reevaluate. Did the technique work?&nbsp; How could it have been better?&nbsp;&nbsp; The idea is continual improvement.  <li>Switch jobs every now and then.&nbsp; When I announced I was leaving my first programming job out of college, the VP of R&amp;D had me sit down with him and talk.&nbsp; He wasn't trying to keep me (he knew I was moving to be closer to family), he wanted to give me some advice.&nbsp; He told me to change jobs every three years.&nbsp; After you have been with a place for three years you have probably learned everything you are going to learn and it time to move on.&nbsp; This doesn't mean changing companies either.&nbsp; I've been with the same company now for four years, but I've had three different jobs.&nbsp; If you have been writing commercial applications, become a consultant - or vise-versa, become a test engineer, expand your boundaries.&nbsp; Again, this is about pushing yourself to be better.  <li>Have a Hobby. But don't ask about me, I have too many.&nbsp;&nbsp; Creating software is about creating things.&nbsp; So I suggest picking a hobby that involves creating something.&nbsp; Popular hobbies amongst programmers I know include: cooking, music, woodworking, beer making, and BBQ (which is different than cooking).&nbsp; But don't discount sports (golf is always popular), computer games, and board games.&nbsp; Anything that promotes the development of skill levels can't be a bad thing. </li></ol> <p>And I'm stopping there.&nbsp; This is my beginner's guide to how to become the writer elegant code.&nbsp; If you have others you think I missed, add them too the comments.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/30/what-is-elegant-code-to-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NetDug Unit Testing</title>
		<link>http://elegantcode.com/2008/03/22/netdug-unit-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=netdug-unit-testing</link>
		<comments>http://elegantcode.com/2008/03/22/netdug-unit-testing/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 21:00:30 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/03/22/netdug-unit-testing/</guid>
		<description><![CDATA[So last night I had the opportunity to be the moderator at NetDug, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk [...]]]></description>
			<content:encoded><![CDATA[So last night I had the opportunity to be the moderator at <a href="http://www.netdug.com">NetDug</a>, we were talking about Unit Testing.  It was very interesting.  We had one of those nice mixes between people who had not done unit testing yet, to guys who knew way more about it than I do.  I went into the talk with 20 slides, I think I showed about 5 of them.  I consider that a success (I threatened the audience, the less they talked, the more slides I would show).

<a href="http://elegantcode.com/wp-content/uploads/2008/03/unittestingdemo.zip">Slides and sample code</a>

What I learned from last night:
<ol>
	<li>I'm not much of a moderator (I talk to much)</li>
	<li>Code coverage is a art in divination</li>
	<li>Mock/Stub/Fake Objects are hard to explain</li>
	<li>Over use Mocks could be a code smell</li>
	<li>The discussion format actually works pretty well for talking about unit testing</li>
	<li>If you give geeks a chance to talk, they will talk</li>
</ol>
What I hope everyone else got from the topic:
<ol>
	<li>Unit testing forces you to write better code</li>
	<li>Unit testing forces you to use better object oriented principles</li>
</ol>
<h3>Test Technology</h3>
This was an early question, what technologies to use to test your code.  <a href="http://www.nunit.org/index.php">NUnit</a>, MSUnit, and <a href="http://www.mbunit.com/">MBUnit</a> were all mentioned and viable, and stable, technologies.  For mock objects (which you are going to need) there is <a href="http://www.ayende.com/projects/rhino-mocks/downloads.aspx">Rhino Mocks</a> and <a href="http://www.typemock.com/">TypeMock</a>.  I suggest Rhino Mocks over <a href="http://www.typemock.com/">TypeMock</a> for anyone who can't purchase the full version of <a href="http://www.typemock.com/">TypeMock</a> (but there is a nice free version as well).

Then there are the helper technologies: <a href="http://testdriven.net">TestDriven.Net</a> and <a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> are the main two, but apparently MSUnit's runner isn't bad either (I haven't used it yet).  All of these tools make it easier to run your unit tests from inside Visual Studio, and each has other benefits.  <a href="http://testdriven.net">TestDriven.Net</a> has wonderful Reflector integration (a better object browser), and ReSharper...<a href="http://www.jetbrains.com/resharper/index.html">ReSharper</a> is just a must have (that is me talking, not the group).
<h3>Code Coverage</h3>
Code Coverage, using tools like <a href="http://www.ncover.com/">NCover</a> (<a href="http://www.ncover.com/download/discontinued">free version</a>), tell you how much of your code base is tested.  This was one of the early questions.  How much of your code base should be tested?  Answer: it depends on the product.  My view is that a library (no UI element) should have +90% coverage, if there is a substantial amount of UI then the project can get down to 60%.  If your code coverage gets below that you just aren't trying, or you need to rethink your architecture. 

I did talk a bit about code that was not really testable (not in an automated way anyway): UI, Database code, and external resource code are all potentially untestable.  More on this in a moment.

Database code is not testable if you can't return the database to a known state (you can restore the database data). 

UI code testing should be avoided because UI tests have to be so bound to the UI that they are brittle.  So you end up spending a considerable portion of your development time fixing broken test. Brittle tests are to be avoided whenever possible.
<h3>Testing existing code</h3>
Probably the hardest question to answer from last night was: how do you test existing code bases.  And that came up over and over.  Do you start with integration tests and then work in unit tests, or the other way around. 

I will admit, most of the time when I talk about unit testing, I center it around new projects.  Unit test is hard enough with new code, testing old code that wasn't written with unit test in mind is a migraine waiting to happen.

The audience did have some good advice though.  Pick parts of the project that you need to work on (say one class) and make that testable and tested.  Essentially you start creating silos of tested code.  The other suggestion (and I actually had a slide for this) was to get the book: <a href="http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1206114497&amp;sr=8-1">Working Effectively with Legacy Code</a>.  Finally, buy TypeMock -- the big boy version, not the free-be version.  You'll need it.
<h3>UI Testing</h3>
This is my treatise on writing unit tests for the User Interface:

1. Don't do it until you are done with the UI.
2. Only test that the UI works in a basic sense.
3. You still have to test the UI by hand.

If you start writing UI tests while you are developing the UI, you will continually break the tests.  Writing the test by hand is none trivial, and using tools to write them is also error prone.  Finally, these tests can't tell you if the UI is just bad.  Only exposure can tell you that.  Every developer should be forced to have to use their UI repeatedly so they know where is sucks.  You wont get that with automated UI tests.

That said, there are tools to help you test web user interfaces. <a href="http://watin.sourceforge.net/">Watin</a>, <a href="http://wtr.rubyforge.org/">Watir</a>, and <a href="http://selenium.openqa.org/">Selenium</a> are all there to help.  We shall see if Team Systems adds anything to help with this (I'm hoping it does).
<h3>Testing Database code</h3>
This is essentially, testing code that touches the database.  Could be your <a href="http://www.hibernate.org/343.html">NHibernate</a> code, could be a stored procedure, could be ADO.Net code.  But really, this is just code that must touch an outside resource (database, file system, serial connection, etc) and there is no way, or point, to abstract it out any further.

The main point here was to have a way to get the data back to a known state.  Without that everything else gets much harder.

We also came up with a new term: SQL Ejaculation.  That is a pattern smell where an excessive amount of your HTML comes from you SQL database.  Like the entire site.  All of the HTML.  And you have stored procedures that simply build the HTML -- in a 10,000 line stored procedure.  That is SQL Ejaculation.

Note: if this comes up in a Google search I might get worried.
<h3></h3>
<h3>After the meeting</h3>
We all went to Table Rock for a beer.  'nuf said, it is a great group.

Finally, to the guy who asked me a question after the meeting was over: I'm sorry, I just haven't had to draw multiple, overlapping, transparent images on a win form using GDI.Net in a really long time.  I know it involves alpha-transparency values, but I haven't done that in years.  Maybe you should look at WPF.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/03/22/netdug-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Be Careful of Your Passion</title>
		<link>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=be-careful-of-your-passion</link>
		<comments>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 14:37:04 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Architecture and Design]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2008/02/27/be-careful-of-your-passion/</guid>
		<description><![CDATA[Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." Most of us got into this business because we liked making computers do things we [...]]]></description>
			<content:encoded><![CDATA[<p>Many developers categorize themselves when describing their areas of passion or specialty. Often this sounds like, "I'm a data guy," or "I like middleware." Occasionally you hear a passion for user experience or UI expressed as, "I like making GUIs." </p> <p>Most of us got into this business because we liked making computers do things we think of as cool. The most successful among us still get that rush when our new creation spools up and runs.</p> <p>Tinkerers like us tend to gold plate the pieces of our systems we find most interesting. This is why developers will often find themselves the go-to-guy for certain specialities. A dev likes making services, she makes good ones because it's fun, she gets to make more of them. Sounds perfectly reasonable and symbiotic, no?</p> <p>It can be.</p> <h2>Ignoring the Boring</h2> <p>When we get to focus exclusively on the parts of the system that really flip our bits, it can come at a price. Although we might be jazzed about services, that data model still needs our attention. It is fairly common to focus on that thing that really gets us excited and forget (or outright ignore) that part which seems boring. Just because you think someone else will come along and sweep up after doesn't make it happen. </p> <p>The most common instance of "Ignoring the Boring" is documentation. Let's face it, we want to write in languages other than English, right? Documentation is in the elegance of my self-describing code, right? Not so much. Whether we like it or not, documentation is often a deliverable of our system and as such deserves the respect we might give to our WSDL or interface definitions. Just because the reader is a human rather than a machine doesn't mean we should short change her because it's boring to do the work.</p> <h2>Smells of Sub-Optimizing</h2> <p>It is easy to see this kind of monocular behavior can result in a really clean UI with a messy back end, or visa versa. Whatever gets the short end of the stick will tend to show up in the system as a glaring deficit. We can then measure the deficit in the ignored sub-component in observable ways. Some failures of attention to detail might include:</p> <ul> <li>Lack of enforced constraints or relationships in database tables  <li>Code in the view, because it's just this one little thing  <li>Leaky abstractions, because wrapping that data model in business logic can be a real PITA  <li>No check in notes  <li>Not taking the time to do code reviews, even informally</li></ul> <h2>The System Isn't Your Playground</h2> <p>On the other end of the spectrum, what happens when we get to play with the things that <em>are</em> fun? The results can depend on what the implementer really enjoys.</p> <p>One recent real world story I heard told of a hardware engineer who designed 7 different chips within a device, each with a fundamentally different way of representing logic circuits. The chip engineer had a great time applying all the different techniques he read about in last month's <em>Nerd Fest Quarterly</em>, but the team assigned to test this Franken-board was rightly annoyed.</p> <p>Another symptom of playground development is needless abstraction layers or design patterns applied to simple problems. If a system is implemented with a gazillion abstraction layers where only a concrete implementation will do, you can bet someone is reading the <em>Gang of Four</em> in bed at night.</p> <p>If your passion is trying new tools and technologies, how many of these shiny new toys are incorporated into your system without deliberate attention? How many logging libraries does one team really need? How many unit test frameworks?</p> <p><a href="http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It" target="_blank">YAGNI</a>, 'nuff said.</p> <h2>Keep Your Passion Alive</h2> <p>So, what are you saying, Starr? Stop trying to extract pleasure from my work? Just bang the keys and give my 40 to the man? Of course not!</p> <p>I am simply asserting that there is a degree of professionalism needed at all levels. Let's care about the system as a whole and be good stewards to the craft, not just the shiny bits. And, yes, documentation is a justifiable deliverable. Cowboy up.</p> <p>Learn new techniques that fire you up and apply them wisely, not with wild abandon. Delayed gratification means not always getting to use WPF to make a draw a button, or SilverLight to make a logo spin (&lt;-- bad example). Sometimes this means capitulating to use the prescribed framework so we can get a systemic optimization instead of trying to roll our own multi-tenant web portal, yet again.</p> <p>Having more tools in our toolbox is a great thing. This is the essence of youthful fun in our work. Knowing when to use those shiny new tools is the wisdom part. Now go learn something new.</p>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2008/02/27/be-careful-of-your-passion/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Confessions of a bad web developer</title>
		<link>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=confessions-of-a-bad-web-developer</link>
		<comments>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 03:57:55 +0000</pubDate>
		<dc:creator>Chris Brandsma</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/</guid>
		<description><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately. Not a lot, just enough to get acquainted for right now. Yesterday I had my "Road to Damascus" incident. I don't know HTML. OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them [...]]]></description>
			<content:encoded><![CDATA[I've been moonlighting with the ASP.Net MVC framework lately.  Not a lot, just enough to get acquainted for right now.  Yesterday I had my "Road to Damascus" incident.  I don't know HTML.

OK, not completely true, I know lots of html tags, table, ul, div, p, a, etc; and I know how to use them without looking things up.  More importantly, I know a ton of asp.net controls.  What I don't know, specifically, is how they all work.

Like the form tag.  I know every Asp.Net page I have ever made has had one of them (and only one, at least as of .Net 1.1 that is all you were allowed).  But I don't remember how to use it any more.  How to read data from it, pass values from one page to the next.  I used to, did it a few times in fact.  Then came Asp.Net, and I haven't looked back.

Have I written JavaScript during this time?  Sort of.  If you count copying code from Google (and testing it of course).  Over the years I have large blocks of Googled JavaScript code in existing projects that I've move from page to page.  Cut-and-paste is a type of reuse...right?  And lately, when my JavaScript requirements have not been Google-able, <a href="http://jquery.com">JQuery</a> has become my savior (more posts on that soon).  But I haven't written a JavaScript object, Prototype, or any such tomfoolery since Netscape 4.8.

And just to clarify.  I once wrote my own tree control in JavaScript.  Or, I wrote one for Netscape 4.04, 4.08, 4.5, 4.75, 4.8, and IE.  I never thought I could hate a language until Netscape.  Netscape killed any love of JavaScript for me.

But now with Ajax on the scene I can't do without it anymore.  And as cool as the Asp.Net Ajax Library is and all of the things that the control toolkit can do for you: without a bit of JavaScript muscle, it just isn't going to work for you.  Take a look at the Google Maps API and tell me you aren't thinking of things that could be done with it.  But it ain't going no where without some JavaScript know-how.

CSS I have come to terms with.  I know the difference between .tag and #tag.  I've written a hover or two.  But there are still unknowns there as well.  I still visit <a href="http://w3schools.com/css">w3schools</a> regularly, and spend way too much time with <a href="http://www.getfirebug.com">FireBug</a> and <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a>.  And <a href="http://csszengarden.com">CssZenGarden</a> -- that is just beyond me right now.

But even in Asp.Net.  <a href="http://www.xefteri.com/articles/show.cfm?id=18">How does a post back work?</a> How is it that a button click is hooked up to an event handler? I'm a firm believer that their is no "magic" in programming.  Post back is magic to me.   Maybe once years ago I knew, but not anymore.

But things like: if you have a table, and every row has a check box on it, on the server side, how do you know which check box is which?  Heck, how do I figure that out on the client side with JavaScript?  The magic is ViewState, I know.  But...

That really is the beauty of WebForms.  It provides a nice insulating coat that insulates you from all of the goo that is html and JavaScript.  ViewState is my friend.  But what does this have to do with Asp.Net MVC?  Absolutely everything.

Asp.Net is a stripped down version of web development with .Net.  ViewState: gone.  asp:Button: hope you are familiar with submit.  The cozy jacket is gone and has been replaced with a wind breaker.  All those old techniques that we threw away with our last ASP page needs to be resurrected.

Being how I already live in a cold climate, I know that the biggest part of working in cold weather is to acclimated to the temperature.  Part of it as well, is knowing that you have to work in the cold climate.  So this isn't time to put things off.  Spring is still a ways off.  So, for Asp.Net WebForms developers, that means re-familiarizing yourself with a few technologies that we all thought we didn't need to know that well:
<ul>
	<li>XHML</li>
	<li>CSS</li>
	<li>JavaScript</li>
	<li>JSON</li>
	<li>JQuery</li>
	<li>Asp.Net Ajax framework</li>
</ul>
I'm not going to specify particular books.  I don't have time for that, and you can search Amazon as well as I can.  Actually, I bought a couple of these books for  at Hastings near my house.  Worth every cent.

Also worth noting what is not on my list: XML.  The language we thought was the lingua franca of the web.  I've had enough XML, and the Asp.Net Ajax library talks via JSON (which is much smaller).   So XML is out for me.  And that is fine, I think, there is enough to learn as is.]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/12/21/confessions-of-a-bad-web-developer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom IV</title>
		<link>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iv</link>
		<comments>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 04:48:42 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins. Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. [...]]]></description>
			<content:encoded><![CDATA[<p>If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a href="http://elegantcode.com/?p=646" target="_blank">here</a>.</p> <ol> <li>Address the unknown that the team identifies. If they don't understand something in planning, clear it up before execution begins.  <li>Some architectural decision must be big and early. These are often based on business requirements, not technology. Java vs. .Net, as an example.  <li>If metrics are prescribed to a team, explain how they will be used. Metrics cause fear, mitigate that fear.  <li>You can prescribe Agility, but not hyper-performance.  <li>Part of the maturation process of Agile is the tendency for people to over-analyze the holy heck out of it. This is relly a reaction to the cost of software development and the incredible amounts of historical waste in the industry.  <li>CEOs do not care about code coverage. Speak to them appropriately about quality.  <li>Earned value reporting is ridiculous.  <li>"Don't wait until the customer is screaming to optimize for performance." <em>-- Thanks, Kevin</em>.  <li>Deliver less, but sooner and more often. <li>"Daddy, is that your new <a href="http://en.wikipedia.org/wiki/Out-Of-Box_Experience" target="_blank">OOBE</a>?" - My kid when I opened my new MacBook. "Yes, it is, son. Yes, it is."</li></ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/11/09/widgets-of-wisdom-iv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Widgets of Wisdom III</title>
		<link>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=widgets-of-wisdom-iii</link>
		<comments>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 04:14:20 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=664</guid>
		<description><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer here. Carry a model at all times to express your understanding to others. Look for patterns in all systems at all levels. Seeing them is the very essence of insight. At the application level, architecture and design are synonymous. "BizTalk is overkill" [...]]]></description>
			<content:encoded><![CDATA[If you aren't familiar with the Widgets of Wisdom feature, see the explanation and disclaimer <a target="_blank" href="http://elegantcode.com/?p=646">here</a>.
<ol>
	<li>Carry a model at all times to express your understanding to others.</li>
	<li>Look for patterns in all systems at all levels. Seeing them is the very essence of insight.</li>
	<li>At the application level, architecture and design are synonymous.</li>
	<li>"BizTalk is overkill" is a typically overheard comment of <em>Drive by Architecture</em>.</li>
	<li>Developers would never prescribe BizTalk or a TIBCO or any other message bus system. That type of decision is typical of a CTO or someone who reports directly to one. These are strategic decisions.
"I think that, generally, if you're looking at something like BizTalk, you're probably looking at somebody, a directory port of a CIO or a CTO, I would say." -- Roger Session</li>
	<li>"Anything that is architecture and is specific to a particular technology is kind of an oxymoron." -- Roger Sessions</li>
	<li>Good design allows for emergent functionality, which we can also think of as purposeful evolution.</li>
	<li>The Open/Close principle doesn't mean you can't recompile. -- Allan Shalloway</li>
	<li>Fewer keystrokes != Elegant Code. Damn it! -- Dave Starr :)</li>
	<li>Architectural decisions are those that will kill your business if they are wrong.</li>
	<li>To introduce a new technology into a system, have the entire team immerse in an architectural spike, then estimate.</li>
	<li>Schedule riskiest work first. Try prioritizing a backlog by risk.</li>
	<li>The work of a developer is to uncover complexity, the work of an architect is to simplify it.</li>
	<li>A legacy system is one that is already making money.</li>
	<li>“The <a href="http://en.wikipedia.org/wiki/Winchester_Mystery_House">Winchester House</a> in San Jose is the perfect example of following a vision without a plan.”</li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/10/11/widgets-of-wisdom-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Ways to Stop Context Switching</title>
		<link>http://elegantcode.com/2007/10/08/10-ways-to-stop-context-switching/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=10-ways-to-stop-context-switching</link>
		<comments>http://elegantcode.com/2007/10/08/10-ways-to-stop-context-switching/#comments</comments>
		<pubDate>Tue, 09 Oct 2007 03:02:49 +0000</pubDate>
		<dc:creator>David Starr</dc:creator>
				<category><![CDATA[Esoterica]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Meat Space Skills]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Widgets of Wisdom]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=659</guid>
		<description><![CDATA[Context switching is rapidly changing from one focused task to another in a short amount of time. Back when we were ignorant of such things, we called this multi-tasking and thought it was good. While multi-tasking is handy in computers, it is not possible in humans. True multitasking looks more like walking and chewing bubblegum than switching quickly between [...]]]></description>
			<content:encoded><![CDATA[<a href="http://delivery.acm.org/10.1145/990000/985715/p175-czerwinski.pdf?key1=985715&amp;key2=1868981911&amp;coll=&amp;dl=acm&amp;CFID=15151515&amp;CFTOKEN=6184618" target="_blank">Context switching</a> is rapidly changing from one focused task to another in a short amount of time. Back when we were ignorant of such things, we called this multi-tasking and thought it was good. While multi-tasking is handy in computers, it is not possible in humans. True multitasking looks more like walking and chewing bubblegum than switching quickly between source code and email. What we now know is that context switching costs much of our day in lost productivity because of the time it takes our minds to refocus.

Einstein once said that single-mindedness of purpose is the essence of genius. When I remind <a href="http://domesticoblivion.com" target="_blank">my wife</a> of this she tells me this is also how bugs think. You win some, you lose some.

Context switching is the very essence of Muda, a Japanese term for activity that is wasteful and doesn't add value or is unproductive. Learning to positively manage context switching helps to reduce your Muda of motion and will turn you into a more effective person. Period.
<ol>
	<li><strong>Proactively manage your email</strong> <img style="margin: 10px" src="http://images.google.com/url?q=http://www.the-lifestyle-doctor.com/4.%2520frantic.gif&amp;usg=AFQjCNEjbo7W01cRv8Cl2D2RbZ0NUI5MdQ" alt="" width="240" height="167" align="right" />
Turn on your email client only twice per day. Once in the morning and once in the afternoon. It sounds crazy doesn't it? It is doable, I promise. The first guy I met who did this was one of the most effective engineers I have ever known. This way of managing email is just another example of how disciplined he was in life.</li>
	<li><strong><strong>Proactively manage </strong>your RSS reader</strong>
Turn on your RSS client only once per day. Coordinate it with an email session. All the same reasons for avoiding constant email apply here as well.In addition to controlling your sessions with RSS, find a way to weed out the junk. I use Google reader to browse all RSS entries, just scanning headlines for things I might find compelling. I mark those items with a star and move on. After processing all feeds I come back to my list of starred items and read them at my leisure. This puts them into the starred grouping for quick access on my cell phone, btw, which means I can easily consume good content while waiting at the doctor's office.</li>
	<li><strong>Turn off your instant messaging client</strong>
If you aren't going to just turn it off, at least set your status to "Busy" or even "Appear Offline". If it is genuinely important, they will call you. See #4.</li>
	<li><strong>Send Calls
</strong>My wife delights in telling me the telephone is there for her convenience. This is most often cited when she notes on the caller ID that her mother is calling. It drives me crazy, frankly. I have to admit that ignoring a ringing phone is such a simple, yet effective way to avoid context switching I had to mention it. The truth is that a ringing phone goes against every social moray and norm I ever learned. It seems incredibly rude, which is why I sometimes send phone calls straight to voicemail when I am trying to concentrate.I really tried it the other day, sending all phone calls to voice mail without even letting it ring. It worked. I had 4 callers and only one voice mail and that was from a vendor.</li>
	<li><strong>Change you browser's homepage</strong>
If your browsers home page is iGoogle, MSN, or Yahoo, or some other dynamic site that shows news or other content that promotes browsing, change it. It is easy to get distracted every time you open a browser. Many people find the most efficient home page is a blank one. I have created a blank tag on iGoogle to use as my default page. Not sure why, frankly. That may be odd.</li>
	<li><strong>Put up a sign</strong>
Whether you are in a office or a cubicle or even in a bullpen environment, it is perfectly reasonable to put up a "I am Concentrating" sign. This is a polite request to be given some uninterrupted time. Couple this with #7 and you have yourself a good recipe for getting things done.</li>
	<li><strong>Earplugs</strong>
I am serious. Not earphones, but earplugs. I have actually found the ambient noise being blocked promotes my ability to concentrate a great deal. I first decided how much I like earplugs while coding in my kitchen with all 4 kids running around the house. With good ear plugs, I could actually ignore them. If I can do that, imagine how effective they are in a cube farm.</li>
	<li><strong>Time box your own activities</strong>
This is effective for many tasks including using email, reading feeds, writing a particular class file, or anything at all. For the OCD among us, this can actually be a fun little game. I recommend <a href="http://www.sardinesoftware.com/" target="_blank">Egg Timer Plus</a>. This is the same tool I use to time simulated sprints while training people in Scrum.</li>
	<li><strong>Quicker and smaller deliverables
</strong>This is good for  ton of reasons not related to context switching, but related to this article we can easily see the advantage of allowing ourselves to focus. Smaller batches of work gives us the ability to truly concentrate on the whole deliverable without being interrupted. A recent example of this for me was breaking a single analysis document into multiple sections and getting up to walk around the building in between drafting sections. I was able to deliver a draft document without all needed sections in it, but the ones that did get done were done well. This was far favorable to the group receiving the recommendation, who would have found little value in scattered thoughts expressed into multiple sections.This comes down to do one thing and do it well.</li>
	<li><strong>Desktop widgets are evil
</strong>Whether you are running OSX or Vista, don't use widgets. I admit they are cool. They catch my eye every time I see my desktop and if a widget is showing dynamic information I cannot help but look at it. This causes a major change in my focus and draws me away from the problem at hand. Turn desktop widgets off.</li>
</ol>
<div id="0767317B-992E-4b12-91E0-4F059A8CECA8:b1caf9c5-d20b-4215-8bfc-1ca4f9d17006" class="wlWriterSmartContent" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/Agile">Agile</a>, <a rel="tag" href="http://technorati.com/tags/Lean">Lean</a></div>]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2007/10/08/10-ways-to-stop-context-switching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

