<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>jaredpar's WebLog : Developing</title><link>http://blogs.msdn.com/jaredpar/archive/tags/Developing/default.aspx</link><description>Tags: Developing</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Code Smell: Psychic classes</title><link>http://blogs.msdn.com/jaredpar/archive/2009/06/18/code-smell-psychic-classes.aspx</link><pubDate>Thu, 18 Jun 2009 17:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9771971</guid><dc:creator>Jared Parsons</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jaredpar/comments/9771971.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaredpar/commentrss.aspx?PostID=9771971</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaredpar/rsscomments.aspx?PostID=9771971</wfw:comment><description>&lt;p&gt;Psychic classes have the appearance of ignoring data provided to it in an attempt to provide you with an answer they predict is better for the situation.&amp;#160;&amp;#160; It’s impossible to look at a the data provided to an instance of the class and understand what queries on the object will return because it may think of a better answer for you, or a better piece of data to look at.&lt;/p&gt;  &lt;p&gt;This comes from an example I ran into about a month ago.&amp;#160; I work on an IDE and naturally deal with a lot of parse trees and tokens.&amp;#160; Parsing everything all the time is expensive so naturally the results are cached in various places for performance reasons.&amp;#160; &lt;/p&gt;  &lt;p&gt;While debugging one such cache I noticed some strange behavior.&amp;#160; The cache wasn’t returning the right tree for the input it was provided.&amp;#160; So I decided to dig into the code a bit.&amp;#160; &lt;/p&gt;  &lt;p&gt;This cache takes several different forms of input which has no common base class or interface.&amp;#160; What I noticed though is that when resetting the input of the service, it would not clear the existing cache or the previous form of input.&amp;#160; Also because of the way the code loaded certain forms of input had precedence over others.&amp;#160; So even an explicit clear did not guarantee the “correct” input was used.&lt;/p&gt;  &lt;p&gt;The result is a service that reads well in code, but will not always act as you expect it to.&amp;#160; The service at times will seemingly ignore all input and pick a source it thinks is better.&amp;#160; Take the following code as an example&lt;/p&gt;  &lt;pre&gt;pCache-&amp;gt;SetSource(pSomeFile);
ParseTree* pTree = pCache-&amp;gt;GetTree();  &lt;/pre&gt;

&lt;p&gt;This code is very straight forward but is certainly not guaranteed to do what it appears to do. &lt;/p&gt;

&lt;p&gt;I like to think the service is predicting the results rather than calculating them.&amp;#160; Or better yet guessing the answer.&amp;#160; From the perspective of a code reviewer, that’s what’s happening.&amp;#160; &lt;/p&gt;

&lt;p&gt;Obviously I was curious about the reason for this and did a bit of research.&amp;#160; It’s a rather old class so I had to contact people who’d been on the team awhile back and dig through the history of the code base to understand what the purpose of this behavior was.&amp;#160; It turns out it was done to fix a few impactful scenarios where an alternate source needed precedence over the typical source.&amp;#160; Other devs didn’t fully understand the source semantics of the service and wrote methods that caused bad interactions.&amp;#160; Eventually it evolved to it’s current odd state.&amp;#160; &lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href="http://diditwith.net/"&gt;Dustin&lt;/a&gt; for coining the term “psychic classes”.&amp;#160; Other ones we considered were&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Jedi Mind Trick classes: Weak name&lt;/li&gt;

  &lt;li&gt;Weatherman: It’s a prediction after all&amp;#160; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And yes, we fixed this issue :) &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9771971" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaredpar/archive/tags/Gotcha/default.aspx">Gotcha</category><category domain="http://blogs.msdn.com/jaredpar/archive/tags/Humor/default.aspx">Humor</category><category domain="http://blogs.msdn.com/jaredpar/archive/tags/Developing/default.aspx">Developing</category></item><item><title>Dvorak keyboard … is it really faster ???</title><link>http://blogs.msdn.com/jaredpar/archive/2009/01/12/dvorak-keyboard-is-it-really-faster-gasp.aspx</link><pubDate>Mon, 12 Jan 2009 16:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9244403</guid><dc:creator>Jared Parsons</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/jaredpar/comments/9244403.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaredpar/commentrss.aspx?PostID=9244403</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaredpar/rsscomments.aspx?PostID=9244403</wfw:comment><description>&lt;P&gt;Most people discover I’m a Dvorak user because they’re in my office, attempt to drive during a conversation and find they are typing gibberish.&amp;nbsp; I take the keyboard, hit CTRL+LEFT_SHIFT and they’re on their way again.&amp;nbsp; Well at least until they open up a new window.&amp;nbsp; It usually leads to a conversation about how I like Dvorak.&amp;nbsp; And most importantly … “is it really faster than QWERTY?”&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I’ve been using a &lt;A href="http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard" mce_href="http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard"&gt;Dvorak keyboard&lt;/A&gt; for 4 years now.&amp;nbsp; If you’re not familiar with Dvorak, it’s an alternative keyboard layout designed to be better in QWERTY in both efficiency and speed back in 1936.&amp;nbsp; Other benefits are also associated with it such as ergonomics, reduced typos, etc.&amp;nbsp; In my experience I find developers are much more keenly interested in the speed part.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Over 70 years later there is still a bit of debate if it achieved these goals.&amp;nbsp; There are several studies of greater and lesser quality on the subject.&amp;nbsp; None of which really has seemed to end the debate.&amp;nbsp; If you are curious about the actual studies I encourage you to start at the &lt;A href="http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard" mce_href="http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard"&gt;wikipedia page&lt;/A&gt;.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Before I switched to Dvorak I read a few of the studies.&amp;nbsp; In the end I’m not sure of their respective quality level but it didn’t stop me from trying out Dvorak anyways.&amp;nbsp; Why?&amp;nbsp; As I said there appeared to be a lot of debate, typing faster sounded nice and my former college roommate convinced me it was a great idea.&amp;nbsp;&amp;nbsp; The last reason being the most important.&lt;/P&gt;
&lt;P&gt;What I didn’t see a lot of though when I was reading up on it was how the Dvorak keyboard affects the life of a developer (at least outside the speed thing).&amp;nbsp; The studies were geared toward more general problems.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;So this post is about how I feel the layout affects me as a developer 4 years later.&amp;nbsp; Note the word &lt;STRONG&gt;feel&lt;/STRONG&gt;.&amp;nbsp; If you are looking for a hard core scientific study, I would navigate elsewhere.&amp;nbsp; This is about my personal experiences as a developer with learning Dvorak and using it in my daily routine.&amp;nbsp; So please read this post as an opinion piece and not a statement of fact.&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Is it faster?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;While I was reading up on Dvorak but still typing QWERTY I started timing myself with several programs.&amp;nbsp; In particular I measured peak WPM and average WPM.&amp;nbsp; Two weeks later I started with Dvorak and kept timing myself for about the next six months.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;In terms of peak WPM Dvorak is definitely faster for me.&amp;nbsp; I could get a steady peak at 120 WPM on QWERTY but can get into 140 with Dvorak.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;For my normal day to day typing, I do type faster but not appreciably so.&amp;nbsp; Maybe 5 WPM.&amp;nbsp; I can easily hit and maintain 70-80 WPM for day to day tasks and once you’re at that speed, much more isn’t really noticed when you’re coding.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;How long did it take to switch?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The first month was mostly me trying to work in Dvorak but getting so frustrated that I switched back to QWERTY to get real work done.&amp;nbsp; After the first month I spent the majority of my time in Dvorak.&amp;nbsp; I was noticeably slower in replying to email and occasionally I would switch back to QWERTY to fire off a longer email or code snippet.&amp;nbsp; The third month was the turning point.&amp;nbsp; I hit full time Dvorak and stopped switching to QWERTY except for cases where someone else was in my office.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I kept using typing tests continually check on how my overall speed was doing.&amp;nbsp; Around the end of the third month I pretty much hit parity with my QWERTY abilities.&amp;nbsp; After six months I did see a small increase in my average WPM and I hit 140 WPM several times.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Is it more ergonomic?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Before I started using Dvorak I was getting a bit of CTS in my right shoulder.&amp;nbsp; Enough so that I started looking into exercises to help it out.&amp;nbsp; The symptoms started to go away fairly soon after I started using Dvorak as my full time layout.&lt;/P&gt;
&lt;P&gt;Now I am &lt;STRONG&gt;not&lt;/STRONG&gt; actually making a claim that it’s more ergonomic.&amp;nbsp; For me in my situation it helped.&amp;nbsp; IMHO, I think it’s just as likely that a simple change of pace had as much to do with it as the actual layout.&amp;nbsp; But if you’re desperate and you have time to kill … &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Are any of the key repositioning impactful for development?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Yes.&amp;nbsp; The repositioning of the {},[] and = keys is brutal for a developer in a C based language.&amp;nbsp; Essentially anything in the top right corner of the QWERTY keyboard.&amp;nbsp; They keys are in almost the same position.&amp;nbsp; This made the switch even harder as muscle memory kept taking over and spitting jibberish into my code.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;This will make life difficult for the first month or so.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What weird issues did I encounter?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I think the biggest issue is I’m a VIM user.&amp;nbsp; For some reason I thought it a bright idea to not do any special VIM mapping and learn to use the standard VIM key mappings with Dvorak.&amp;nbsp; That was … a learning experience.&amp;nbsp; It took quite some time before it turned back into muscle memory.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Can you still type QWERTY?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Somewhat.&amp;nbsp; It takes me about 5 minutes to get going but after that I can touch type to a degree.&amp;nbsp; Albeit pretty slowly.&amp;nbsp; Enough though that I can use a machine for a few hours and debug a problem.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Using very cryptic command line programs such as WinDbg, PowerShell or VIM on QWERTY is very painful.&amp;nbsp; It’s amazing how much of that is just muscle memory.&amp;nbsp; Even if I get into QWERTY touch type mode I have to think very hard about what I’m typing in those types of programs.&amp;nbsp; I flat out can’t use VIM but the rest I get by after a bit of frustration.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Do you make less typos?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;That sound you heard was the rest of my coworkers and my wife laughing hysterically.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;One of the benefits I read about when I switched to Dvorak is that it would reduce typos and misspellings.&amp;nbsp; I’ll sum that claim up with a quick “Didn’t wrok for me”.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Passwords&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Eventually, you will encounter a situation that forces you to type your password in QWERTY.&amp;nbsp; Prior to QWERTY when choosing a new password, I would stare at my keyboard and type in gibberish for a new password.&amp;nbsp; Well not exactly gibberish, it had to have a certain count of numbers, symbols, letters and a minimum length.&amp;nbsp; But I would take 5 minutes and just learn the gibberish via muscle memory.&lt;/P&gt;
&lt;P&gt;This is not so great when you need to type in a&amp;nbsp;passworld via QWERTY.&amp;nbsp; Muscle memory doesn't quite translate back to the QWERTY binding.&amp;nbsp;&amp;nbsp;To the people sitting in the room with me I'm sure it was fairly humerous.&amp;nbsp; I would type a few letters into the password box, then mouse to&amp;nbsp;the desktop, type quickly, see where my fingers ended up, and then type the next few letters of the password.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The lesson is, make sure you know what your password is, and not just where to move your fingers.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Do I think that developers should switch to Dvorak?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;For 95% of the developers out there I would say no.&amp;nbsp; The gains are minor if any.&amp;nbsp; Outside of WPM the gains are subjective.&amp;nbsp; Developers really seem intent on the speed portion of the switch.&amp;nbsp; This speed gain was minor for me.&amp;nbsp; Once you can steady type ~70WPM the gain really doesn’t seem worth it for programming.&amp;nbsp; But more importantly though, being faster won’t make you a better programmer, practice will. &lt;/P&gt;
&lt;P&gt;Additionally, besides the learning curve of getting to Dvorak, you have to retain some level of competence at QWERTY.&amp;nbsp; Whether it’s debugging problems on other peoples machines, or participating in a group presentation you will be using QWERTY more often than you think.&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;But there are that 5% who are &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Looking for a challenge &lt;/LI&gt;
&lt;LI&gt;Want to try something different &lt;/LI&gt;
&lt;LI&gt;Or simply just want other people to stop using your computer &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Even if you do stick it out though, the benefits are small and many are very subjective. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt; Forgot the problems I had with passwords&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9244403" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaredpar/archive/tags/Developing/default.aspx">Developing</category></item></channel></rss>