<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Blog</title><link>http://ardalis.com:80/</link><description>Blog</description><item><title>Walking While Working</title><link>http://ardalis.com:80/walking-while-working</link><description>&lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/Walking-While-Working_919E/DSC_0031%20-%20Cropped.jpg"&gt;&lt;img title="DSC_0031 - Cropped" style="background-image: none; float: right; padding-top: 0px; padding-left: 0px; margin: 0px 0px 5px 5px; display: inline; padding-right: 0px; border: 0px;" border="0" alt="DSC_0031 - Cropped" align="right" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Walking-While-Working_919E/DSC_0031%20-%20Cropped_thumb.jpg" width="237" height="244" /&gt;&lt;/a&gt;Staying in shape as a programmer can be difficult, but &lt;a href="http://www.popsci.com/science/gallery/2013-02/7-ways-sitting-will-kill-you?"&gt;recent studies&lt;/a&gt; have shown that even if you&amp;rsquo;re among those in our profession who do work out regularly, sitting for long periods of time at work is detrimental to your health.&amp;nbsp; To be a bit more dramatic about it, &lt;a href="http://www.lifehack.org/articles/lifestyle/why-sitting-is-killing-you.html"&gt;sitting is killing you&lt;/a&gt; (see &lt;a href="http://haacked.com/archive/2012/07/20/code-standing-up.aspx"&gt;Phil Haack&amp;rsquo;s blog post on this from last year&lt;/a&gt;).&amp;nbsp; So, how can we combat this risk while continuing to get our work done (and, if you&amp;rsquo;re like me, keep on doing the thing you love)?&amp;nbsp; One option is to take frequent breaks, get up from your desk, go for a walk.&amp;nbsp; This is good advice, and by all means, follow it.&amp;nbsp; But it&amp;rsquo;s not always easy to do, and of course you still have work to get done at your computer.&amp;nbsp; What if we could get our work done, without having our bottoms stuck in an office chair?&amp;nbsp; More and more of us are doing just that, using standing or walking desk setups.&amp;nbsp; Pictured at right is my current home office setup, which consists of the following components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://amzn.to/14AmpDr"&gt;LifeSpan TR1200-DT Treadmill Desk&lt;/a&gt; (found cheaply on Craig&amp;rsquo;s List)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://amzn.to/ZvqP0Z"&gt;Tyke Dual Monitor Stand Desk Clamp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;2 &lt;a href="http://amzn.to/17ZgjkB"&gt;HP ZR24w 24&amp;rdquo; LCD monitors&lt;/a&gt; (which don&amp;rsquo;t have HDMI, which is my only complaint)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://amzn.to/17ZgxZ8"&gt;Rode Podcaster with Boom and shock mount&lt;/a&gt; (for recording &lt;a href="http://ardalis.com/training-classes"&gt;my Pluralsight training courses&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&amp;hellip; and a fast computer (currently a rig found inexpensively from &lt;a href="http://ibuypower.com/"&gt;iBuyPower&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Since walking while working is somewhat novel still, many people have questions and concerns.&amp;nbsp; Since the treadmill desks are rather pricy, that adds to the uncertainty, since it&amp;rsquo;s difficult to just pick one up to try out and see if it&amp;rsquo;s right for you.&amp;nbsp; However, more and more people are going this route, both at home and at work, so if you ask around it&amp;rsquo;s likely somebody you know already has a treadmill desk you can try.&amp;nbsp; Barring that, trying out a standing desk can be as easy as stacking some (stable) things on you current desk and setting your laptop or keyboard up on this higher surface, and working from there for a while to see how you like it.&amp;nbsp; In any case, I&amp;rsquo;ll try to answer some of the more common questions about this setup here.&lt;/p&gt;
&lt;p&gt;First, though, it would be good to be able to actually measure the effect of walking while working (or not), so to that end let me recommend one more gadget to add to this mix: the &lt;a href="http://amzn.to/Y6HUhR"&gt;Fitbit&lt;/a&gt;.&amp;nbsp; There are a variety of styles of Fitbit available now, including a &lt;a href="http://amzn.to/11UuQIe"&gt;wristband model (the Flex)&lt;/a&gt;, if you prefer that to a clip-on or in-your-pocket version.&amp;nbsp; There are a bunch of nice things about the Fitbit (like food, calorie, and weight tracking as well as gamification and competition with your friends), but for this article I just want to focus on how the Fitbit can help you visualize how active you are during the day.&amp;nbsp; Here&amp;rsquo;s a typical workday for me:&lt;/p&gt;
&lt;p&gt;&lt;img title="SNAGHTML1ce79e3f" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" border="0" alt="SNAGHTML1ce79e3f" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Walking-While-Working_919E/SNAGHTML1ce79e3f_1.png" width="584" height="237" /&gt;&lt;/p&gt;
&lt;p&gt;Occasionally, I&amp;rsquo;m able to work from home, in which case you can see the difference pretty obviously:&lt;/p&gt;
&lt;p&gt;&lt;img title="image" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Walking-While-Working_919E/image_3.png" width="550" height="228" /&gt;&lt;/p&gt;
&lt;p&gt;Note that in Fitbit&amp;rsquo;s graphs above, each bar represents a five minute period, so showing 300 or 500 steps in 5 minutes is still just a walking pace.&amp;nbsp; None of these graphs show, for instance, an actual aerobic running workout.&amp;nbsp; This is just walking at a slow-to-medium pace, which generally doesn&amp;rsquo;t distract or make typing (or thinking) difficult).&amp;nbsp; The model of treadmill desk I have allows setting the speed in .1 MPH increments between 0 and 4 MPH, and typically for work that involves typing or using the mouse (as opposed to, say, watching a video) I will keep my speed between 1 and 2 MPH.&amp;nbsp; It&amp;rsquo;s also worth noting that the total steps in the top graph was 12,095, in the bottom it was 18,977, and in a typical workday without using the treadmill desk at all, it would often be under 5,000.&lt;/p&gt;
&lt;p&gt;Now, let&amp;rsquo;s address some questions I&amp;rsquo;ve had myself, or have been asked by others, about this crazy idea of actually getting work done while walking.&lt;/p&gt;
&lt;h3&gt;How do you like the Lifespan TR1200 DT?&lt;/h3&gt;
&lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/Walking-While-Working_919E/DSC_0039%20-%20Cropped_1.jpg"&gt;&lt;img title="DSC_0039 - Cropped" style="background-image: none; float: right; padding-top: 0px; padding-left: 0px; margin: 0px 0px 5px 5px; display: inline; padding-right: 0px; border: 0px;" border="0" alt="DSC_0039 - Cropped" align="right" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Walking-While-Working_919E/DSC_0039%20-%20Cropped_thumb_1.jpg" width="397" height="480" /&gt;&lt;/a&gt;I&amp;rsquo;m very pleased with it.&amp;nbsp; As I mentioned above, I picked mine up locally by finding someone who had an almost-new one they wanted to sell, so I paid much less than retail.&amp;nbsp; That made trying it out much easier to stomach (and increased the &lt;a href="http://en.wikipedia.org/wiki/Wife_acceptance_factor"&gt;Wife Acceptance Factor&lt;/a&gt;).&amp;nbsp; It has a fairly large desktop, with a built-in wrist rest that I find to be very comfortable to use.&amp;nbsp; The wrist rest spans the whole front of the desktop surface, so it helps with the mouse as well as the keyboard.&amp;nbsp; Also, the front of the desk is slightly curved, which I like because it lets me be a little bit closer to the desk, while still letting me set things off to the side (phone, mouse, coffee, etc.).&amp;nbsp; The settings work fine for me.&amp;nbsp; I don&amp;rsquo;t use any of the custom settings, or track things like steps, calories, distance, weight, etc., mainly because I use Fitbit for that.&amp;nbsp; The controls beep every time you make a change, which I&amp;rsquo;ve read others have found annoying enough that they&amp;rsquo;ve filled the speaker hole with hot glue to muffle the sound, but it hasn&amp;rsquo;t bothered me enough to worry about that.&amp;nbsp; The treadmill itself is super-quiet, at least compared to another treadmill I&amp;rsquo;ve had for home use (bought over 10 years ago, so maybe they&amp;rsquo;re all much quieter now).&amp;nbsp; You can be on a phone or skype call while walking and nobody can tell (though I don&amp;rsquo;t walk while recording &lt;a href="http://pluralsight.com/training/Authors/Details/steve-smith"&gt;Pluralsight courses&lt;/a&gt;, since I don&amp;rsquo;t want to have the risk of errant sounds to have to clean up during editing).&amp;nbsp; The desktop is height-adjustable, but not automatic.&amp;nbsp; If you want an automatic (motorized) desktop, it&amp;rsquo;s going to cost a lot more.&amp;nbsp; You can sit a barstool height chair on the treadmill (or roll the treadmill out of the way &amp;ndash; it&amp;rsquo;s not attached to the desk except via a couple of cables that can easily be unplugged), so if you want to take a break and sit down at the desk, it&amp;rsquo;s not terribly difficult to achieve.&amp;nbsp; Personally, if I need a break from walking, just standing for a bit works for me, and if I need more of a break than that, I&amp;rsquo;ll typically leave my desk and go do something else for a bit (or switch to checking email, etc., from my iPad, maybe in a comfortable chair or at a table).&lt;/p&gt;
&lt;p&gt;Note that when using the &lt;a href="http://amzn.to/ZvqP0Z"&gt;Tyke Dual Monitor Stand Desk Clamp&lt;/a&gt; with this particular desk, you&amp;rsquo;ll need to mount the clamp slightly off-center, since the desktop includes a cable run in it.&amp;nbsp; There&amp;rsquo;s also a metal cable-tray that attaches at the rear of the desktop that I had to remove in order to use the monitor clamp, but that wasn&amp;rsquo;t a big deal in my case (the power strip I had had in the cable tray is now simply hanging from the back of the desktop, which isn&amp;rsquo;t necessarily ideal, but it&amp;rsquo;s working.&amp;nbsp; And of course I could always mount the power strip to the underside of the desktop with screws).&lt;/p&gt;
&lt;h3&gt;Multi-Tasking is Bad; Why isn&amp;rsquo;t Walking While Working a Bad Idea?&lt;/h3&gt;
&lt;p&gt;There&amp;rsquo;s plenty of research available to suggest that multi-tasking can detract from our ability to work effectively.&amp;nbsp; Doing multiple tasks at once means none of them have our full attention, and &lt;a href="http://www.health.com/health/article/0,,20505051,00.html"&gt;some studies&lt;/a&gt; have shown that heavy multitaskers tend to be less able to focus on the task at hand in the presence of distractions.&amp;nbsp; There are also plenty of practices in use in software development that are specifically designed to reduce multitasking and distractions.&amp;nbsp; One of the &lt;a href="http://pluralsight.com/training/Courses/TableOfContents/kanban-fundamentals"&gt;fundamentals of kanban&lt;/a&gt; is to reduce work-in-progress, to maximize the rate at which tasks are completed.&amp;nbsp; The &lt;a href="http://en.wikipedia.org/wiki/Pomodoro_Technique"&gt;pomodoro technique&lt;/a&gt; prescribes eliminating all distractions for a 25-minute period during which all of our attention can be directed at the task-at-hand.&amp;nbsp; &lt;a href="http://deviq.com/pair-programming"&gt;Pair programming&lt;/a&gt; works best when both parties are fully engaged in the task-at-hand, and it can be much more difficult to allow ourselves to be distracted by email, twitter, etc. when we&amp;rsquo;re working with a partner on a task.&amp;nbsp; As someone who feels there is value in all of these techniques, I can tell you that walking while working does not, typically, qualify as a separate task we&amp;rsquo;re focusing on that distracts from our ability to work effectively.&lt;/p&gt;
&lt;p&gt;You can think of any number of things you&amp;rsquo;re doing while you&amp;rsquo;re working, or while you&amp;rsquo;re reading this.&amp;nbsp; Maybe you&amp;rsquo;re sitting.&amp;nbsp; Maybe you&amp;rsquo;re breathing.&amp;nbsp; Maybe you&amp;rsquo;re walking.&amp;nbsp; None of these is requiring a huge amount of concentration from you, typically (unless you&amp;rsquo;re sitting on a bucking horse, or walking through a crowd and having to navigate your path).&amp;nbsp; Walking in place, at a pace that doesn&amp;rsquo;t require you to breathe hard or perspire, is not terribly distracting for most tasks, most of the time.&amp;nbsp; Are there times when I want to take a break from walking, so I can really concentrate on something?&amp;nbsp; Certainly.&amp;nbsp; But for most of my work, and most of the time when I haven&amp;rsquo;t already been walking for hours without a break, it doesn&amp;rsquo;t even enter my mind that I&amp;rsquo;m walking.&amp;nbsp; And frequently, rather than distracting, walking can help me think.&amp;nbsp; If you&amp;rsquo;ve ever gone for a walk, alone or while having a conversation with someone, and found when you were done that you were less stressed and had solved, at least in your mind, some problems that had been causing you stress, you&amp;rsquo;ve worked effectively while walking.&lt;/p&gt;
&lt;h3&gt;How do you avoid getting all sweaty?&lt;/h3&gt;
&lt;p&gt;If you&amp;rsquo;re just walking at a light pace, this shouldn&amp;rsquo;t be an issue.&amp;nbsp; At least, it hasn&amp;rsquo;t been for me.&amp;nbsp; Of course, you can always adjust your air conditioning, or point a fan at your workspace, if those help.&amp;nbsp; My treadmill desk is currently in my basement, the coolest part of the house, so it&amp;rsquo;s generally comfortable.&amp;nbsp; Loose-fitting non-chafing clothes are probably a good idea, but I&amp;rsquo;ve been fine in anything from running shorts to the same khakis I wear to the office.&lt;/p&gt;
&lt;h3&gt;How can one afford one of these setups?&lt;/h3&gt;
&lt;p&gt;There are plenty of options for do-it-yourself alternatives to the LifeSpan $1500-retail treadmill desk.&amp;nbsp; I know Julie Lerman has had some success sitting her bicycle trainer in front of her desk to work.&amp;nbsp; Plenty of others have used off-the-shelf Ikea or similar furniture to create standing desks, or to build a desk around a standard, less-expensive treadmill.&amp;nbsp; And you may be able to get lucky, like I did, and find one locally via Craig&amp;rsquo;s List or your newspaper classified section for much less than retail.&lt;/p&gt;
&lt;p&gt;When you consider the cost of a decent desk, along with the cost of a small, quiet treadmill, the overall cost of the LifeSpan unit is still a bit more, but not unreasonably high.&amp;nbsp; If you factor out a couple of hundred dollars for a decent chair (that you won&amp;rsquo;t need, if you&amp;rsquo;re always walking or standing), then the price becomes even more reasonable.&amp;nbsp; And if you&amp;rsquo;re doing professional work using this equipment, you can very likely write it off as a business expense (consult your financial advisor, I am not a lawyer or accountant, YMMV, etc.).&lt;/p&gt;
&lt;h3&gt;How do you pair program on a treadmill desk?&lt;/h3&gt;
&lt;p&gt;I haven&amp;rsquo;t tried it, and I don&amp;rsquo;t know if it&amp;rsquo;s practical.&amp;nbsp; So far, I&amp;rsquo;ve only used my setup at home, to work on my own.&amp;nbsp; If I were to get one of these at the Telerik office where I work, it would probably be a shared workstation, where different employees could go to check email, take a customer call, etc. for an hour or two at a time.&amp;nbsp; Alternately, I might try to get one for my own primary use, where currently I don&amp;rsquo;t ever pair program with anybody (on the rare occasions when I get to pair program, I do it in one of our team rooms at one of our pair programming workstations).&lt;/p&gt;
&lt;p&gt;Alternately, if you&amp;rsquo;re really good, you might be able to have the shorter person walk in front, the taller one walk in back, and as long as they&amp;rsquo;re able to keep in step, both could work together on the same treadmill (and computer) at the same time.&amp;nbsp; It would be hard for them to swap positions, so hopefully the taller one would have long enough arms to reach the keyboard and mouse from behind the shorter one. :)&lt;/p&gt;
&lt;h3&gt;Don&amp;rsquo;t your feet/back/legs/whatever get sore?&lt;/h3&gt;
&lt;p&gt;Not so much.&amp;nbsp; Occasionally my lower back will feel it if I&amp;rsquo;ve been working while standing or walking for a long time.&amp;nbsp; I find that making sure the desk is at the right height so that my arms can be in the correct position (forearms parallel to floor) helps this.&amp;nbsp; A little bit of stretching takes care of it for me.&amp;nbsp; Also sometimes my Achilles are tight, but no more so than if I&amp;rsquo;d done a lot of walking-sans-working, and again stretching resolves the issue.&amp;nbsp; If you do find that walking or standing causes you pain or discomfort, slow down and limit how much you do per day until your body gets used to the additional activity.&amp;nbsp; If your body has been conditioned to not do anything for up to 8 hours a day while you sleep, and another 8 hours a day (or more) while you&amp;rsquo;re at a desk, plus whatever time you spend sitting in a car or on a couch watching TV,etc., it&amp;rsquo;s going to notice when you start converting those at-work hours into (light) activity hours.&amp;nbsp; Stick with it, and in a little while your body will be used to the new normal activity you expect of it.&lt;/p&gt;
&lt;h3&gt;How can you work with papers, etc. from a treadmill desk?&lt;/h3&gt;
&lt;p&gt;This can be a bit of a challenge, and especially before I got the monitor mounting arms, my desktop space was limited.&amp;nbsp; But with the monitor up off of the desktop, there&amp;rsquo;s really quite a bit of space available using my setup to spread out papers.&amp;nbsp; Personally, I try to limit the amount of paper I need to work with, but sometimes it&amp;rsquo;s inevitable, so it&amp;rsquo;s nice to have the available space.&amp;nbsp; If you&amp;rsquo;re trying to process bills, or do data entry of some kind, etc. and you need some desk space for the papers, you&amp;rsquo;ll probably have enough space with my setup.&amp;nbsp; You might need to just stand, rather than walk, if you&amp;rsquo;re having to reach for papers, etc., but it&amp;rsquo;s still better than being stuck in a chair for hours.&lt;/p&gt;
&lt;h3&gt;What kind of shoes should you wear?&lt;/h3&gt;
&lt;p&gt;Whatever are comfortable for you.&amp;nbsp; I have a pair of running shoes that I often wear while on the treadmill that are &amp;ldquo;indoor-only&amp;rdquo; so they&amp;rsquo;re clean.&amp;nbsp; But I also will frequently use the treadmill desk in bare feet, or in socks.&amp;nbsp; In the winter months, when it was a bit cooler in the house, I would even walk in slippers.&amp;nbsp; I haven&amp;rsquo;t had any problems with any of these options, but again, choose whatever footwear works for you.&amp;nbsp; If you&amp;rsquo;re just getting started, choose shoes that have good support, no different than if you were going to go for fairly long walk.&lt;/p&gt;
&lt;h3&gt;Does the Fitbit Flex work while you&amp;rsquo;re typing (and walking)?&lt;/h3&gt;
&lt;p&gt;I haven&amp;rsquo;t tried one myself, but I asked this question of Fitbit and was assured they&amp;rsquo;d tested it in such scenarios and it would record steps accurately under these circumstances.&lt;/p&gt;
&lt;h3&gt;How easy is it to adjust the height of the Lifespan TR1200 DT?&lt;/h3&gt;
&lt;p&gt;You can do it with one person, but it&amp;rsquo;s a bit easier with two.&amp;nbsp; There are to dials that you loosen, then pull out, releasing pins in the legs of the desk.&amp;nbsp; While the pins are out, you slide the desk up or down to the desired height, then replace the pins.&amp;nbsp; It&amp;rsquo;s best to do this with nothing on the desk.&amp;nbsp; Once at the desired height, tighten the dials back down &amp;ndash; this will eliminate any tendency for the desktop to wiggle (e.g. if all of the weight is on the back of it, like it is in my case with the mounted monitor stand).&lt;/p&gt;
&lt;h3&gt;How easy is it to use a chair with this setup?&lt;/h3&gt;
&lt;p&gt;Easy.&amp;nbsp; I have a bar-height chair a few steps away that I&amp;rsquo;ve used a few times.&amp;nbsp; I just set it on the treadmill itself, which has worked fine, but probably isn&amp;rsquo;t recommended for extended use (I suspect it could cause wear on the treadmill belt, but so far it&amp;rsquo;s been fine).&amp;nbsp; Alternately, pulling the treadmill itself out from under the desk is quite easily done.&amp;nbsp; There are two cables, a power cable and a small serial cable that connects it to the desk (and the controller on the front of the desk), that need undone, but that&amp;rsquo;s it.&amp;nbsp; There are wheels on the front of the treadmill, so if you just pick up the back of it, it will roll out of the way, as long as you have some room to maneuver.&amp;nbsp; Then you can stand (off of the treadmill) or put a (high) chair there if you&amp;rsquo;re taking an extended break from walking.&amp;nbsp; I haven&amp;rsquo;t done this, but the whole operation should take about 2 minutes (unless you&amp;rsquo;re very tight on space, in which case it might take longer).&lt;/p&gt;</description><pubDate>Thu, 23 May 2013 00:21:13 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/walking-while-working</guid></item><item><title>Regional Differences</title><link>http://ardalis.com:80/Regional-Differences</link><description>&lt;p&gt;Last week I ran a poll (that maxed out at 400 responses on twtpoll) asking &lt;a href="http://twtpoll.com/r/prkogv"&gt;how developers recommend using regions in C# (or not)&lt;/a&gt;.&amp;nbsp; You can see the results here:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://twtpoll.com/r/prkogv"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" border="0" alt="image" src="http://stevesmithblog.com/files/media/image/Windows-Live-Writer/Regional-Differences_8AAA/image_3.png" width="681" height="772" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;About 15% of the respondents chose Other and/or chose to leave a comment.&amp;nbsp; The comments are useful because they often highlight answer categories that I overlooked when I set up the poll.&amp;nbsp; In this case, there were a lot of comments, I think because there are a lot of different opinions about regions in general, some of them rather heated.&lt;/p&gt;
&lt;p&gt;Clearly the largest number of respondents simply never use Regions.&amp;nbsp; A number of comments went on to say things like &amp;ldquo;Regions aren&amp;rsquo;t evil I just don&amp;rsquo;t know a situation where they&amp;rsquo;re useful.&amp;rdquo;&amp;nbsp; The most popular use of regions from the ones I provided was for wrapping interface implementations, which isn&amp;rsquo;t too surprising since these regions are often automatically added when an interface is implemented automatically.&amp;nbsp; Similarly, a large number of comments referenced &amp;ldquo;generated code&amp;rdquo; as a use case for regions, which I probably should have included in the original listing.&lt;/p&gt;
&lt;p&gt;I added a couple of the options above, F and G, as items that I would consider obvious wrong answers on a standardized test.&amp;nbsp; Surprisingly, both got a reasonable number of votes, with 13% of respondents recommending the use of regions with long functions.&amp;nbsp; Now, some of these votes probably belong to commenters like this one: &amp;ldquo;Hiding long methods as I refactor it&amp;rdquo;.&amp;nbsp; If you&amp;rsquo;re temporarily collapsing sections of a long function during your refactoring exercise, that seems quite reasonable to me.&amp;nbsp; But if you&amp;rsquo;re putting regions into your function as a recommended, long-term approach, then I probably don&amp;rsquo;t want to work on that codebase with you.&amp;nbsp; I would much rather functions be small enough that (without regions) they fit on one screen, and if they get too big for that, fix the problem by extracting out well-named and well-composed methods, as opposed to hiding the problem behind regions.&amp;nbsp; And regions with regions.&amp;nbsp; Wow.&lt;/p&gt;
&lt;p&gt;My personal opinion is that regions had some great and common use cases in the early versions of .NET and C#.&amp;nbsp; For instance, the first version of ASP.NET used regions appropriately to hide auto-generated wire-up code in the codebehind.&amp;nbsp; A large number of comments continue to suggest that regions be used for generated code.&amp;nbsp; Today, two things make this less of an issue.&amp;nbsp; The first is partial classes.&amp;nbsp; Generated code today is almost always in its own class, or could be, and as such rather than wrapping it with a region, I find it is better to simply use a partial class to keep the generated code in a separate file from the custom code.&amp;nbsp; The second feature is more of an IDE feature.&amp;nbsp; A lot of users find regions helpful as a code navigation tool, or as a way to limit what they are looking at on the screen.&amp;nbsp; VS2010 provides great support for expanding and collapsing methods and other areas of code that you don&amp;rsquo;t wish to see, and tools like ReSharper make it trivial to navigate to a type or member anywhere in your solution&amp;nbsp; (ctrl-T, then type a substring of the type, then enter and you&amp;rsquo;re there.&amp;nbsp; For a member, the default keymap is the not-quite-as-easy-to-type ctrl-F12).&amp;nbsp; A number of comments also suggested using regions for using statements.&amp;nbsp; These don&amp;rsquo;t tend to bother me because I can quickly scroll down and not have to see them on my screen, and my using statements are usually quite small since ReSharper will clean up the ones I don&amp;rsquo;t need and will auto-add any that I do need, and my classes are small so they aren&amp;rsquo;t generally using more than a handful of other namespaces.&amp;nbsp; And of course, VS2010 supports collapsing using statements as well, like so:&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" border="0" alt="image" src="http://stevesmithblog.com/files/media/image/Windows-Live-Writer/Regional-Differences_8AAA/image_6.png" width="179" height="47" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why Consider Them Harmful, Smelly, or even &amp;ldquo;Evil&amp;rdquo;?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Evil is obviously a strong word, and of course since regions have no effect on compiled code, they can&amp;rsquo;t directly have any impact on the software you&amp;rsquo;re creating.&amp;nbsp; However, I do think it is at least fair to say that regions often represent &amp;ldquo;code smells.&amp;rdquo;&amp;nbsp; That is, areas of your code that may be worth investigating to see if there is rotten code that needs to be cleaned up.&amp;nbsp; Why do some, including me, tend to feel this way?&amp;nbsp; Because regions are often a symptom of underlying problems with the code itself.&amp;nbsp; Regions do two things:&lt;/p&gt;
&lt;ol&gt;&lt;ol&gt;
&lt;li&gt;Provide a single-line comment&lt;/li&gt;
&lt;li&gt;Wrap some number of lines of code and allow it to be hidden on demand&lt;/li&gt;
&lt;/ol&gt;&lt;/ol&gt;
&lt;p&gt;When might you need these features?&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The intent of the code is unclear&lt;/li&gt;
&lt;li&gt;The code is too long to quickly understand at a glance&lt;/li&gt;
&lt;li&gt;Both of the above&lt;/li&gt;
&lt;li&gt;You prefer an &amp;ldquo;outline view&amp;rdquo; of classes so you can drill into each category of member when you dig into a class&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In the case of items 1 through 3, regions are covering up problems.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the intent of a block of code is unclear, fix the code.&amp;nbsp; Extract a method.&amp;nbsp; Rename the variables.&amp;nbsp; Refactor.&amp;nbsp; Simplify.&amp;nbsp; Don&amp;rsquo;t add a comment or a region (glorified comment) to try and cover up the problem.&amp;nbsp; If you spill something in the kitchen, should you clean up the floor, or just throw a rug over it or put out an orange cone to warn people about the spill?&amp;nbsp; Which option is going to keep the kitchen optimally usable?&amp;nbsp; The same goes for your code.&amp;nbsp; Keep it clean. &amp;nbsp;&lt;strong&gt;Regions are rugs under which to sweep smelly code.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If the code is simply too long, fix it.&amp;nbsp; Eliminate duplication.&amp;nbsp; Refactor.&amp;nbsp; Abstract details into larger-grained operations.&amp;nbsp; If you&amp;rsquo;re spending 10 lines of plumbing code talking to a database or service, move that into its own method or class that is only responsible for that work.&amp;nbsp; If you&amp;rsquo;re spending lots of lines of code copying values from one object to another, use a tool like &lt;a href="http://automapper.codeplex.com/"&gt;Automapper&lt;/a&gt; to map the values with one line of code.&amp;nbsp; Keep your code concise and at the appropriate level of abstraction for the method you&amp;rsquo;re in, and don&amp;rsquo;t mix plumbing code with application code if you can help it.&lt;/p&gt;
&lt;p&gt;In the case of 4, regions are being used to do something that your IDE should be able to easily do for you. I won&amp;rsquo;t say regions are being mis-used in this context, but I do think that if a large number of people use them for this purpose, then Visual Studio or one of the add-in providers should provide this kind of view such that you don&amp;rsquo;t have to implement yourself in the source code with region statements.&amp;nbsp; I definitely think it&amp;rsquo;s valid that some developers prefer this view of their classes, I just don&amp;rsquo;t think they should have to clutter up everybody&amp;rsquo;s codebase in order to do so.&amp;nbsp; Let the IDE do that work.&amp;nbsp; And of course, if the classes and methods are small, the need for a high-level view is significantly lessened.&amp;nbsp; If you prefer to have all of your public properties in one section, public methods in another, private members in another, etc. then wouldn&amp;rsquo;t you prefer to have an IDE that would simply let you specify the organization you prefer, and automatically have it in every file you open?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Almost half of the developers polled would never recommend using regions.&amp;nbsp; Yet nearly 15% of those polled would recommend using them to organize long methods.&amp;nbsp; A great many use them to organize code into categories (public, private, methods, properties), though this could probably be better done automatically by a tool.&amp;nbsp; When .NET was young, regions provided a useful way to hide generated code within classes or to provide expand/collapse capabilities within the IDE.&amp;nbsp; Today, partial classes and improvements to the IDE and various plug-ins make these uses unnecessary for many developers.&amp;nbsp; Clearly, there are still some opportunities for IDE/plug-in vendors to build in code organization support that will further erode the legitimate use cases for regions.&amp;nbsp; If you&amp;rsquo;re not using them for such organizational purposes today, think about the underlying reason you&amp;rsquo;re using a region the next time you add one, and consider if you wouldn&amp;rsquo;t be better off correcting the underlying code deficiency rather than hiding it under the region rug.&lt;/p&gt;</description><pubDate>Tue, 21 May 2013 15:16:28 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/Regional-Differences</guid></item><item><title>Moving a Site to Windows Azure in 5 Easy Steps</title><link>http://ardalis.com:80/moving-a-site-to-windows-azure-in-5-easy-steps</link><description>&lt;p&gt;One of my sites is currently having issues where it’s currently hosted.&amp;nbsp; They’re resolved by restarting the application, but that’s gotten tedious and I simply don’t have time to invest in troubleshooting this particular site.&amp;nbsp; And, oh hey, those &lt;a href="http://www.windowsazure.com/en-us/pricing/member-offers/msdn-benefits/"&gt;MSDN Windows Azure benefits&lt;/a&gt; keep looking shiny like I should play with them.&amp;nbsp; So, I figure I’ll try moving the site to Azure and see if miraculously that fixes the problem.&lt;/p&gt; &lt;h2&gt;Step One: Activate Azure Benefit&lt;/h2&gt; &lt;p&gt;Sign into your account with your &lt;a href="https://msdn.microsoft.com/en-us/subscriptions"&gt;MSDN Subscription&lt;/a&gt;, and click the Activate Windows Azure link:&lt;/p&gt; &lt;p&gt;&lt;a href="https://msdn.microsoft.com/en-us/subscriptions"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Moving-a-Site-to-Windows-Azure_131EA/image_3.png" width="644" height="339"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Fill out the form, which will require a credit card and a mobile device (that can receive text messages) to complete.&lt;/p&gt; &lt;h2&gt;Step Two: Connect to Azure Portal&lt;/h2&gt; &lt;p&gt;Follow one of the many links to &lt;a href="https://manage.windowsazure.com"&gt;https://manage.windowsazure.com&lt;/a&gt; (or just click on mine).&amp;nbsp; There’s a ton of stuff you can configure and create from here.&amp;nbsp; In my case, since I may want to host more than one small website, and I want to be able to use A records (I’m not a fan of www in front of domains for web sites, which is pretty much required for CNAME DNS approaches), I’m choosing to create a small VM (&lt;a href="http://www.windowsazure.com/en-us/develop/net/common-tasks/custom-dns/"&gt;more on Azure DNS&lt;/a&gt;).&amp;nbsp; You can do this from the NEW command in the bottom left, and if you use the gallery option you can select the OS you want – in my case I went with Windows Server 2008 R2 SP1.&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Moving-a-Site-to-Windows-Azure_131EA/image_6.png" width="644" height="461"&gt;&lt;/p&gt; &lt;p&gt;Once you complete this wizard, it takes a few (really surprisingly few – I remember how long it took to deploy apps to the original version of Azure, and this is way faster) minutes to deploy and start the VM.&amp;nbsp; In a short while, you should see:&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Moving-a-Site-to-Windows-Azure_131EA/image_9.png" width="644" height="148"&gt;&lt;/p&gt; &lt;p&gt;So now what?&amp;nbsp; Click on your VM to see what you can do with it:&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Moving-a-Site-to-Windows-Azure_131EA/image_12.png" width="644" height="452"&gt;&lt;/p&gt; &lt;p&gt;The next thing I want to do is remote into the machine and start setting things up.&lt;/p&gt; &lt;h2&gt;Step Three: Connect to Virtual Machine&lt;/h2&gt; &lt;p&gt;My first thought was to just try to connect to the public foo.cloudapp.net name my VM was given, but of course that didn’t work.&amp;nbsp; Looking at your VM, navigate to the ENDPOINTS tab to see the public port configured for RemoteDesktop access.&amp;nbsp; You’ll need to specify that in your Remote Desktop Connection in order to connect (you do this by adding it to the end of your computer’s name following a : (colon)):&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Moving-a-Site-to-Windows-Azure_131EA/image_15.png" width="591" height="484"&gt;&lt;/p&gt;    &lt;p&gt;With that, you should be able to remote into the machine.&amp;nbsp; In my case, since I want this VM to act as a web server, the first thing I need to do is Add Roles and select the Web Server (IIS) role.&amp;nbsp; After that, the &lt;a href="http://www.microsoft.com/web/downloads/platform.aspx"&gt;web platform installer&lt;/a&gt; is your friend.&amp;nbsp; Once IIS is configured and I’ve gotten my web site’s files to the server, the next step is to configure the database.&lt;/p&gt; &lt;h2&gt;Step Four: Configure Database&lt;/h2&gt; &lt;p&gt;Your MSDN benefits include some database benefits in addition to the VM and web site benefits.&amp;nbsp; Note that the database benefits are fairly limited, so if you have a lot of small databases you may use up this benefit quickly.&amp;nbsp; With the Visual Studio Ultimate with MSDN benefit, you can use five 1GB web databases per month for free.&amp;nbsp; To create a new database, go back to the &lt;a href="https://manage.windowsazure.com/"&gt;Azure Management Portal&lt;/a&gt;, click on NEW, and choose SQL Database.&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Moving-a-Site-to-Windows-Azure_131EA/image_18.png" width="612" height="484"&gt;&lt;/p&gt; &lt;p&gt;Choose a name, and a server (or a new one will be created if this is your first SQL Database).&amp;nbsp; Then, if this is a new server, specify the username and password that will be used to connect to it.&amp;nbsp; Once set up, which takes a few seconds, you should see the database:&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Moving-a-Site-to-Windows-Azure_131EA/image_21.png" width="644" height="177"&gt;&lt;/p&gt; &lt;p&gt;So now, how do you connect to this database and move your existing data to it, is the next question… &lt;/p&gt; &lt;h2&gt;Step Five: Connect to a SQL Database in Windows Azure&lt;/h2&gt; &lt;p&gt;Click on the database name just like with the VM to see initial options:&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Moving-a-Site-to-Windows-Azure_131EA/image_24.png" width="644" height="404"&gt;&lt;/p&gt; &lt;p&gt;Now that you see the server info at the bottom, naturally the next step is to try and hit it with SQL Management Studio, but you’ll get this:&lt;/p&gt; &lt;p&gt;&lt;img title="SNAGHTML93b6115" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="SNAGHTML93b6115" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Moving-a-Site-to-Windows-Azure_131EA/SNAGHTML93b6115_1.png" width="625" height="245"&gt;&lt;/p&gt; &lt;p&gt;Security bites us again!&amp;nbsp; Click on the DASHBOARD link to change which IP addresses are allowed to connect to the server:&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Moving-a-Site-to-Windows-Azure_131EA/image_27.png" width="644" height="391"&gt;&lt;/p&gt; &lt;p&gt;It will help you out by suggesting your current client IP:&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Moving-a-Site-to-Windows-Azure_131EA/image_30.png" width="644" height="153"&gt;&lt;/p&gt; &lt;p&gt;Be sure to click the SAVE link at the bottom after you add it.&lt;/p&gt; &lt;p&gt;Voila!&amp;nbsp; Now you can connect from Management Studio, which will let you run whatever queries you need in order to get your data into the database.&lt;/p&gt; &lt;p&gt;One last note – to actually connect to your web site on your VM, you’ll need to set up an endpoint for port 80 via the VM’s ENDPOINTS menu.&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Moving-a-Site-to-Windows-Azure_131EA/image_33.png" width="644" height="457"&gt;&lt;/p&gt; &lt;p&gt;Once that’s in place, you should be able to hit your site in a browser:&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Moving-a-Site-to-Windows-Azure_131EA/image_36.png" width="244" height="153"&gt;&lt;/p&gt;</description><pubDate>Tue, 21 May 2013 02:42:53 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/moving-a-site-to-windows-azure-in-5-easy-steps</guid></item><item><title>When To Comment Your Code</title><link>http://ardalis.com:80/When-To-Comment-Your-Code</link><description>&lt;p&gt;My opinions on comments in software code have evolved with my experience.&amp;nbsp; When I was a teenager first learning to program for real, I rarely used comments unless the code was for an assignment, in which case it was a forced exercise every bit as much as teachers&amp;rsquo; requests to &amp;ldquo;show your work&amp;rdquo; added verbosity to my math and science problems&amp;rsquo; solutions.&amp;nbsp; Of course, the programs themselves were quite simple, and the languages used (BASIC, Pascal) didn&amp;rsquo;t really support OOP (not that I knew what that was).&amp;nbsp; And it was important, then, to be able to express the intent of the code in English, if only so the instructor knew what was being attempted.&amp;nbsp; It wasn&amp;rsquo;t uncommon to receive partial credit for comments describing the approach one would take, not having had enough time to actually write the code itself.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.amazon.com/gp/product/0262011530?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0262011530" rel="nofollow"&gt;&lt;img style="display: inline; margin-left: 0px; margin-right: 0px; border-width: 0px;" title="sicp-cover" border="0" alt="sicp-cover" align="right" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/WhenToCommentYourCode_11A0B/sicp-cover_3.jpg" width="178" height="178" /&gt;&lt;/a&gt; Later on in college, my first course used Scheme and the classic &lt;a href="http://mitpress.mit.edu/sicp/full-text/book/book.html" rel="nofollow"&gt;Structure and Interpretation of Computer Programs&lt;/a&gt; textbook.&amp;nbsp; My first labs included comments not for the instructor, but for my own sake.&amp;nbsp; Scheme is a very different kind of language from those I&amp;rsquo;d used before, and my lack of familiarity with it necessitated that I describe what esoteric blocks of parentheses were meant to be doing with comments.&amp;nbsp; I still have that textbook, the first edition, which I noted as I wrote this doesn&amp;rsquo;t even mention comments in its index.&amp;nbsp; The &lt;a href="http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-15.html#%_idx_1836" rel="nofollow"&gt;second edition, which is available online&lt;/a&gt;, has only this to say:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Semicolons in Scheme code are used to introduce &lt;em&gt;comments&lt;/em&gt;.&amp;nbsp; Everything from the semicolon to the end of the line is ignored by the interpreter.&amp;nbsp; In this book we don&amp;rsquo;t use many comments; we try to make our programs self-documenting by using descriptive names.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;Self-documenting&lt;/em&gt; is an interesting term and relates to the discussion of comments.&amp;nbsp; It even has a (small) &lt;a href="http://en.wikipedia.org/wiki/Self-documenting" rel="nofollow"&gt;wikipedia entry devoted to the concept&lt;/a&gt;.&amp;nbsp; The chief objective of self-documenting systems, according to this source, is that they &lt;strong&gt;make source code easier to read and understand&lt;/strong&gt;.&amp;nbsp; In my opinion, source code should be written in such a way that its simplicity eliminates the need for most comments.&amp;nbsp; I&amp;rsquo;ve collected here a number of &lt;a href="http://www.cs.cmu.edu/~pattis/quotations.html" rel="nofollow"&gt;quotes&lt;/a&gt; and excerpts on the subject of comments, and have added my own thoughts to these as well.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"The most reliable document of software is the code itself. In many cases, the code is the only documentation. Therefore, strive to make your code self-documenting, and where you can't, add comments." &lt;br /&gt;- &lt;a href="http://www.softwarequotes.com/showquotes.aspx?id=684&amp;amp;name=Read,Daniel" rel="nofollow"&gt;&lt;em&gt;Daniel Read&lt;/em&gt;&lt;/a&gt; - The Principle of Self-Documenting Code.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;The way to make programs easy to read is not to stuff them with comments... A good programming language ought to be better for explaining software than English. You should only need comments when there is some kind of kludge you need to warn readers about, just as on a road there are only arrows on parts with unexpectedly sharp curves.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;- P. Graham (in "Hackers and Painters" footnote 9, pg. 224)&lt;/i&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It&amp;rsquo;s hard sometimes to know what should or should not be commented, especially if you&amp;rsquo;re inexperienced.&amp;nbsp; What seems worthy of commenting to you might be obvious to someone with a better grasp of the system or programming language you&amp;rsquo;re working with.&amp;nbsp; Steve McConnell offers some advice on this.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0735619670/aspalliancecom"&gt;Code Complete&lt;/a&gt;, by Steve McConnell, is on my list of &lt;a href="http://stevesmithblog.com/blog/favorite-developer-books/"&gt;books I consider to be required reading for software developers&lt;/a&gt; today.&amp;nbsp; He notes:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Comments should explain the &lt;em&gt;why&lt;/em&gt; instead of the &lt;em&gt;how&lt;/em&gt; or &lt;em&gt;what&lt;/em&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Here are two examples of code from Code Complete that illustrate the poor usage of comments:&lt;/p&gt;
&lt;div id="codeSnippetWrapper"&gt;
&lt;div style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;" id="codeSnippet"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum1"&gt; 1:&lt;/span&gt; &lt;span style="color: #008000;"&gt;//set product to base&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum2"&gt; 2:&lt;/span&gt; product = &lt;span style="color: #0000ff;"&gt;base&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum3"&gt; 3:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum4"&gt; 4:&lt;/span&gt; &lt;span style="color: #008000;"&gt;//loop from 2 to "num"&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum5"&gt; 5:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;for&lt;/span&gt; ( &lt;span style="color: #0000ff;"&gt;int&lt;/span&gt; i = 2; i &amp;lt;= num; i++ ) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum6"&gt; 6:&lt;/span&gt;     &lt;span style="color: #008000;"&gt;//multiply "base" by "product"&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum7"&gt; 7:&lt;/span&gt;     product = product * &lt;span style="color: #0000ff;"&gt;base&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum8"&gt; 8:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum9"&gt; 9:&lt;/span&gt; System.&lt;span style="color: #0000ff;"&gt;out&lt;/span&gt;.println( &lt;span style="color: #006080;"&gt;"Product = "&lt;/span&gt; + product );&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;div id="codeSnippetWrapper"&gt;
&lt;div style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;" id="codeSnippet"&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum1"&gt; 1:&lt;/span&gt; &lt;span style="color: #008000;"&gt;//compute the square root of Num using the Newton-Raphson approximation&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum2"&gt; 2:&lt;/span&gt; r = num / 2;&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum3"&gt; 3:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;while&lt;/span&gt; ( abs( r - (num/r) ) &amp;gt; TOLERANCE ) {&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum4"&gt; 4:&lt;/span&gt;     r = 0.5 * ( r + (num/r) );&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum5"&gt; 5:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum6"&gt; 6:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;!--CRLF--&gt;
&lt;pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"&gt;&lt;span style="color: #606060;" id="lnum7"&gt; 7:&lt;/span&gt; System.&lt;span style="color: #0000ff;"&gt;out&lt;/span&gt;.println( &lt;span style="color: #006080;"&gt;"r = "&lt;/span&gt; + r );&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;McConnell concludes:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;If the code is so complicated that it needs to be explained, it&amp;rsquo;s nearly always better to improve the code than it is to add comments.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;One of the simplest ways to achieve this is to name variables and classes consistently and descriptively, in plain English.&amp;nbsp; Another is to keep methods small, well-named, and single-purposed.&amp;nbsp; When you see a method growing out of control, that&amp;rsquo;s a sign that another method is growing inside of it &amp;ndash; use &lt;em&gt;extract method&lt;/em&gt; to set it free and give it a descriptive name.&lt;/p&gt;
&lt;p&gt;When structuring a process, it&amp;rsquo;s a common practice to start out by writing comments for the steps involved, e.g.:&lt;/p&gt;
&lt;p&gt;// Extract the data from the old system&lt;/p&gt;
&lt;p&gt;// Transform the data&lt;/p&gt;
&lt;p&gt;// Load the data into the new system&lt;/p&gt;
&lt;p&gt;This is fine in my opinion as a way to organize one&amp;rsquo;s thoughts, but the next step isn&amp;rsquo;t to put 100 lines of code after each comment, it&amp;rsquo;s to replace each comment with a method name, e.g.:&lt;/p&gt;
&lt;p&gt;Extract();&lt;/p&gt;
&lt;p&gt;Transform();&lt;/p&gt;
&lt;p&gt;Load();&lt;/p&gt;
&lt;p&gt;A couple more quotes from Steve McConnell:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Good code is its own best documentation. As you're about to add a comment, ask yourself, "How can I improve the code so that this comment isn't needed?" Improve the code and then document it to make it even clearer.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;- S. McConnell&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It's OK to figure out murder mysteries, but you shouldn't need to figure out code. You should be able to read it.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;- S. McConnell&lt;/i&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Comment Only What the Code Cannot Say&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.amazon.com/gp/product/0596809484?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0596809484" rel="nofollow"&gt;&lt;img style="margin: 0px 0px 0px 10px; display: inline; border-width: 0px;" title="97thingscover" border="0" alt="97thingscover" align="right" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/WhenToCommentYourCode_11A0B/97thingscover_3.jpg" width="107" height="160" /&gt;&lt;/a&gt; In &lt;a href="http://www.amazon.com/gp/product/0596809484?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0596809484" rel="nofollow"&gt;97 Things Every Programmer Should Know&lt;/a&gt;, Kevlin Henney writes a small essay on comments, including:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What of comments that are not technically wrong, but add no value to the code? Such comments are noise.&lt;/p&gt;
&lt;p&gt;A prevalence of noisy comments and incorrect comments in a code base encourage programmers to ignore all comments, either by skipping past them or by taking active measures to hide them.&lt;/p&gt;
&lt;p&gt;Try to express as much as possible through code. Any shortfall between what you can express in code and what you would like to express in total becomes a plausible candidate for a useful comment. Comment what the code &lt;i&gt;cannot&lt;/i&gt; say, not simply what it does not say.&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://programmer.97things.oreilly.com/wiki/index.php/Comment_Only_What_the_Code_Cannot_Say" rel="nofollow"&gt;Read the full essay here&lt;/a&gt;]&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Again, the point is made that comments should not say what code simply does &amp;ndash; the code should do that already.&amp;nbsp; If the code isn&amp;rsquo;t clear, &lt;em&gt;make it clear&lt;/em&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If your clothes are smelly, &lt;strong&gt;wash them&lt;/strong&gt;, don&amp;rsquo;t spray Axe body spray all over them to try and communicate that they shouldn&amp;rsquo;t smell.&lt;/p&gt;
&lt;p&gt;My own contribution to the 97TEPSK book is the &lt;a href="http://stevesmithblog.com/blog/don-rsquo-t-repeat-yourself/"&gt;Don&amp;rsquo;t Repeat Yourself principle&lt;/a&gt; (I didn&amp;rsquo;t invent it, I just wrote about it for the book).&amp;nbsp; Comments that say only what the code already makes clear merely add noise and violate the Don&amp;rsquo;t Repeat Yourself principle.&amp;nbsp; They invite bugs for all the usual reasons that repetition in software attracts bugs, and have the added effect of &lt;strong&gt;drowning out any truly insightful and important comments&lt;/strong&gt; by training developers to ignore comments.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Comments Can Be (and frequently are) Wrong&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;hellip;and the only way to know it is to read and understand the code.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;A comment is of zero (or negative) value if it is wrong.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;- Kernighan and Plauger, The Elements of Programming Style&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;If the code and the comments disagree, then both are probably wrong.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;- N. Schryer&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Don't get suckered in by the comments -they can be terribly misleading: Debug only the code.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;- D. Storer&lt;/i&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Since you can&amp;rsquo;t trust comments to be correct, and you can&amp;rsquo;t verify their correctness in any automated fashion (at the time of this writing, I&amp;rsquo;m unaware of any comment unit testing frameworks), the only way to verify the correctness of comments is to read and understand the code they relate to.&amp;nbsp; If the comment attempts to express what the code does, then if ever the code or the comment changes such that the two are no longer in sync, bugs are bound to occur if the comment rather than the code is used as the basis of understanding what the application does.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In Software Design&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;- C.A.R. Hoare&lt;/i&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Which of the above two software designs do you think would require more comments?&amp;nbsp; Interestingly, one quote sees the act of being forced to write comments as being potentially helpful to design:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Being forced to write comments actually improves code, because it is easier to fix a crock than to explain it.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;- G. Steele&lt;/i&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The assumption seems to be that one need only comment the ugly bits in the code, and so by cleaning them up one avoids the necessity of explaining the ugliness.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In Communication&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Omit needless words. Vigorous writing is concise. A sentence should contain no unnecessary words, a paragraph no unnecessary sentences, for the same reason that a drawing should have no unnecessary lines and a machine no unnecessary parts.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;- W Strunk Jr (in &lt;i&gt;The Elements of Style&lt;/i&gt;) &lt;/i&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Software source code is written for two audiences: computers and programmers.&amp;nbsp; Computers don&amp;rsquo;t care what the code looks like, how it&amp;rsquo;s organized, what things are named, and certainly what the comments say.&amp;nbsp; Programmers, of course, will care about many of these things.&amp;nbsp; By keeping the source code simple and without unneeded noise, we maximize its clarity as an instrument of communication.&amp;nbsp; Note that I&amp;rsquo;m not suggesting we minimize the number of characters used or anything silly like that.&amp;nbsp; But we should avoid redundancy and repetition and vestigial blocks of text that serve no functional purpose as much as possible, as these cloud the clarity of the code.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"The most common kind of coding bug, and often considered the least harmful, are documentation bugs (&lt;strong&gt;i.e., erroneous comments&lt;/strong&gt;). Although many documentation bugs are simple spelling errors or the result of poor writing, many are actual errors - that is, misleading or erroneous comments. We can no longer afford to discount such bugs, because their consequences are as great as 'true' coding errors. Today programming labor is dominated by maintenance. This will increase as software becomes even longer-lived. Documentation bugs lead to incorrect maintenance actions and therefore cause the insertion of other bugs. " &lt;br /&gt;- &lt;a href="http://www.softwarequotes.com/showquotes.aspx?id=558&amp;amp;name=Beizer,Boris"&gt;Boris Beizer&lt;/a&gt; - Chapter 2: The Taxonomy of Bugs, Section 3.5. , Software testing techniques by Boris Beizer , ISBN: 0442206720&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Here Be Dragons&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In addition to expressing &lt;em&gt;why&lt;/em&gt;, comments should also be used to explain &lt;em&gt;why not&lt;/em&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"Write comments that emphasize potential hazards. " &lt;br /&gt;- &lt;a href="http://www.softwarequotes.com/showquotes.aspx?id=552&amp;amp;name=Maguire,Steve" rel="nofollow"&gt;&lt;em&gt;Steve Maguire&lt;/em&gt;&lt;/a&gt; - Chapter 5: Candy-Machine Interfaces. , Writing Solid Code: Microsoft's Techniques for Developing Bug-Free C Programs by Steve Maguire , ISBN: 1556155514&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img style="margin: 0px 0px 10px 10px; display: inline; border-width: 0px;" title="image" border="0" alt="image" align="right" src="http://stevesmithblog.com/files/media/image/WindowsLiveWriter/WhenToCommentYourCode_8F3C/image_3.png" width="149" height="87" /&gt; Sometimes you&amp;rsquo;ll find that code needs to be written in a way that might not be intuitive to another programmer (or yourself) at a later date.&amp;nbsp; Maybe it is inconsistent with the usual way things are done, or it appears to be inefficient and in need of optimization, but you know, at this moment, that the consistent or optimized way does not work, while the current implementation does.&amp;nbsp; Here is a great opportunity to say what the code cannot with a comment: why not optimize it?&lt;/p&gt;
&lt;p&gt;Like caution signs on roadways, comments can warn of dangers in the codebase.&amp;nbsp; But just like ubiquitous &amp;ldquo;Are you sure?&amp;rdquo; windows, too many comments can condition developers to ignore the important warnings along with the noise.&lt;/p&gt;
&lt;p&gt;[&lt;a href="http://en.wikipedia.org/wiki/Here_be_dragons" rel="nofollow"&gt;more on Here Be Dragons origins&lt;/a&gt;]&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Comment Therapy&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;ve had comment-writing beaten into you to the point where it&amp;rsquo;s not natural for you to simply write code that expresses what it does clearly, consider these techniques:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;"When you feel the need to write a comment, first try to refactor the code so that any comment becomes superflouus." &lt;br /&gt;- &lt;a href="http://www.softwarequotes.com/showquotes.aspx?id=573&amp;amp;name=Fowler,Martin" rel="nofollow"&gt;&lt;em&gt;Martin Fowler&lt;/em&gt;&lt;/a&gt;, Refactoring: Improving the Design of Existing Code by Martin Fowler, Kent Beck (Contributor), John Brant (Contributor), William Opdyke, don Roberts , ISBN: 0201485672&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And of course, if you really want to know what code does, read (and execute) the tests for the code.&amp;nbsp; If the tests are written in a self-documenting fashion, they should have expressive names that tell you how the code should behave under certain circumstances.&amp;nbsp; Does it throw an exception when you pass in a null parameter?&amp;nbsp; Hmm, well there&amp;rsquo;s a test called FooShouldThrowExceptionWhenParameterIsNull, and it&amp;rsquo;s Green, so I&amp;rsquo;m going to say that yes, at this moment, that&amp;rsquo;s the behavior.&amp;nbsp; What, there&amp;rsquo;s no test for that?&amp;nbsp; You know how to fix that, don&amp;rsquo;t you?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Comments for Documentation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Many programming languages support some kind of documentation-extracted-from comments feature.&amp;nbsp; In .NET there are /// &amp;lt;summary&amp;gt;&amp;hellip;&amp;lt;/summary&amp;gt; XML comments that can be used with NDoc / Sandcastle.&amp;nbsp; In Java there is JavaDoc.&amp;nbsp; If you&amp;rsquo;re generating such comments, my first question is, is anybody actually reading the generated documentation?&amp;nbsp; My second question is, how useful is it?&amp;nbsp; I&amp;rsquo;ve probably searched for some documentation on a class hundreds of times only to end up on a website with the auto-generated documentation where it says only the most obvious of information about the class &amp;ndash; and provides no examples.&amp;nbsp; &lt;a href="http://msdn.microsoft.com"&gt;http://msdn.microsoft.com&lt;/a&gt; used to be awful in this regard, but has lately gotten much better.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re shipping a framework or a product with a public API, then obviously documentation of what the code does is important.&amp;nbsp; However, in both of these cases only the public interface needs to be described in great detail, and in .NET you can actually &lt;a href="http://stevesmithblog.com/blog/use-interfaces-for-metadata-and-comments/"&gt;apply your XML comments to an interface, rather than to a class&lt;/a&gt;, which I think makes more sense since ideally you want the interface to be the primary way other components interact with your framework and classes, to avoid tight coupling.&amp;nbsp; XML comments on interfaces are also picked up by Intellisense in Visual Studio for classes implementing the interface.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Clean Code&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.amazon.com/gp/product/0132350882?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0132350882" rel="nofollow"&gt;&lt;img style="margin: 0px 0px 10px 10px; display: inline;" align="right" src="http://ecx.images-amazon.com/images/I/41wGTnmRTFL._SL160_.jpg" /&gt;&lt;/a&gt;In &lt;a href="http://www.amazon.com/gp/product/0132350882?ie=UTF8&amp;amp;tag=aspalliancecom&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0132350882" rel="nofollow"&gt;Clean Code&lt;/a&gt;, Robert &amp;ldquo;Uncle Bob&amp;rdquo; Martin devotes a chapter to Good Comments (chapter 4).&amp;nbsp; Here&amp;rsquo;s a brief excerpt from the start of the chapter, with which I agree completely:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The proper use of comments is to compensate for our failure to express ourself[sic] in code.&amp;nbsp; Note that I used the word &lt;em&gt;failure&lt;/em&gt;.&amp;nbsp; I meant it.&amp;nbsp; Comments are always failures.&amp;nbsp; We must have them because we cannot always figure out how to express ourselves without them, but their use is not a cause for celebration.&lt;/p&gt;
&lt;p&gt;So when you find yourself in a position where you need to write a comment, think it through and see whether there isn&amp;rsquo;t some way to turn the tables and express yourself in code.&amp;nbsp; Every time you express yourself in code, you should pat yourself on the back.&amp;nbsp; Every time you write a comment, you should grimace and feel the failure of your ability of expression.&lt;/p&gt;
&lt;p&gt;Why am I so down on comments?&amp;nbsp; Because they lie.&amp;nbsp; Not always, and not intentionally, but too often.&lt;/p&gt;
&lt;p&gt;Truth can only be found in one place: the code.&amp;nbsp; Only the code can truly tell you what it does.&amp;nbsp; It is the only source of truly accurate information.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So, since you can&amp;rsquo;t trust comments, you have to read the code to know what it does.&amp;nbsp; And since you&amp;rsquo;re going to have to read (and understand) the code anyway, it&amp;rsquo;s certainly better to spend the energy and thought making the code simple and clear and readable, rather than trying to explain what a mess of code is attempting to do (or was at some point in the past when the comment was added).&lt;/p&gt;
&lt;p&gt;Clean Code also goes on to recommend that boilerplate comments such as licensing/copyright information, change history, and old blocks of code that might someday be useful can all be replaced with proper version control systems and post-build processes that leave the actual source files small and clean.&amp;nbsp; Use the right tool for the job &amp;ndash; source control is a much better way to store change history and &lt;a href="http://stevesmithblog.com/search/?q=vestigial+code"&gt;vestigial code&lt;/a&gt; than within the code itself, and no programmer working day-in and day-out should need to trip over legalese that can easily be appended to the top of every file out-of-band or as part of packaging the files for a release.&lt;/p&gt;
&lt;p&gt;Clean Code is another book I highly recommend, and is one of &lt;a href="http://stevesmithblog.com/blog/favorite-developer-books/"&gt;my favorite developer books&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;While not strictly evil, comments should generally be avoided where the code can tell what it does as well or better.&amp;nbsp; Good comments tell only what the code cannot express itself, such as why a particular technique was favored or the dangers of optimizing a block of code.&amp;nbsp; Most other kinds of comments are simply noise, and their presence clutters of code, making it more difficult to understand and creating errors when, inevitably, the comments get out of sync with the code they reference.&amp;nbsp; Overuse of comments also tends to make real warnings less noticeable, just as the boy who cried wolf trained the townspeople to ignore is warnings.&amp;nbsp; Consider carefully how and when comments should be used within your codebase.&lt;/p&gt;</description><pubDate>Thu, 09 May 2013 02:01:22 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/When-To-Comment-Your-Code</guid></item><item><title>Speaking at FalafelCon</title><link>http://ardalis.com:80/speaking-at-falafelcon</link><description>&lt;p&gt;&lt;a href="http://www.falafel.com/falafel-con-2013"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 0px 5px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="clip_image001" border="0" alt="clip_image001" align="right" src="http://ardalis.com/Media/Default/Windows-Live-Writer/a8458fea12ce_C4FA/clip_image001_3.png" width="244" height="204"&gt;&lt;/a&gt;Hey, California people, I’m coming your way.&amp;nbsp; I’ll be speaking at &lt;a href="http://www.falafel.com/falafel-con-2013"&gt;FalafelCon 2013&lt;/a&gt; next month about Refactoring with SOLID Principles.&amp;nbsp; The event is taking place 10-11 June 2013 at &lt;a href="http://www.falafel.com/falafel-con-2013/venue"&gt;Microsoft’s Silicon Valley campus&lt;/a&gt;.&amp;nbsp; The speaker lineup looks pretty awesome, with keynotes from &lt;a href="https://twitter.com/shanselman"&gt;Scott Hanselman&lt;/a&gt;, &lt;a href="https://twitter.com/worksonmypc"&gt;Stephen Forte&lt;/a&gt;, &lt;a href="https://twitter.com/michelebusta"&gt;Michele Bustamante&lt;/a&gt;, and &lt;a href="https://twitter.com/TimHuckaby"&gt;Tim Huckaby&lt;/a&gt;, and tracks covering Web, Mobile, &lt;a href="http://sitefinity.com/"&gt;Sitefinity&lt;/a&gt;, and TestComplete.&lt;/p&gt; &lt;p&gt;My session will briefly cover the SOLID principles of object-oriented design, which you can of course learn more about in my &lt;a href="http://pluralsight.com/training/courses/TableOfContents?courseName=principles-oo-design&amp;amp;highlight="&gt;Pluralsight course on SOLID Principles of Object Oriented Design&lt;/a&gt;.&amp;nbsp; In addition to discussing each principle, this presentation also demonstrates how, through simple refactoring techniques, programming structures that are causing you as the developer pain can be improved, resulting in a better design.&amp;nbsp; As it happens, I’m currently working on a course on Refactoring for Pluralsight, which I hope to add to &lt;a href="http://pluralsight.com/training/Authors/Details/steve-smith"&gt;my list of published courses&lt;/a&gt; there soon.&lt;/p&gt; &lt;p&gt;If you’re in the area, I hope you’ll attend.&amp;nbsp; If you do, please let me know how you enjoyed the presentation.&lt;/p&gt;</description><pubDate>Mon, 06 May 2013 18:13:48 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/speaking-at-falafelcon</guid></item><item><title>March 2013 Pluralsight Experiment</title><link>http://ardalis.com:80/march-2013-pluralsight-experiment</link><description>&lt;h2&gt;Update: Winner and Results&lt;/h2&gt;
&lt;p&gt;The winner of the experiment's prize is &lt;a href="http://pluralsight.com/training/users/tinfrey"&gt;Martin Frey&lt;/a&gt; (&lt;a href="http://twitter.com/tinfrey"&gt;@tinfrey&lt;/a&gt;). &amp;nbsp;You can watch &lt;a href="https://dl.dropbox.com/u/14515711/march2013_twitterexperiment.mp4"&gt;a video of the random drawing here&lt;/a&gt; (I'll keep the file up until at least 1 May 2013).&lt;/p&gt;
&lt;p&gt;In terms of the results of the experiment, I would say they were somewhat inconclusive. &amp;nbsp;I noted in the initial post below that my SOLID course averaged just 78 minutes per unique subscriber in February. &amp;nbsp;Reviewing the figure, it's actually 77.31 minutes. &amp;nbsp;In March, during the experiment, this jumped all the way up to 77.42 minutes (almost 7 seconds more!). &amp;nbsp;Looking at another course, Kanban Fundamentals, the course's per-user viewing time average ranged from 41.9 minutes in Dec 2012 to 36.3 minutes in January, up to 39.8 minutes in February, and maxed out at 43.2 minutes in March. &amp;nbsp;It's difficult to say if this was natural variation, a result of this experiment, or due to other factors, though.&lt;/p&gt;
&lt;p&gt;For the experiment, the courses' popularity for entries was as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Creating N-Tier Apps Part 1, 13 entries&lt;/li&gt;
&lt;li&gt;Creating N-Tier Apps Part 2, 8 entries (and the winner)&lt;/li&gt;
&lt;li&gt;Design Patterns Library, 3 entries&lt;/li&gt;
&lt;li&gt;Kanban Fundamentals, 12 entries&lt;/li&gt;
&lt;li&gt;SOLID Principles of OO Design, 12 entries&lt;/li&gt;
&lt;li&gt;&lt;a href="http://pluralsight.com/training/Courses/TableOfContents/web-perf"&gt;Web Application Performance and Scalability Testing&lt;/a&gt;, 0 entries (c'mon, really? &amp;nbsp;it's not a bad course, honest!)&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;Thanks to everybody for participating. &amp;nbsp;Martin - please DM me with your email address and I'll send you the Amazon gift certificate.&lt;/div&gt;
&lt;h2&gt;The Experiment&lt;/h2&gt;
&lt;p&gt;See how many people will spend more time learning via &lt;a href="http://pluralsight.com/"&gt;Pluralsight&lt;/a&gt; (and actually &lt;b&gt;completing&amp;nbsp;&lt;/b&gt;courses, not just watching a little bit) with a chance at $100 as motivation.&lt;/p&gt;
&lt;h2&gt;&lt;img title="image" style="background-image: none; float: right; padding-top: 0px; padding-left: 0px; margin: 0px 0px 5px 5px; display: inline; padding-right: 0px; border: 0px;" border="0" alt="image" align="right" src="http://ardalis.com/Media/Default/Windows-Live-Writer/March-2013-Pluralsight-Experiment_14D17/image_3.png" width="244" height="241" /&gt;The Prize&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;$100&amp;nbsp;&lt;/strong&gt;Amazon Gift Certificate (out of my own pocket).&amp;nbsp; Just one.&amp;nbsp; To be sent to the winner via email.&lt;/p&gt;
&lt;h2&gt;The Rules&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;You must be a Pluralsight subscriber with a public profile (like &lt;a href="http://pluralsight.com/training/users/steve-smith"&gt;this one&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;You must tweet that you&amp;rsquo;ve completed one of &lt;a href="http://ardalis.com/training-classes"&gt;my courses&lt;/a&gt; (&lt;b&gt;by name&lt;/b&gt;), with a link to your public profile and with @ardalis mentioned in the tweet (so I can track them; not at the start of the tweet like a reply).&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;If your profile doesn&amp;rsquo;t list the course as complete, you won&amp;rsquo;t be entered to win&lt;/li&gt;
&lt;li&gt;You don&amp;rsquo;t have to have passed the assessment&lt;/li&gt;
&lt;li&gt;Example (the link must go to your profile):&lt;br /&gt;&lt;b&gt;Just completed Kanban Fundamentals by @ardalis &lt;a href="http://ow.ly/ixQbb"&gt;http://ow.ly/ixQbb&lt;/a&gt; &lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;You may enter multiple times, but only one time per course during the contest period&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;That is, if you complete 3 of my courses, and tweet each one, you will have 3 chances to win&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;The contest ends at 11:59pm EST on 31 March 2013.&lt;/li&gt;
&lt;li&gt;Winner will be chosen at random and selected by 5 April 2013, and notified via Twitter&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;In the event the profile listed in the tweet and the person tweeting do not match, the person matching the Pluralsight profile will be deemed the winner&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Eligible courses include any listed on my &lt;a href="http://pluralsight.com/training/Authors/Details/steve-smith"&gt;Pluralsight Author Page&lt;/a&gt;; I&amp;rsquo;ve also created an SVG/PNG &lt;a href="http://ardalis.com/training-classes"&gt;graphical learning path of my training courses&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Questions?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;But I completed your course a long time ago &amp;ndash; can I still enter?&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Sure, as long as you follow all of the rules above and the course shows on your public profile&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Which course(s) would you recommend?&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;I think the &lt;a href="http://pluralsight.com/training/Courses/TableOfContents/principles-oo-design"&gt;SOLID Principles course&lt;/a&gt; should be required for all software developers, but if you&amp;rsquo;re looking for the quickest way to complete a course, &lt;a href="http://pluralsight.com/training/Courses/TableOfContents/kanban-fundamentals"&gt;Kanban Fundamentals&lt;/a&gt; is only 92 minutes long. Any and all of them are fair game, though.&amp;nbsp; Kudos to anybody who gets through all of the &lt;a href="http://pluralsight.com/training/Courses/TableOfContents/patterns-library"&gt;Design Patterns Library&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;What should I spend my $100 on?&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;I have some &lt;a href="http://ardalis.com/favorite-developer-books"&gt;recommended developer books&lt;/a&gt; you might consider. I&amp;rsquo;m also a big fan of my &lt;a href="http://amzn.to/14AmpDr"&gt;LifeSpan TR1200-DT treadmill desk&lt;/a&gt;, which you could apply the gift card toward.&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;What course are you working on now?&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;I&amp;rsquo;m currently recording a Refactoring Fundamentals course.&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Will you share the data?&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Yes, I&amp;rsquo;ll be sure to share the results of the experiment.&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;Are you just doing this as a cheap(?) way to increase traffic to your courses?&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;You saw through me so easily?&amp;nbsp; That&amp;rsquo;s the experiment part of things &amp;ndash; I have no idea if this will cost me money, break even, or if the increase in royalties will cover the prize and trouble of running the experiment.&amp;nbsp; I do know that in February 2013 my SOLID course was watched about 78 minutes per unique subscriber who watched it.&amp;nbsp;&amp;nbsp; The course is 248 minutes long, so that&amp;rsquo;s just 31% of the course.&amp;nbsp; I&amp;rsquo;m wondering if I can make a noticeable impact on March&amp;rsquo;s course completion rate.&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;How do I set up a public profile on Pluralsight?&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Log in.&lt;/li&gt;
&lt;li&gt;Click on your username in the top-right.&lt;/li&gt;
&lt;li&gt;Click on Your profile&lt;/li&gt;
&lt;li&gt;Customize your user name if you wish to do so&lt;/li&gt;
&lt;li&gt;Click the Share my profile button if it&amp;rsquo;s not already enabled.&lt;/li&gt;
&lt;li&gt;If it&amp;rsquo;s currently shared, you should see something like this:&lt;br /&gt;When you share your profile, others can access it here: &lt;a href="http://pluralsight.com/users/steve-smith"&gt;http://pluralsight.com/users/steve-smith&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;</description><pubDate>Thu, 04 Apr 2013 03:06:52 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/march-2013-pluralsight-experiment</guid></item><item><title>Speed Up YouTube Videos</title><link>http://ardalis.com:80/speed-up-youtube-videos</link><description>&lt;p&gt;If you’ve ever wanted to speed up a YouTube video, like you can do with &lt;a href="http://pluralsight.com/training/Authors/Details/steve-smith"&gt;Pluralsight training videos&lt;/a&gt;, here’s a quick tip to show you how to do so.&lt;/p&gt; &lt;p&gt;Today, I was watching the KendoUI 2013Q1 Release Keynote on YouTube, because I wasn’t able to catch it live.&amp;nbsp; It’s a little over an hour long, and I’ve become rather spoiled lately by Pluralsight’s video player, which lets you adjust the speed to whatever level you’re comfortable with between 1x and 2x in .1 increments, like so:&lt;/p&gt; &lt;p&gt;&lt;a href="http://pluralsight.com/training/Player?author=steve-smith&amp;amp;name=n-tier-apps-part1-m1&amp;amp;mode=live&amp;amp;clip=0&amp;amp;course=n-tier-apps-part1"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Speed-Up-YouTube-Videos_B15D/image_3.png" width="541" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The iOS app for Pluralsight also supports this, and I usually set it around 1.5 or 1.6, personally.&lt;/p&gt; &lt;p&gt;Back on YouTube, the default Flash player has no such controls:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.youtube.com/watch?v=b65u7ZihZiQ"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Speed-Up-YouTube-Videos_B15D/image_6.png" width="588" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;However, if you switch to the HTML5 player for YouTube, you can control playback speed.&amp;nbsp; You’re limited to choosing between 1.5x and 2x speeds, but this is probably good enough for most people, and certainly an improvement over having no choice at all.&amp;nbsp; To switch to the HTML5 player, you need to opt into HTML5 for your YouTube account.&amp;nbsp; To do that, go to &lt;a href="http://youtube.com/html5"&gt;youtube.com/html5&lt;/a&gt; and click the “Join the HTML5 Trial” link at the bottom.&amp;nbsp; Once you do, it should immediately opt you in and look like this:&lt;/p&gt; &lt;p&gt;&lt;a href="http://youtube.com/html5"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Speed-Up-YouTube-Videos_B15D/image_9.png" width="644" height="367"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Once you’re opted into the HTML5 trial (which I believe has been going on since 2011…), you’ll be using the HTML5 player by default for all of your YouTube viewing, and thus will have access to the new Settings functionality:&lt;/p&gt; &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Speed-Up-YouTube-Videos_B15D/image_12.png" width="492" height="484"&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h2&gt;Summary&lt;/h2&gt; &lt;p&gt;That’s it!&amp;nbsp; All you need to do to be able to speed up your YouTube video viewing by 1.5 or 2x is join the YouTube HTML5 trial, and then select the speed you prefer from the settings dialog on the videos you watch.&amp;nbsp; Note that you can also slow down videos to half- or quarter-speed as well, which can be interesting.&amp;nbsp; You’ll thank me later for all the time you’ll save if you frequently watch screencast or lecture-style content on YouTube.&lt;/p&gt;</description><pubDate>Fri, 22 Mar 2013 17:27:06 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/speed-up-youtube-videos</guid></item><item><title>When Should You Arrive for an Interview</title><link>http://ardalis.com:80/when-should-you-arrive-for-an-interview</link><description>&lt;p&gt;We’ve been doing a lot of interviewing as we grow our team in Hudson, Ohio for &lt;a href="http://www.telerik.com/services/overview.aspx"&gt;Telerik Services&lt;/a&gt;.&amp;nbsp; We have a fairly small office in a suburban environment, where you can basically park right outside the building and walk right in – no elevators, reception area, parking decks, or other hassles you might find in a more urban location.&amp;nbsp; As a result, we’ve learned that if we schedule an interview, we should be prepared for the candidate to arrive at least ten to fifteen minutes earlier than the allotted time.&amp;nbsp; This is somewhat in contrast with what I learned was the “right” thing to do, which is to arrive 5 minutes early, so that you’re not interrupting whomever you’re meeting with by arriving any earlier.&amp;nbsp; Now, it’s important to leave plenty of time in your travel plans to ensure that you can arrive 5 minutes early, but if I were to arrive 20 minutes ahead of the scheduled time, I would find somewhere to spend a few minutes before knocking on the door.&lt;/p&gt; &lt;p&gt;Since so many of the recent candidates for positions were arriving 15 or more minutes ahead of schedule, I thought I’d run a &lt;a href="http://twtpoll.com/ugdcx5"&gt;twitter survey&lt;/a&gt; to see if my own position was in line with current industry expectations.&amp;nbsp; It turns out that most folks do, in fact, think that arriving earlier is the appropriate thing to do, with most of the respondents suggesting candidates arrive 10 minutes early, and the 2nd most suggesting 15.&amp;nbsp; A couple even suggested arriving earlier than that.&lt;/p&gt; &lt;p&gt;Note that I specifically stated “arrive at the reception area” – not the parking lot – for this question.&amp;nbsp; I understand that if you’re going to an urban environment or a large corporate campus you’ll want to leave plenty of time to get from your car to wherever your meetings are scheduled.&lt;/p&gt; &lt;p&gt;&lt;a href="http://twtpoll.com/ugdcx5"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/9cc3396a0b37_7B97/image_3.png" width="485" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Of course, this isn’t a terribly scientific poll, but it does at least serve to demonstrate that our recent experience isn’t outside of current industry expected behavior.&amp;nbsp; I’m not sure this information will change my own behavior when I’m the one visiting another office – I still think “on time is late, 5 minutes early is on time.”&amp;nbsp; But it seems like, more and more, that wisdom is shifting earlier:&lt;/p&gt; &lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/9cc3396a0b37_7B97/image_6.png" width="244" height="73"&gt;&lt;/p&gt; &lt;p&gt;I wonder if the answers would be terribly different if I asked the same question, but about when to show up for a dinner invitation at an acquaintance’s home?&amp;nbsp; In that case, is it better to be “fashionably late,” or at least, not to arrive 20 minutes early when the hosts are no doubt still preparing for the visit?&amp;nbsp; Maybe that’s a poll for another day.&lt;/p&gt;</description><pubDate>Wed, 20 Mar 2013 15:00:17 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/when-should-you-arrive-for-an-interview</guid></item><item><title>How To Contribute to ASPNET Yourself</title><link>http://ardalis.com:80/how-to-contribute-to-aspnet-yourself</link><description>&lt;p&gt;Recently I upgraded the Stir Trek conference site’s web code from ASP.NET MVC 2 to 4.&amp;nbsp; When I did, I ran into an issue where the [OutputCache] attribute’s behavior changed for RenderAction code.&amp;nbsp; Specifically, if you had code like this:&lt;/p&gt; &lt;div id="codeSnippetWrapper"&gt; &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;[OutputCache(CacheProfile=&lt;span style="color: #006080"&gt;"Default"&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ActionResult SponsorList()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    var context = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DataContext();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    var sponsors = context.Sponsors.GetAll().Where(s =&amp;gt; s.Type.Amount &amp;gt; 0).OrderByDescending(x =&amp;gt; x.Type.Amount).ToList(); &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.View(sponsors);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;it would stop working.&amp;nbsp; You would get an error message like this:&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/How-To-Contribute-to-ASPNET-Yourself_DE1A/image_3.png" width="644" height="468"&gt;&lt;/p&gt;
&lt;p&gt;Now, this error will make no sense to you if, like me, it used to work just fine in MVC 2, and you check your configuration file to ensure that you have, in fact, set the duration to a non-zero value:&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/How-To-Contribute-to-ASPNET-Yourself_DE1A/image_6.png" width="621" height="122"&gt;&lt;/p&gt;

&lt;p&gt;Doing a bit of searching will turn up others who have encountered the issue, such as this Stackoverflow post: &lt;br&gt;&lt;a title="http://stackoverflow.com/questions/4728958/caching-childactions-using-cache-profiles-wont-work" href="http://stackoverflow.com/questions/4728958/caching-childactions-using-cache-profiles-wont-work"&gt;http://stackoverflow.com/questions/4728958/caching-childactions-using-cache-profiles-wont-work&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The bug in question here is that the error message is wrong.&amp;nbsp; It should be this one:&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/How-To-Contribute-to-ASPNET-Yourself_DE1A/image_9.png" width="644" height="304"&gt;&lt;/p&gt;
&lt;p&gt;The reason this doesn’t fire is that &lt;a href="http://aspnetwebstack.codeplex.com/SourceControl/changeset/view/971b17d51e5f#src/System.Web.Mvc/OutputCacheAttribute.cs"&gt;the code that checks for this performs the checks in the wrong order&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/How-To-Contribute-to-ASPNET-Yourself_DE1A/image_12.png" width="644" height="370"&gt;&lt;/p&gt;

&lt;p&gt;&lt;img style="margin: 5px 0px 5px 5px; display: inline; float: right" align="right" src="http://image.spreadshirt.com/image-server/v1/compositions/17551772/views/1,width=280,height=280,appearanceId=2.png/pull-request-or-stfu-black_design.png"&gt;So now, we’ve discovered the issue.&amp;nbsp; We’ve fixed our code (replace CacheProfile usage with this: [OutputCache(VaryByParam = "*", Duration = 10)]).&amp;nbsp; Now how can we make this fix available for others?&amp;nbsp; Well, it turns out that the ASP.NET team accepts pull requests.&amp;nbsp; What that means, if you’re not familiar, is that you can contribute back to the project.&amp;nbsp; The instructions for doing so are quite good – I just performed these steps today for the first time myself.&lt;/p&gt;
&lt;p&gt;First, visit the &lt;a href="http://aspnetwebstack.codeplex.com"&gt;ASPNETWebStack project on Codeplex&lt;/a&gt;.&amp;nbsp; This is where all of the latest ASP.NET goodness is hosted.&amp;nbsp; The source control is available in using git, and it’s pretty simple to grab the latest once you have Git installed (I recommend &lt;a href="http://windows.github.com/"&gt;Git for Windows&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Next, if you’re looking for information on a particular feature request, issue, or bug, search for it in the &lt;a href="http://aspnetwebstack.codeplex.com/workitem/list/basic"&gt;Issue Tracker&lt;/a&gt;.&amp;nbsp; In my case, the bug didn’t appear to exist previously, so I created &lt;a href="http://aspnetwebstack.codeplex.com/workitem/856"&gt;a new issue describing the issue with the OutputCacheAttribute&lt;/a&gt;. ( Since I actually did the fix before I created the bug, I referenced the pull request in the bug, but you don’t need to do that).&lt;/p&gt;
&lt;p&gt;Now, assuming you are interested in and able to fix the bug, the next step is to create your own fork.&amp;nbsp; You can do this from the &lt;a href="http://aspnetwebstack.codeplex.com/SourceControl/changeset/view/971b17d51e5f"&gt;Source Code tab&lt;/a&gt;.&amp;nbsp; Click on the Fork link:&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/How-To-Contribute-to-ASPNET-Yourself_DE1A/image_15.png" width="644" height="431"&gt;&lt;/p&gt;
&lt;p&gt;Give the fork a name, and then clone it to your local machine.&amp;nbsp; You can drag the folder with the resulting forked code into GitHub for Windows to start using GitHub for Windows to manage your commits, etc.&amp;nbsp; Once you have the code, open it with Visual Studio.&amp;nbsp; To run the tests, you will need to install &lt;a href="http://aka.ms/skipsn"&gt;SkipStrongNames&lt;/a&gt; and run it with –e (at an elevated/administrator prompt):&lt;/p&gt;
&lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/How-To-Contribute-to-ASPNET-Yourself_DE1A/SNAGHTML79e438_2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="SNAGHTML79e438" border="0" alt="SNAGHTML79e438" src="http://ardalis.com/Media/Default/Windows-Live-Writer/How-To-Contribute-to-ASPNET-Yourself_DE1A/SNAGHTML79e438_thumb_1.png" width="385" height="484"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you don’t do this, you won’t be able to run the unit tests.&amp;nbsp; Speaking of which, you’ll probably also need to install the Moq and Xunit packages via Package Manager Console, at least for System.Web.Mvc.Test:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/How-To-Contribute-to-ASPNET-Yourself_DE1A/image_17.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/How-To-Contribute-to-ASPNET-Yourself_DE1A/image_thumb_5.png" width="644" height="248"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Once you have all of that, you should be able to successfully run tests (I’m using &lt;a href="http://www.telerik.com/products/justcode.aspx"&gt;JustCode’s test runner&lt;/a&gt;, which supports xunit along with the other usual testing frameworks):&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/How-To-Contribute-to-ASPNET-Yourself_DE1A/image_20.png" width="616" height="484"&gt;&lt;/p&gt;
&lt;p&gt;Once you have the bug fixed in your local build (with tests that prove it works – that’s how professional write code, you know), commit it (again, using git via command prompt or GitHub for windows) and then push/sync your changes back to your fork on CodePlex:&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/How-To-Contribute-to-ASPNET-Yourself_DE1A/image_25.png" width="644" height="357"&gt;&lt;/p&gt;

&lt;p&gt;Click on Send Pull Request to submit your pull request to the team, and you’re done!&amp;nbsp; Well, almost.&amp;nbsp; Be sure to review everything on the &lt;a href="http://aspnetwebstack.codeplex.com/wikipage?title=Contributing"&gt;Contributing section of the wiki&lt;/a&gt;, including this bit:&lt;/p&gt;
&lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/How-To-Contribute-to-ASPNET-Yourself_DE1A/image_26.png" width="392" height="41"&gt;&lt;/p&gt;
&lt;p&gt;You’ll need to send in this license agreement, but once that’s done, you’ll be free to contribute your own pull requests to the aspnetwebstack on CodePlex.&amp;nbsp; Thanks a bunch to Eilon Lipton for his assistance with this issue!&amp;nbsp; This was actually my first pull request, believe it or not (though I’d submitted SVN patches to other projects in the past), and the process was overall pretty painless.&amp;nbsp; Hopefully this will help others feel more confident about submitting fixes themselves, perhaps in addition to just answering questions about the bug on Stackoverflow…&lt;/p&gt;</description><pubDate>Tue, 19 Feb 2013 00:21:39 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/how-to-contribute-to-aspnet-yourself</guid></item><item><title>Presenting at Telerik Software Pros Conference in New Delhi India</title><link>http://ardalis.com:80/presenting-at-telerik-software-pros-conference-in-new-delhi-india</link><description>&lt;p&gt;Today I gave two sessions at the Telerik Software Professionals Conference in New Delhi, India.&amp;nbsp; The event is still ongoing (Chris Sells is wrapping up a great talk on building Windows 8 apps with HTML5 and JavaScript), but I wanted to get my talks posted here for attendees to download and review.&amp;nbsp; I’ve loaded them on Slideshare, so you should be able to view them here, or navigate to Slideshare to get the slides themselves.&lt;/p&gt;&lt;iframe height="400" marginheight="0" src="http://www.slideshare.net/slideshow/embed_code/15960433" frameborder="0" width="476" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt; &lt;iframe src="http://www.slideshare.net/slideshow/embed_code/15960487" width="427" height="356" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen&gt; &lt;/iframe&gt;</description><pubDate>Sat, 12 Jan 2013 11:33:53 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/presenting-at-telerik-software-pros-conference-in-new-delhi-india</guid></item><item><title>Presenting in New Delhi, India</title><link>http://ardalis.com:80/presenting-in-new-delhi-india</link><description>&lt;p&gt;This Saturday (12 January 2013), I’ll be presenting at the &lt;a href="http://www.telerikindia.com/telerik-developers-conference?utm_campaign=tdc2013&amp;amp;utm_medium=social&amp;amp;utm_source=televg"&gt;Telerik Developers’ Conference&lt;/a&gt; in New Delhi, India.&amp;nbsp; The event kicks off at 9am – here’s the current plan for the agenda:&lt;/p&gt; &lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/93c2bec53495_8929/image_3.png" width="463" height="484"&gt;&lt;/p&gt; &lt;p&gt;I’m giving two presentations in the afternoon.&amp;nbsp; The abstracts are as follows:&lt;/p&gt; &lt;h2&gt;Refactoring Applications using SOLID Principles&lt;/h2&gt; &lt;p&gt;We’ve all heard about well-designed software projects, where things aren’t (yet) a big ball of mud that’s painful to work with, but many of us aren’t lucky enough to work on these.&amp;nbsp; Nor is it an option for us to get to start a brand new “greenfield” project, where we can leave behind the legacy of spaghetti code and technical debt our current project might have.  &lt;p&gt;But there is hope! By applying refactoring steps based on SOLID principles of object oriented design, we can reduce the technical debt of our existing application, improve our code quality, and hopefully make our application more enjoyable and productive to work with.  &lt;p&gt;In this session, we’ll briefly introduce the SOLID principles and several design patterns, and then we’ll apply these principles and patterns by improving the design of an existing application through several refactoring steps. &lt;h2&gt;Common ASP.NET Design Patterns&lt;/h2&gt; &lt;p&gt;Design Patterns provide common templates for solving the same family of problems in a similar way. They also provide a higher-level language for software developers to use to describe approaches they might choose when designing a component of an application. In this session, you'll learn about several of the most common, and useful, design patterns used by ASP.NET developers today. &lt;p&gt;&amp;nbsp; &lt;p&gt;If you’re in the area, &lt;a href="http://www.telerikindia.com/telerik-developers-conference?utm_campaign=tdc2013&amp;amp;utm_medium=social&amp;amp;utm_source=televg"&gt;please register for the event&lt;/a&gt;, and I hope to see you there.&amp;nbsp; This will be my first trip to India, and I’m excited and looking forward to it!&lt;/p&gt;</description><pubDate>Tue, 08 Jan 2013 16:51:51 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/presenting-in-new-delhi-india</guid></item><item><title>IntelliCommand and JustCode</title><link>http://ardalis.com:80/intellicommand-and-justcode</link><description>&lt;p&gt;I’ve been using JustCode regularly, lately, but I’m still learning some of the keyboard shortcuts and features (and probably always will be).&amp;nbsp; JustCode features a nice view showing all of the common commands that you can access at any time (from the menu, or via ctrl+shift+alt+/):&lt;/p&gt; &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/IntelliCommand-and-JustCode_8343/image_3.png" width="644" height="328"&gt;&lt;/p&gt; &lt;p&gt;And of course, you can also change these, or even jump to another common set of shortcuts, in the JustCode options:&lt;/p&gt; &lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/IntelliCommand-and-JustCode_8343/image_6.png" width="598" height="175"&gt;&lt;/p&gt; &lt;p&gt;Now, these are all nice features, but something new I learned about recently is a separate Visual Studio extension you can download from the Visual Studio extensions gallery:&lt;/p&gt; &lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/IntelliCommand-and-JustCode_8343/image_11.png" width="234" height="244"&gt;&lt;/p&gt; &lt;p&gt;The extension is called &lt;a href="http://visualstudiogallery.msdn.microsoft.com/83f59659-abc1-4bfa-9779-42f687af0481"&gt;IntelliCommand&lt;/a&gt;, which you’ll find if you search Online within Visual Studio:&lt;/p&gt; &lt;p&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="SNAGHTML13fcecdc" border="0" alt="SNAGHTML13fcecdc" src="http://ardalis.com/Media/Default/Windows-Live-Writer/IntelliCommand-and-JustCode_8343/SNAGHTML13fcecdc_1.png" width="644" height="446"&gt;&lt;/p&gt;  &lt;p&gt;The extension is available for both VS2010 and 2012.&amp;nbsp; I first learned about it from &lt;a href="http://outcoldman.com/en/blog/show/326"&gt;Denis Gladkikh’s blog post&lt;/a&gt;.&amp;nbsp; When you combine IntelliCommand with JustCode, it can help you to discover and remember commands you’ve not used before (or for some time).&amp;nbsp; For instance, since many of the shortcuts start with Ctrl, you can see the available commands as you press and hold Ctrl, Ctrl+Shift, and Ctrl+Shift+Alt, below:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Ctrl&lt;br&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/IntelliCommand-and-JustCode_8343/image_14.png" width="644" height="331"&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Ctrl+Shift&lt;br&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/IntelliCommand-and-JustCode_8343/image_17.png" width="644" height="273"&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Ctrl+Shift+Alt&lt;br&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/IntelliCommand-and-JustCode_8343/image_19.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/IntelliCommand-and-JustCode_8343/image_thumb_6.png" width="504" height="161"&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Obviously, you can use Intelli Command to learn about all of the keyboard shortcuts you currently have set up within Visual Studio, not just JustCode.&amp;nbsp; If you’re trying to determine an available combination to map to a new command, this is probably a much easier way to visualize what you currently have mapped than using the standard Visual Studio keyboard shortcut editor (which really, really needs a UI refresh).&amp;nbsp; If you’re interested in &lt;a href="http://www.telerik.com/products/justcode.aspx"&gt;playing with JustCode some more, you can download a free trial here&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Tue, 08 Jan 2013 14:43:33 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/intellicommand-and-justcode</guid></item><item><title>Working with Ivy Bridge Ultrabook Sensors</title><link>http://ardalis.com:80/working-with-ivy-bridge-ultrabook-sensors</link><description>&lt;p&gt;I’ve had Intel’s preview Ivy Bridge Ultrabook for a little over two months now.&amp;nbsp; It’s a preview device with a few pre-production quirks, but it’s also a powerful developer machine in a small, lightweight package, complete with a very responsive touch screen that works great with Windows 8.&amp;nbsp; You can read &lt;a href="http://ardalis.com/unboxing-and-first-impressions-of-new-intel-ultrabook"&gt;my first impressions of the device&lt;/a&gt;, as well as my &lt;a href="http://ardalis.com/the-ivy-bridge-ultrabook-continued"&gt;first follow-up review&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: right; padding-top: 0px; padding-left: 0px; margin: 5px 0px 5px 5px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" align="right" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Working-with-Ivy-Bridge-Ultrabook-Sensor_137C9/image_3.png" width="188" height="482"&gt;In this last write-up, I wanted to go a little bit deeper into the sensors that come with the device.&amp;nbsp; As programmers, we can easily incorporate these sensors into our applications, especially Windows 8 apps.&amp;nbsp; I’ve already described the variety of sensors the device supports.&amp;nbsp; To get started with coding against these sensors, first, make sure you have the latest drivers for your machine.&amp;nbsp; Especially right now, a lot of these devices are brand new and updates are happening frequently.&amp;nbsp; Next, I recommend you grab the &lt;a href="http://code.msdn.microsoft.com/windowsapps/Windows-8-Modern-Style-App-Samples/view/SamplePack#content"&gt;Windows 8 App Samples kit&lt;/a&gt;, which includes &lt;strong&gt;&lt;em&gt;&lt;font size="4"&gt;145&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt; different samples (not all relating to sensors, but still, that should keep you busy for a while).&lt;/p&gt; &lt;p&gt;Let’s take a look at a couple of these samples, and the code they provide.&amp;nbsp; First, let’s take a look at the Accelerometer sensor sample code, which is pretty typical for all of the other sensors.&amp;nbsp; First, we need to get an instance of the sensor, which we do by calling the GetDefault() method:&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Working-with-Ivy-Bridge-Ultrabook-Sensor_137C9/image_5.png" width="642" height="263"&gt;&lt;/p&gt; &lt;p&gt;Next ,we can pull individual readings from the sensor, like so:&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Working-with-Ivy-Bridge-Ultrabook-Sensor_137C9/image_8.png" width="642" height="169"&gt;&lt;/p&gt; &lt;p&gt;When run, the live sample looks like this (here I’ve tipped the laptop up on its left side):&lt;/p&gt; &lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/Working-with-Ivy-Bridge-Ultrabook-Sensor_137C9/Screenshot%20(4)_2.png"&gt;&lt;img title="Screenshot (4)" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Screenshot (4)" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Working-with-Ivy-Bridge-Ultrabook-Sensor_137C9/Screenshot%20(4)_thumb.png" width="642" height="362"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;You can see the X axis reading is showing almost –1, because of how I’ve tilted the laptop.&amp;nbsp; When it’s at rest on a horizontal surface, the readings for X and Y are nearly zero, while the Z axis is –1.&amp;nbsp; Essentially, when no external force apart from gravity is pulling on the device, gravity is what you’re detecting.&amp;nbsp; When it’s resting flat, you can think of the X axis as starting at your caps lock key and proceeding toward your enter key, while Y is starting at the touchpad and proceeding toward your screen.&amp;nbsp; Z is passing vertically through your keyboard.&amp;nbsp; So, if you hold the laptop upside down, Z flips to positive 1.&amp;nbsp; It would be interesting to see the readings this thing would have in a fighter jet…&lt;/p&gt; &lt;p&gt;As a bit of trivia for you physics buffs, what would the readings be if I tossed the laptop into the air, while it’s rising, while it’s at its peak, and while it’s falling, assuming it stays perfectly flat so we’re only concerned with the Z axis?&lt;/p&gt; &lt;p&gt;Related to the accelerometer is the inclinometer sensor, which you can read similarly (so similarly I’m not going to waste time showing you screenshots of the code).&amp;nbsp; The main difference is that the resulting readings are Pitch, Roll, and Yaw.&amp;nbsp; For these, you can pretend your laptop keyboard is an airplane, with its tail at the touchpad and nose by the screen.&amp;nbsp; Lifting the tail results in negative pitch.&amp;nbsp; Lifting either side results in a Roll change.&amp;nbsp;&amp;nbsp; Yaw is where things differ from the accelerometer, as this refers to rotation along the Z axis.&amp;nbsp; That is, if you leave your laptop flat on the table, but turn it, that’s changing Yaw (&lt;a href="http://en.wikipedia.org/wiki/Flight_dynamics"&gt;read more on flight dynamics terms&lt;/a&gt;).&lt;/p&gt; &lt;p&gt;Here’s the app running with me picking up the right side of the laptop.&lt;/p&gt; &lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/Working-with-Ivy-Bridge-Ultrabook-Sensor_137C9/Screenshot%20(2)_2.png"&gt;&lt;img title="Screenshot (2)" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Screenshot (2)" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Working-with-Ivy-Bridge-Ultrabook-Sensor_137C9/Screenshot%20(2)_thumb.png" width="642" height="362"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You can see how you could build games to take advantage of these sensors, especially in a tablet form factor.&lt;/p&gt; &lt;p&gt;There’s also a compass, which you access like the other sensors shown.&amp;nbsp; Its event handler looks like this:&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Working-with-Ivy-Bridge-Ultrabook-Sensor_137C9/image_11.png" width="642" height="233"&gt;&lt;/p&gt; &lt;p&gt;On this laptop, the “needle” of the compass seems to point out the right side of the keyboard, as that’s what I had to point north in order to get a 0 degree reading.&amp;nbsp; When used in a tablet form factor, that probably makes the most sense (for it to come out of the top of the tablet).&lt;/p&gt; &lt;p&gt;The gyrometer provides similar readings of X, Y, and Z axis values based on angular velocity.&amp;nbsp; At rest, these all read zero, but if you move the device, they’ll show you the instantaneous effects.&amp;nbsp; The API is identical to the accelerometer and inclinometer APIs.&lt;/p&gt; &lt;p&gt;Working with the GeoLocator (GPS reader) is slightly different.&amp;nbsp; You can simply instantiate one of these classes to start working with it.&amp;nbsp; The code to pull the location data from the GeoLocator instance looks like this:&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Working-with-Ivy-Bridge-Ultrabook-Sensor_137C9/image_14.png" width="642" height="174"&gt;&lt;/p&gt; &lt;p&gt;Finally, the LightSensor lets you detect ambient light.&amp;nbsp; You access the sensor just as with most of the other sensors (like the accelerometer), and its event handler yields a single LUX value:&lt;/p&gt; &lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/Working-with-Ivy-Bridge-Ultrabook-Sensor_137C9/image_16.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Working-with-Ivy-Bridge-Ultrabook-Sensor_137C9/image_thumb_4.png" width="642" height="138"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You can use this sample to locate the light sensor on your device, if you don’t know where it is (on this laptop, it’s by the integrated webcam at the top of the screen).&amp;nbsp; If you cover the sensor, the reading drops to 0.&amp;nbsp; The brightest I could get it to read from some indoor lighting (at night) was just over 20,000, but that was held right up to a light bulb.&amp;nbsp; A “normal” reading as I use the laptop seems to be around 15-20, depending on whether there is direct light on the sensor.&lt;/p&gt; &lt;h3&gt;Summary&lt;/h3&gt; &lt;p&gt;As you can see, there’s a lot you can do with the sensors that ship in this device, and I’m sure other devices designed for use with Windows 8 will have many of these sensors as well.&amp;nbsp; The code for detecting whether a sensor is present and available is of course included in these samples as well, since obviously not every device will support every sensor.&amp;nbsp; You can read more on this topic from other bloggers like &lt;a href="http://www.johnpapa.net/win8sensors/"&gt;John Papa&lt;/a&gt; and &lt;a href="http://www.hanselman.com/blog/IntelUltrabookHardwarePrototypeWindows8AndTheSensorPlatform.aspx"&gt;Scott Hanselman&lt;/a&gt;.&amp;nbsp; I hope you found this interesting, and if you have an ultrabook you recommend, please share it in the comments (I’m looking at the Lenovo Yoga, for instance, but I haven’t bought one yet).&amp;nbsp; And feel free to debate the physics question I proposed, too.&lt;/p&gt;</description><pubDate>Wed, 05 Dec 2012 04:18:47 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/working-with-ivy-bridge-ultrabook-sensors</guid></item><item><title>Don&amp;rsquo;t Forget Block Selection Using Alt in Visual Studio</title><link>http://ardalis.com:80/don-rsquo-t-forget-block-selection-using-alt-in-visual-studio</link><description>&lt;p&gt;So do you ever find yourself wanting to try out some code you found on the Internet (via &lt;a href="http://deviq.com/copy-paste-programming"&gt;Copy Past Programming&lt;/a&gt;, but in a spike or test project, naturally!), and unfortunately when you copy the code it&amp;nbsp; includes a bunch of line numbers?&amp;nbsp; Like the code from this sample on &lt;a href="http://www.andrewconnell.com/blog/archive/2012/05/02/isolating-integration-tests-with-ef4-x-code-first-amp-mstest.aspx"&gt;testing Entity Framework stuff&lt;/a&gt;?&lt;/p&gt;&lt;pre&gt;  1: [TestClass]
  2: public class TestRunDatabaseCreator {
  3:&amp;nbsp; 4:   public const string DATABASE_NAME_TEMPLATE = "CPT_CDS_{0}";
  5:&amp;nbsp; &lt;/pre&gt;
&lt;p&gt;Of course, &lt;a href="http://www.hanselman.com/blog/HowToPostCodeToYourBlogAndOtherReligiousArguments.aspx"&gt;some code highlighting tools make this a little easier for you, and Scott Hanselman shows off some options.&lt;/a&gt;&amp;nbsp; But in this case, the post was made some time ago, so I don’t think we can rely on the author to change how they’ve chosen to post the code itself.&amp;nbsp; There’s always the manual option, which I know I’ve done plenty of times.&amp;nbsp; That is, type del del del del del downarrow, del del del del del downarrow, … repeat.&amp;nbsp; That gets old fast – there should be a better way.&lt;/p&gt;
&lt;p&gt;Fortunately, there is, and it’s been around for a long time.&amp;nbsp; I was just reminded of it today, and thought I’d share for those of you who don’t know about it.&amp;nbsp; Just use the block selection option in Visual Studio, which you get by holding down Alt while selecting with the mouse.&amp;nbsp; Take some code like this:&lt;/p&gt;
&lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Dont-Forget-Block-Selection-Using-Alt-in_B5E2/image_3.png" width="626" height="484"&gt;&lt;/p&gt;
&lt;p&gt;Highlight with the mouse while holding alt:&lt;/p&gt;
&lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Dont-Forget-Block-Selection-Using-Alt-in_B5E2/image_6.png" width="415" height="484"&gt;&lt;/p&gt;


&lt;p&gt;And hit delete.&amp;nbsp; Problem solved.&lt;/p&gt;
&lt;p&gt;Share this if it helped you, and happy coding!&lt;/p&gt;</description><pubDate>Sun, 18 Nov 2012 18:04:57 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/don-rsquo-t-forget-block-selection-using-alt-in-visual-studio</guid></item><item><title>2013 Software Craftsmanship Calendar</title><link>http://ardalis.com:80/2013-software-craftsmanship-calendar</link><description>&lt;p&gt;It’s that time of year again when Software Craftsmanship wall calendars are shipping out of our Hudson office.&amp;nbsp; A few things are different this year.&amp;nbsp; The small &lt;a href="http://nimblepros.com/"&gt;NimblePros&lt;/a&gt; logo on the calendars has been replaced with a small &lt;a href="http://telerik.com/"&gt;Telerik&lt;/a&gt; logo.&amp;nbsp; The boxes of calendars from the printer now come with 60 calendars per box, instead of 55.&amp;nbsp; And the calendars themselves have an extra page in them (you’ll have to get one to see how we put it to use).&amp;nbsp; We’ve also continued to be blown away by the popularity of the calendar, and we love that the community has supported this idea (which we’ve spent a great many hours obsessing over each year).&amp;nbsp; Two years ago, for the first calendar (the 2011 calendar), we ordered 1500 calendars.&amp;nbsp; Last year, in response to demand, we increased the order to 3000.&amp;nbsp; This year, we’ve gone even further, and have printed 5000 calendars.&amp;nbsp; That’s just over 83 boxes, at 38 pounds per box, which is over 1.5 tons of software craftsmanship awesomeness.&lt;/p&gt; &lt;p&gt;If this is all new to you, you can check out some of &lt;a href="http://bit.ly/Uv8oRS"&gt;our past calendar images&lt;/a&gt;.&amp;nbsp; If you have ideas for motivational images and themes we can use in future calendars, please leave a comment – we’re always looking for (and happy to credit) new ideas!&lt;/p&gt; &lt;p&gt;&lt;a href="http://deviq.com/separation-of-concerns"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 0px 5px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="Separation-of-Concerns-Feb-2013" border="0" alt="Separation-of-Concerns-Feb-2013" align="right" src="http://ardalis.com/Media/Default/Windows-Live-Writer/2013-Software-Craftsmanship-Calendar_B9E9/Separation-of-Concerns-Feb-2013_3.png" width="244" height="244"&gt;&lt;/a&gt;I think my favorite topic in the 2013 Software Craftsmanship calendar is &lt;a href="http://deviq.com/separation-of-concerns"&gt;Separation of Concerns&lt;/a&gt;.&amp;nbsp; Separation of concerns is, of course, an extremely important principle in quality software development.&amp;nbsp; It’s also one that is violated with alarming regularity.&amp;nbsp; Whether there’s data access code inside of a click event handler, or any other low level plumbing logic embedded in code that is otherwise concerned with higher level concepts, this is something we should try to minimize in our software.&amp;nbsp; We spent a lot of time thinking about how to best visualize this (we’ve tried to avoid just showing some random code snippet as the image wherever possible – who wants to look at that all month?).&amp;nbsp; What we came up with is shown here (we’d just gotten a new, larger refrigerator at the office).&lt;/p&gt; &lt;p&gt;Everybody knows that you keep your cleaning supplies and your food separated in your kitchen, so this seems like an image that really works.&amp;nbsp; It’s also visually interesting enough that even a non-developer walking by might do a double-take when they see what’s on the shelves in this refrigerator.&amp;nbsp; What do you think, does this do a reasonable job of demonstrating a violation of separation of concerns, using a non-code metaphor?&amp;nbsp; And yes, all of the cleaning tools were new, not used, when they were used as props for this shot.&lt;/p&gt; &lt;p&gt;You can order your 2013 Software Craftsmanship calendar now at &lt;a href="http://gear.telerik.com"&gt;http://gear.telerik.com&lt;/a&gt;.&amp;nbsp; Thanks to all of you who have supported this idea the last two years!&amp;nbsp; We really appreciate your support and hope you’ll continue to share this with your friends and let us know how we can continue to improve the calendar.&lt;/p&gt;</description><pubDate>Fri, 16 Nov 2012 18:45:12 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/2013-software-craftsmanship-calendar</guid></item><item><title>JavaScript The Good Parts Reviewed</title><link>http://ardalis.com:80/javascript-the-good-parts-reviewed</link><description>&lt;p&gt;&lt;a href="http://bitly.com/VJr2eG"&gt;&lt;img style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: right; padding-top: 0px; padding-left: 0px; margin: 0px 0px 5px 5px; border-left: 0px; display: inline; padding-right: 0px" border="0" align="right" src="http://akamaicovers.oreilly.com/images/9780596517748/cat.gif"&gt;&lt;/a&gt;Finished up Douglas Crockford’s &lt;a href="http://bitly.com/VJr2eG"&gt;JavaScript: The Good Parts&lt;/a&gt; this week.&amp;nbsp; It definitely helped me improve my understanding of JavaScript, which I’ve been using since it was new, but always like a C programmer, and only recently like a JavaScript programmer.&amp;nbsp; I really appreciated Crockford’s honest, no-holds-barred analysis of JavaScript’s design and language choices.&amp;nbsp; It had me chuckling more than once.&amp;nbsp; I also appreciated that the book, at only 150 pages including the index, is devoid of fluff.&amp;nbsp; There’s just enough repetition between chapters to ensure certain points are made and made well.&lt;/p&gt; &lt;p&gt;The book makes frequent use of &lt;a href="http://en.wikipedia.org/wiki/Syntax_diagram"&gt;railroad diagrams&lt;/a&gt;, which I’ve seen before but not nearly so widely used as in this book.&amp;nbsp; I found these sometimes helpful, but I’ll admit that I skipped the full 10 page appendix full of them when I’d reached the end of the book.&amp;nbsp; I’m not sure they did a great deal to improve my grasp of JavaScript, but I appreciated the attention to detail, and I know I can refer to them if I’m stuck wondering why a particular bit of JavaScript isn’t behaving the way I would expect (which is probably the way it would in, say, C#).&lt;/p&gt; &lt;p&gt;The book isn’t that old (published in May, 2008), but it does predate some of the newer JavaScript testing tools available online.&amp;nbsp; For instance, Chapter 1 suggests that the reader can easily run JavaScript programs by creating a simple HTML file, and a program.js file, and then opening the HTML file in a browser.&amp;nbsp; This of course still works, and it’s important to let people know this option is available, but I think if the book were re-released today, it would be improved if it pointed the user at a tool like &lt;a href="http://jsfiddle.net/"&gt;JSFiddle&lt;/a&gt;, where one can work interactively without the need to deal with files.&amp;nbsp; For example, here’s &lt;a href="http://jsfiddle.net/wHxhK/"&gt;Hello World implemented on JSFiddle&lt;/a&gt; (probably for the millionth time).&amp;nbsp; It’s worth noting that JSFiddle also supports JSLint, which I believe Crockford wrote, and which is covered in the book as well.&lt;/p&gt; &lt;p&gt;I made a few notes as I read the book.&amp;nbsp; I particularly liked on page 3, where Crockford writes, “If you want to learn more about the bad parts and how to use them badly, consult any other JavaScript book.”&amp;nbsp; I think I may have discovered a bug in the p. 6 railroad diagram, which appears to include an unnecessary ‘/’ following the opening ‘/*’ of a comment.&amp;nbsp; I don’t see it listed in the book’s &lt;a href="http://oreilly.com/catalog/errata.csp?isbn=9780596517748"&gt;errata&lt;/a&gt;, but since the only place go from the ‘/’ is into an ‘any character except * and /’ block it seems the diagram would work equally well without the ‘/’.&amp;nbsp; I may be missing a nuance of the syntax, though.&lt;/p&gt; &lt;p&gt;Chapter 4 covers Functions, and includes some interesting bits on function currying (which was new to me) and memoization, with examples of how to use this in your JavaScript code.&amp;nbsp; Chapter 9 discusses Style, and notes, “Surprisingly, perhaps, we should also avoid features that are often useful but occasionally hazardous.&amp;nbsp; Such features are attractive nuisances, and by avoiding them, a large class of potential errors is avoided.”&amp;nbsp; Page 95 goes on to say, “And even if style doesn’t matter, isn’t one style as good as any other?” which I believe is another typo not listed in the errata (doesn’t should be does).&amp;nbsp; The points are well made, however, especially “It turns out that style matters in programming for the same reason that it matters in writing.&amp;nbsp; It makes for better reading.”&lt;/p&gt; &lt;p&gt;One of JavaScript’s bad parts requires that one use the K&amp;amp;R style of curly bracing in order to avoid bugs with return statements.&amp;nbsp; This is noted in the Style chapter, and covered in detail in my favorite part of the book: Appendix A: Awful Parts.&amp;nbsp; Semicolon insertion is one such awful part, and is responsible for the aforementioned return statement bug.&amp;nbsp; If you write&lt;/p&gt; &lt;p&gt;return&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; status: true&lt;br&gt;};&lt;/p&gt; &lt;p&gt;instead of&lt;br&gt;return {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; status: true&lt;br&gt;};&lt;/p&gt; &lt;p&gt;The first version will return undefined, while the latter returns a new object with a status of true.&amp;nbsp; I also thought it was interesting that you can actually redefine the global variables for undefined and NaN, as they are not, in fact, constants or reserved words.&amp;nbsp; Crockford writes “That should not be possible, and yet it is.&amp;nbsp; Don’t do it.” :)&lt;/p&gt; &lt;p&gt;There are many reasons why == is a Bad Part, explained in Appendix B: Bad Parts (along with a number of other Bad Parts).&amp;nbsp; Despite the book’s name, I appreciate these appendices showing me which parts aren’t so good, and why.&amp;nbsp; Finally, Appendix E is devoted to JSON, and includes a fully functional parse utility that avoids the need to use the (not so secure) eval() method.&lt;/p&gt; &lt;p&gt;Overall, very good book.&amp;nbsp; I appear to have a later printing [2011-04-08] that includes some of the errata from the book’s web site.&amp;nbsp; My JavaScript-fu still isn’t as good as my C#, but I have a much better appreciation for JavaScript now, and a much better understanding of how to use it properly.&amp;nbsp; I’d definitely recommend this book if you’re a JavaScript programmer, or a C# programmer looking to get better at JavaScript.&lt;/p&gt;</description><pubDate>Mon, 12 Nov 2012 16:13:01 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/javascript-the-good-parts-reviewed</guid></item><item><title>Limit SQL Server Memory Use on Dev Machine</title><link>http://ardalis.com:80/limit-sql-server-memory-use-on-dev-machine</link><description>&lt;p&gt;If you’re a developer running SQL Server locally, you may sometimes need to limit how much memory the database is consuming.&amp;nbsp; Under normal conditions, SQL Server likes to use as much memory as it can get, since keeping results in memory improves the database’s performance.&amp;nbsp; In typical production scenarios, this is the ideal behavior, but on a dev machine you probably want your RAM for other things.&amp;nbsp; In my case, I noticed my RAM was creeping up to over 9.5 GB and saw this:&lt;/p&gt; &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SNAGHTML7145c85f" border="0" alt="SNAGHTML7145c85f" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Limit-SQL-Server-Memory-Use-on-Dev-Machi_E785/SNAGHTML7145c85f_1.png" width="669" height="821"&gt;&lt;/p&gt; &lt;p&gt;First of all, it’s somewhat telling that on my dev machine here, I’m not even running my dev environment, and my browser windows are collectively using more RAM than anything else (and what’s up with SnagitEditor.exe? It’s not even active at the moment).&amp;nbsp; Clearly I need to spend more time working in Visual Studio and less time working in Outlook.&amp;nbsp; But leaving that aside, and ignoring the fact that I still have loads of RAM free since this machine has 12GB, I’d still like to reduce the memory SQL Server is using since I’m not using that at all and if I don’t do something about it, it will just keep getting bigger until I restart.&lt;/p&gt; &lt;p&gt;Fortunately, it’s rather simple to fix.&amp;nbsp; Just open SQL Server Management Studio, connect to your server (localhost in this case), and right click on the server in the server explorer.&amp;nbsp; Choose Properties.&amp;nbsp; Then choose the Memory section, shown here:&lt;/p&gt; &lt;p&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SNAGHTML714a0a95" border="0" alt="SNAGHTML714a0a95" src="http://ardalis.com/Media/Default/Windows-Live-Writer/Limit-SQL-Server-Memory-Use-on-Dev-Machi_E785/SNAGHTML714a0a95_1.png" width="539" height="484"&gt;&lt;/p&gt; &lt;p&gt;Change that big number (2,147,483,647 MB ~= 2 Petabytes) to something more reasonable.&amp;nbsp; In my case, I’m already using about 577MB, but 100 MB is probably more than enough for my dev needs.&lt;/p&gt; &lt;p&gt;If this doesn’t work for you, there are some additional tips and things to try on this &lt;a href="http://stackoverflow.com/questions/856575/sql-server-2008-takes-up-a-lot-of-memory"&gt;StackOverflow question&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Wed, 07 Nov 2012 14:46:21 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/limit-sql-server-memory-use-on-dev-machine</guid></item><item><title>JustCode JustRocks</title><link>http://ardalis.com:80/justcode-justrocks</link><description>&lt;p&gt;I have been a ReSharper fanboy for a long, long time.&amp;nbsp; I have recommended it in user group and conference talks and on my blog.&amp;nbsp; It was one of my favorite tools for a long time, and it remains a great product.&amp;nbsp; However, I’m happy to say with all honesty that I now prefer JustCode.&amp;nbsp; This is fortunate, as I now work for the company that makes JustCode, but I’ve held off on endorsing it (or completely replacing ReSharper in my actual work) until I felt it really met my needs.&amp;nbsp; That day has come.&amp;nbsp; Let me share with you why I’m now a convert.&lt;/p&gt; &lt;h2&gt;Must-Have Refactorings&lt;/h2&gt; &lt;p&gt;There are a few refactorings that I use all the time because of the way I write testable, maintainable code (see my online programming course on &lt;a href="http://pluralsight.com/training/Courses/TableOfContents?courseName=principles-oo-design"&gt;SOLID Principles of Object Oriented Design&lt;/a&gt;).&amp;nbsp; For instance, I try to follow the &lt;a href="http://deviq.com/explicit-dependencies-principle"&gt;Explicit Dependencies Principle&lt;/a&gt;, which means that my classes take in the things they need via their constructors (or method parameters).&amp;nbsp; When you’re writing code like this, it’s common to create a constructor, add several parameters (usually interface types), and then assign each parameter to a private readonly field of the same type.&amp;nbsp; You end up with something like this:&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_5.png" width="354" height="156"&gt;&lt;/p&gt; &lt;h2&gt;Strategy Pattern&lt;/h2&gt; &lt;p&gt;We’re essentially talking about the &lt;a href="http://deviq.com/most-popular-patterns/strategy-design-pattern"&gt;Strategy Pattern&lt;/a&gt;, or Dependency Injection here, and doing a lot of this is very tedious.&amp;nbsp; The name of the operation in JustCode is Create and Initialize Field.&amp;nbsp; Fortunately, with JustCode, you can now just type “ctor TAB TAB” (using Visual Studio’s code snippet), add a parameter (e.g. ISendEmail mailSender), then bring up the Visual Aid Menu (I map this to Alt+Enter, which is R#’s default – JustCode uses ctrl+` by default which is nowhere near the keys I normally have my fingers on – fortunately you only need to change this once since your settings persist between computers as I’ll detail shortly), and select the first item, Create and Initialize Field ‘_mailSender’ by pressing Enter:&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_6.png" width="477" height="83"&gt;&lt;/p&gt; &lt;p&gt;The whole thing takes very few keystrokes and doesn’t require the mouse, which of course is key to frictionless coding.&amp;nbsp; Essentially for me it’s:&lt;/p&gt; &lt;p&gt;ctor TAB TAB &lt;em&gt;typename&lt;/em&gt; &lt;em&gt;variablename&lt;/em&gt; alt+Enter Enter&lt;/p&gt; &lt;p&gt;Of course if the type already exists you can tab complete it rather than typing the whole thing.&lt;/p&gt; &lt;h2&gt;Dealing with Files&lt;/h2&gt; &lt;p&gt;Frequently when you’re working test-first or in a way that minimizes dependencies, you’ll end up with a solution that involves a lot of small classes with well-defined responsibilities and interfaces.&amp;nbsp; Using the typical Visual Studio approach to creating these files and classes is tedious – it’s much nicer to simply create the interface and class definitions in whatever file happens to be open, and then move them using JustCode shortcuts.&amp;nbsp; For example, in this screenshot you can see that I’ve defined the interface in the same file as the class, so it’s underlined (because by default it’s recommended to have types in separate files).&amp;nbsp; Mousing over, you’ll see warning:&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_7.png" width="379" height="121"&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Clicking there and then hitting alt+Enter Enter will move the interface into its own file.&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_10.png" width="368" height="95"&gt;&lt;/p&gt; &lt;p&gt;Result:&lt;/p&gt; &lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_12.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_thumb_2.png" width="162" height="71"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Of course, you can also make sure filenames match your typenames.&amp;nbsp; Any time a typename doesn’t match the current filename, you’ll get a warning and a suggestion to either Move Type To Another File or Rename File To Match Type Name.&lt;/p&gt; &lt;p&gt;Clean Up&lt;/p&gt; &lt;p&gt;Of course I’m a fan of Clean Code, so being able to quickly and easily clean up code is very helpful.&amp;nbsp; I especially like to remove clutter, so unused using directives and other redundant bits of code I like to eliminate wherever possible, so they don’t obscure the intent of the actual code doing the work.&amp;nbsp; JustCode supports a bunch of options for cleaning up and formatting code, and you can save your personal preferences in a profile.&amp;nbsp; Here are some of the options available:&lt;/p&gt; &lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_14.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_thumb_3.png" width="520" height="504"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;One nice feature of JustCode is that you don’t have to do this in each file.&amp;nbsp; You can do it at the project or solution level:&lt;/p&gt; &lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_16.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_thumb_4.png" width="473" height="620"&gt;&lt;/a&gt;&lt;/p&gt; &lt;h2&gt;Navigation&lt;/h2&gt; &lt;p&gt;When you write code such that it’s loosely coupled and testable (e.g. follows SOLID principles), you tend to have a lot more types than in a tightly coupled big-ball-of-mud solution.&amp;nbsp; You also tend to have a lot more instances where your code is executing functionality through an interface, rather than through an explicit implementation.&amp;nbsp; This makes the default navigation features of Visual Studio insufficient, or at least annoying.&amp;nbsp; Very commonly as a developer you will want to find a particular type, or a particular file, or jump to the actual implementation of a method being called.&amp;nbsp; Justcode makes all of these very easy.&lt;/p&gt; &lt;p&gt;Find Type / File&lt;/p&gt; &lt;p&gt;To find a type, just use the default keyboard shortcut.&amp;nbsp; Since I’m a former R# user, I have ctrl+N and ctrl+shift+N embedded in my brain as Find Type and Find File.&amp;nbsp; If you type in capital letters, it will quickly find camel-cased types that match (e.g. “ISE” will find “&lt;strong&gt;IS&lt;/strong&gt;end&lt;strong&gt;E&lt;/strong&gt;mail” as shown).&lt;/p&gt; &lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_18.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_thumb_5.png" width="508" height="138"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You can do the same with files, searching for camel-case or for substrings:&lt;/p&gt; &lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_20.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_thumb_6.png" width="516" height="97"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This is much, much faster than hunting through Solution Explorer looking for a particular class that you think might be implementing the interface you’re using.&amp;nbsp; Speaking of which, let’s look at how we navigate through a call stack.&amp;nbsp; Using only Visual Studio, if you want to find out what the implementation of Send() does in this code, you can do so by ctrl+Clicking on it.&lt;/p&gt; &lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_22.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_thumb_7.png" width="406" height="236"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Of course, ctrl+Click will lead you here:&lt;/p&gt; &lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_24.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_thumb_8.png" width="233" height="75"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This isn’t all that helpful in most cases.&amp;nbsp; Fortunately, JustCode will easily let you Go To Implementation of the interface method (and again these are using the default R# key bindings):&lt;/p&gt; &lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_26.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_thumb_9.png" width="426" height="232"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This leads you here:&lt;/p&gt; &lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_28.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_thumb_10.png" width="349" height="127"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;which is probably where you wanted to go to see what the code is actually doing.&lt;/p&gt; &lt;h2&gt;Speed&lt;/h2&gt; &lt;p&gt;One issue I had with some of the early versions of JustCode was with its speed.&amp;nbsp; The latest version is very fast, and I no longer have any complaints.&amp;nbsp; I’m certainly not finding that I’m waiting on it, which occasionally was the case in the past.&lt;/p&gt; &lt;h2&gt;Cloud Sync&lt;/h2&gt; &lt;p&gt;Most of the features I’ve described above already exist in ReSharper – in fact that’s where I fell in love with most of them.&amp;nbsp; Now let’s look at some of the new and awesome features that JustCode has added that make it stand apart from its competitors.&amp;nbsp; Chief among these, to me, is the ability to synchronize settings in the cloud.&amp;nbsp; Those of you who know me through Microsoft MVP or ASPInsiders program may know that I have been lobbying Microsoft to provide a way to store and sync Visual Studio’s settings in the cloud since around 2003.&amp;nbsp; And here it is 2012 and there’s still no support for it.&amp;nbsp; About the best you can do is export/import your settings and sync them via DropBox or similar, which isn’t awful, but it’s enough extra friction that I’ve never fallen in love with this solution.&amp;nbsp; What I want is for VS to “just work” the way I want it to when I sign into a new machine on my domain, or when I do a new install.&amp;nbsp; JustCode now solves this problem.&lt;/p&gt; &lt;p&gt;In a previous release, JustCode provided a means to sync its own settings in the cloud, including all of the code templates and whatever preferences you had set up for formatting, cleaning, etc.&amp;nbsp; However, in the most recent release, JustCode now will sync all Visual Studio settings, which is far more useful as it includes key bindings and other environment changes (e.g. turning on line numbers in the editors).&amp;nbsp; I’m composing this article on a newly-installed Win8 machine, and I’m pleased to say I didn’t have to adjust any of my Visual Studio settings in order to get things set up how I like it.&amp;nbsp; I simply installed JustCode, provided my Telerik credentials, and it does the rest.&amp;nbsp; You can upload or download changes on-demand, as well as enabling automatic sync, as shown here:&lt;/p&gt; &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_31.png" width="626" height="484"&gt;&lt;/p&gt; &lt;p&gt;Of course, if you don’t want to sync everything, you can choose a subset.&amp;nbsp; And if you don’t trust automatic sync, you can choose to only upload/download on demand.&amp;nbsp; You can also back up a given configuration, and then restore it later, allowing you to try something out and then easily revert.&amp;nbsp; This can also be useful for presenters, who maybe use a black background and small fonts on their desktop, but want to use a white background and large fonts when presenting.&amp;nbsp; JustCode accommodates this via its Cloud Backups.&lt;/p&gt; &lt;p&gt;This has literally been something I’ve wanted for almost ten years as a Visual Studio user, and it’s already making my life much easier, as I use quite a few different machines in my work.&amp;nbsp; I was very excited to learn about, and now to use, this feature, and it works great.&amp;nbsp; For more on this, read about &lt;a href="http://blogs.telerik.com/justteam/posts/12-10-22/save-your-visual-studio-settings-in-the-cloud.aspx"&gt;how to Save Your Visual Studio Settings in the Cloud&lt;/a&gt;.&lt;/p&gt; &lt;h2&gt;Keymaps&lt;/h2&gt; &lt;p&gt;Another thing I’ve struggled with when I would try and evaluate competing tools (when I used R#) is relearning the keymaps of the various tools on the market.&amp;nbsp; It was always tedious to reset key binding in Visual Studio’s settings, and of course you would have to do this on every machine you used, or every time you reinstalled your tools.&amp;nbsp; It was a big barrier to switching, and of course this is a good thing for ReSharper (and other tools) if it provides some vendor lock-in.&amp;nbsp; But for an individual developer who wants to be able to use, or at least evaluate, other tools, it was a problem.&amp;nbsp; Fortunately, JustCode has a solution to this as well.&amp;nbsp; You can simply choose one of the default keymaps that already has all of the mappings you’re familiar with.&amp;nbsp; In my case, I went with the R#/IDEA keymap, as shown:&lt;/p&gt; &lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_33.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://ardalis.com/Media/Default/Windows-Live-Writer/57deefa92dca_F507/image_thumb_12.png" width="554" height="227"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This dialog appears as part of the Getting Started wizard when you first install JustCode, making it very easy to evaluate JustCode using the key bindings you already have committed to memory.&amp;nbsp; The JustCode team also has an article describing how they came up with the &lt;a href="http://blogs.telerik.com/justteam/posts/12-10-24/justcode-keyboard-shortcuts-profiles.aspx"&gt;JustCode Keyboard Shortcuts Profiles&lt;/a&gt; feature that you may want to check out.&lt;/p&gt; &lt;h2&gt;Summary&lt;/h2&gt; &lt;p&gt;I’ve waited a long time to be able to write this article.&amp;nbsp; When I joined Telerik earlier this year, I still wasn’t completely convinced that JustCode was really a tool I could recommend over my old friend ReSharper.&amp;nbsp; I’m very pleased, as a Telerik employee, to be able to confidently endorse it now.&amp;nbsp; If you’ve tried it before and found it lacking, I would encourage you to give it another shot.&amp;nbsp; If you’re not using any Visual Studio add-in, and you’re trying to write loosely coupled, testable code, JustCode will eliminate a ton of the friction involved in doing so.&amp;nbsp; You can &lt;a href="http://www.telerik.com/download-trial-file.aspx?pid=717"&gt;download a JustCode Trial here&lt;/a&gt;, if you’d like.&lt;/p&gt; &lt;p&gt;And since it’s almost election time here in the United States, let me end with “I’m Steve Smith, and I approve this message.”&lt;/p&gt;</description><pubDate>Mon, 29 Oct 2012 16:53:43 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/justcode-justrocks</guid></item><item><title>The Ivy Bridge Ultrabook Continued</title><link>http://ardalis.com:80/the-ivy-bridge-ultrabook-continued</link><description>&lt;p&gt;I’ve now had the new Intel Ivy Bridge Ultrabook machine for about six weeks, and have been carrying it as my primary machine for much of that time.&amp;nbsp; You can read about &lt;a href="http://ardalis.com/unboxing-and-first-impressions-of-new-intel-ultrabook"&gt;my initial impressions of the Ultrabook&lt;/a&gt; here.&amp;nbsp; The short version, for those who don’t like to click on links, is that this is a pre-release hardware clamshell Ultrabook with a touch screen and a slew of sensors that you can code against, with Windows 8 installed on it.&amp;nbsp; It was provided to me for free in order to solicit my honest opinions on the device, which I disclose to you here in accordance with the &lt;u&gt;&lt;a href="http://www.access.gpo.gov/nara/cfr/waisidx_03/16cfr255_03.html"&gt;Federal Trade Commission’s 16 CFR, Part 255: “Guides Concerning the Use of Endorsements and Testimonials in Advertising.&lt;/a&gt;&lt;/u&gt;&lt;/p&gt; &lt;h2&gt;General Use&lt;/h2&gt; &lt;p&gt;I’m an Ultrabook fan, having used “desktop replacement” laptops in the past, with their 17” screens and dual-stacked hard drives and massive power supplies and fans.&amp;nbsp; Really, though, since I’m not playing games on the machine, I don’t need a huge video card, and since most of the performance of Visual Studio and Office is dictated by RAM and HDD, having an SSD makes the performance of thin, light laptops more than adequate for my needs.&amp;nbsp; Sure, I have a big tower computer with two big monitors on my desk, but when I’m not at my desk, I’m quite content to use an Ultrabook.&lt;/p&gt; &lt;p&gt;This particular Ultrabook is quite nice.&amp;nbsp; I actually find the keyboard to be much nicer than my Asus Zen, which tends to miss characters when I’m typing quickly, and the touchpad is rather sensitive so sometimes that results in the mouse pointer jumping.&amp;nbsp; In contrast, the Intel Ultrabook is quick to type on and doesn’t frequently require me to retype due to its failings (though I still have my own mistakes to deal with, all too often).&amp;nbsp; I would prefer if it had actual home/end buttons, instead of overloads on the arrow keys, but that’s a minor quibble.&lt;/p&gt; &lt;p&gt;In terms of presenting, the lack of a VGA outlet can be a concern, especially if you’re presenting at customer or conference locations.&amp;nbsp; Even HDMI is a slight challenge because the port on the machine is a mini-HDMI, so you need an adapter or your own cable.&amp;nbsp; I picked up an &lt;a href="http://amzn.to/OOD57e"&gt;A to C Type HDMI to Mini-HDMI Cable&lt;/a&gt; for this purpose.&amp;nbsp; If you want VGA, you can pick up a &lt;a href="http://amzn.to/OODiHO"&gt;Mini HDMI to VGA M/F Active Adapter&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;I continue to find it very natural to use the touch screen, rather than the touchpad or mouse.&amp;nbsp; When reading long articles/emails, it’s often easier to simply scroll the screen with a thumb or finger, especially when no mouse is available (to use the scroll wheel).&lt;/p&gt; &lt;h2&gt;Development&lt;/h2&gt; &lt;p&gt;Visual Studio 2012 runs great on the device.&amp;nbsp; As has been mentioned, it only has 4 GB of RAM, but honestly I haven’t found that to be a problem.&amp;nbsp; I think VS2012 is, in general, faster and more lightweight than its predecessor, and so even if I’m running more than one instance of Visual Studio, I haven’t noticed any slowdown.&amp;nbsp; Now, to be fair I’m mostly running smaller solutions, not massive solutions with 100 projects in them, but if your solution has that many projects I think you have bigger problems than your machine’s memory resources can address.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.hanselman.com/blog/IntelUltrabookHardwarePrototypeWindows8AndTheSensorPlatform.aspx"&gt;Scott wrote up some nice stuff on the Windows 8 SDK and the sensors in the machine&lt;/a&gt;.&amp;nbsp; The SDK actually does make working with the sensors pretty straightforward.&amp;nbsp; The &lt;a href="http://code.msdn.microsoft.com/windowsapps/Geolocation-2483de66"&gt;Geolocation Sample&lt;/a&gt; Scott references is very easy to just download and run on a Win8 machine, and lets you easily play with the GPS.&amp;nbsp; Other sensors are also easily accessed via the SDK:&lt;/p&gt; &lt;p&gt;&lt;a href="http://ardalis.com/Media/Default/Windows-Live-Writer/f5a5ab1240e6_A20F/WnidowsDevices.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="WnidowsDevices" border="0" alt="WnidowsDevices" src="http://ardalis.com/Media/Default/Windows-Live-Writer/f5a5ab1240e6_A20F/WnidowsDevices_thumb.png" width="360" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;h2&gt;Apps&lt;/h2&gt; &lt;p&gt;Of course, the Ultrabook’s running Windows 8, so in addition to all the usual desktop/dev stuff, there’s the Windows Store and all that it holds.&amp;nbsp; I’m not using a ton of apps yet, but I’ve played with a few.&amp;nbsp; MetroTwit is OK, though I think I prefer HootSuite still.&amp;nbsp; The Weather app continues to be a favorite of mine.&amp;nbsp; Mail is OK, but Outlook is still way better (or Google Apps), IMHO.&amp;nbsp; The Win8 eBay app is actually very nice, so I would encourage you to check it out.&amp;nbsp; And the new Microsoft Solitaire Collection is pretty cool; my 10yo daughter really enjoyed playing a bunch of those games (as did I).&lt;/p&gt; &lt;h2&gt;Summary&lt;/h2&gt; &lt;p&gt;So far I don’t have much negative to report on the machine.&amp;nbsp; I use it for email and some software development, though it’s not my main dev machine.&amp;nbsp; I’ve used it for presenting.&amp;nbsp; It’s light, fast, and fun to use and hasn’t let me down yet for any of these activities.&amp;nbsp; The touch screen combined with Windows 8 is nice, especially when you’re lying down or in a cramped space (flying economy, for instance).&amp;nbsp; And I suspect the small things that would improve it (more RAM, more compact power supply) will be there when production models ship.&lt;/p&gt; &lt;p&gt;Do you have questions I can answer about the machine?&amp;nbsp; Post them here and I'll try to answer them.&lt;/p&gt;</description><pubDate>Fri, 19 Oct 2012 19:16:50 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/the-ivy-bridge-ultrabook-continued</guid></item><item><title>A Review of The Clean Coder</title><link>http://ardalis.com:80/a-review-of-the-clean-coder</link><description>&lt;p&gt;&lt;a href="http://amzn.to/W7wfLR"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 0px 5px 5px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" border="0" alt="The Clean Coder: A Code of Conduct for Professional Programmers" align="right" src="http://photo.goodreads.com/books/1295654320l/10284614.jpg" width="180" height="240"&gt;&lt;/a&gt;I’m generally a fan of &lt;a href="http://www.objectmentor.com/omTeam/martin_r.html"&gt;Robert C. “Uncle Bob” Martin’s&lt;/a&gt; books, so realize I’m going into this book with something of a positive bias.&amp;nbsp; While is previous books, &lt;a href="http://amzn.to/RiNdCs"&gt;Agile Principles, Patterns and Practices in C#&lt;/a&gt; and &lt;a href="http://amzn.to/KaAnba"&gt;Clean Code&lt;/a&gt;, have been specifically about programming techniques, this latest title, &lt;a href="http://amzn.to/W7wfLR"&gt;The Clean Coder&lt;/a&gt;, is more philosophical in nature.&amp;nbsp; It seeks to present Martin’s philosophy of how software developers should behave: responsibly, professionally, and with the will to say no when required.&amp;nbsp; The book consists of a number of stories, relating experiences from Martin’s programming career that spans four decades, and is obviously autobiographical in nature.&amp;nbsp; The stories are always interesting, to me at least, though not always completely relevant to the point being made.&amp;nbsp; Nonetheless, I found the book to be enjoyable and worthwhile.&amp;nbsp; While his other books frequently illuminated areas of programming or design that I hadn’t known or hadn’t put a name to, this one largely described a philosophy to which I already subscribe, and thus held few surprises.&amp;nbsp; However, it also made me think about my own career, and moments and experiences I’ve had, and I think most readers will share this kind of healthy reflection on the choices they’ve made.&lt;/p&gt; &lt;p&gt;I definitely would recommend it, especially to developers who are just starting out in their careers.&lt;/p&gt;</description><pubDate>Thu, 11 Oct 2012 18:04:19 GMT</pubDate><guid isPermaLink="true">http://ardalis.com:80/a-review-of-the-clean-coder</guid></item></channel></rss>