<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>Latest entries from timstall.dotnetdevelopersjournal.com</title><link>http://timstall.dotnetdevelopersjournal.com/</link><description></description><copyright>Copyright 2008 timstall.dotnetdevelopersjournal.com</copyright><generator></generator><lastBuildDate>Fri, 04 Jul 2008 16:56:00 GMT</lastBuildDate><image><title>Latest entries from timstall.dotnetdevelopersjournal.com</title><url>http://res.sys-con.com/portlet/163/featured-blog-graphic-145.gif</url><link>http://timstall.dotnetdevelopersjournal.com/</link></image><ttl>360</ttl><docs>http://backend.userland.com/rss</docs><item><title>What is the best way to learn coding?</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/what_is_the_best_way_to_learn_coding.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/what_is_the_best_way_to_learn_coding.htm</link><pubDate>Fri, 04 Jul 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=what%5Fis%5Fthe%5Fbest%5Fway%5Fto%5Flearn%5Fcoding</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">I have the opportunity to do a good amount of interviewing, and it lets me see many ways that developers promote themselves:</p><ul><li><p style="margin-top: 0px; margin-bottom: 0px"><a href="/hiring_based_off_years_of_experience.htm">Years of experience</a></p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Work at a prestigious company</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Professional awards</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><a href="/certification_pro_vs_con.htm">Certifications</a></p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Academic degrees (bachelors, masters)</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><a href="/the_problem_with_ill_wait_until_my_manager_sends_me_to_tra.htm">Attended training classes</a></p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Buzzwords</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Job title (&quot;Extra Super Senior Technical Specialist Level 3++, with Honors&quot;)</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">&quot;I&#39;ve read every tutorial on w3schools&quot;</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Various activities on their last job</p></li></ul><p style="margin-top: 0px; margin-bottom: 0px">At the end of the day, these are all good, but people who have these still fail simple coding questions. They can talk a good talk, pass multiple choice tests, but struggle when trying to <a href="/why_you_need_to_be_able_to_write_code_on_a_whiteboard.htm">write 10 lines of C# on a whiteboard</a>. Perhaps the #1 indicator of a good developer is that they build their own personal coding projects - from scratch. Not just <a href="/coding_vs_configuration.htm">configure some buzzword package</a>, but actually write, compile, deploy, maintain, and improve their own personal pet project. For example, many of the best developers I know are those who got started by writing their own computer games. I think this actually makes sense for a lot of reasons.</p><ul><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Good practice</strong> - If you&#39;re asked to write code in an interview, what better way to practice than by writing code on your own?</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Emotional attachment</strong> - You have a vested interest in your own pet projects, and a vested interest in their success. Therefore, you&#39;ll inevitably be more eager to learn and understand the coding techniques involved, as opposed to some &quot;boring project for work.&quot;</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Small and flexible</strong> - A pet project is small, so it&#39;s flexible and easy to change - you&#39;re not constantly dragging around years of legacy code.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Easier to try new things</strong> - You&#39;re more likely to try new things for your own project, than risk screwing up the company&#39;s flagship product.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>You see the big picture</strong> - You see your own project end-to-end, in its full context, as opposed to just a small niche of a much larger product.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Lets you focus</strong> - A small project, of your own interest, lets you focus on just the specific tech you want, as opposed to writing thousands of lines of redundant or plumbing code for work. It&#39;s often a <a href="/minimalist_code_samples.htm">minimalist example</a> of a some interesting technology, because once it gets bloated, it stops being interesting, and the developer stops working on that hobby project, and moves onto another one.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Shows motivation </strong>- Someone who invests the energy to write their own application, off the clock, is probably motivated to learn new technology and tricks for their work project.</p></li></ul><p style="margin-top: 0px; margin-bottom: 0px">There are tons of <a href="/fun_pet_project_ideas.htm">fun, pet projects</a> you could build. And with free open-source hosting with places like <a href="http://www.codeplex.com/">CodePlex</a>, you can easily share that code with others. If anyone has experienced a better way to learn coding, I&#39;m all ears.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p></span>]]></description><category>learning</category></item><item><title>Why you need to be able to write code on a whiteboard</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/why_you_need_to_be_able_to_write_code_on_a_whiteboard.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/why_you_need_to_be_able_to_write_code_on_a_whiteboard.htm</link><pubDate>Thu, 03 Jul 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=why%5Fyou%5Fneed%5Fto%5Fbe%5Fable%5Fto%5Fwrite%5Fcode%5Fon%5Fa%5Fwhiteboard</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span>During a software engineering interview, you need to be able to write code on a whiteboard. During too many interviews, at multiple companies, I&#39;ve seen candidate after candidate struggle to write simple code on the whiteboard. Many of these candidates are decent people, with CS degrees, Master degrees , &quot;years or experience&quot;, &quot;senior developer&quot; titles, etc... Yet they cannot write 10 lines of correct code on a whiteboard.</span><span> <p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">For example, such candidates will struggle to answer &quot;given a array of integers, write a method that returns the sum of all the positive numbers.&quot; Seriously. This is just a few lines of trivial code - no advanced API, no design patterns, no trivia, no tricks. It&#39;s what you&#39;d see in a college CS101, first semester exam:</p><blockquote><p><font face="Courier New" size="2">public static int GetPositiveSum(int[] aInt)<br />{<br />&nbsp;&nbsp;if (aInt == null)<br />&nbsp;&nbsp;&nbsp;&nbsp;return 0;<br /><br />&nbsp;&nbsp;int intSum = 0;<br />&nbsp;&nbsp;foreach (int i in aInt)<br />&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;if (i &gt; 0)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;intSum += i;<br />&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;return intSum;<br />}</font></p></blockquote><p style="margin-top: 0px; margin-bottom: 0px">I&#39;ve seen experienced, honest, candidates continually miss code of this simplicity.&nbsp; They&#39;ll have logic, syntax, or style problems:</p><ul><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Logic</strong> - They&#39;ll add the numbers wrong, such as overwriting sum (intSum = i), or adding it exponentially (i += i), or completely ignore any validation (what if an input parameter of a public method is null?) It&#39;s one thing not to get bogged down in tedious plumbing, but a candidate should be prepared to call out if something could crash their code.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Syntax</strong> - A significant chunk of developers just dismiss syntax, emphasizing that <a href="/i_know_the_concepts_but_not_the_syntax.htm">they know the concepts instead</a>. Good recruiters don&#39;t care about trivia, like if you miss a semi-colon at the end. But I&#39;ve seen people have the wrong method signature, declare a variable wrong, have the wrong for-loop syntax, or reference an array wrong. A mistype is okay, but when you try to drill down on concepts (&quot;Does the variable intSum need to first be assigned before being used?&quot;, &quot;Will your loop execute the correct number of times?&quot;), and they shrug it off, that&#39;s not good.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Style</strong> - Style is subjective, but important none-the-less. A good recruiter doesn&#39;t care if you indent with two spaces or four spaces. But there are other &quot;style choices&quot; that really do matter. I&#39;ve seen developers declare their variable out of scope, such as using an extra static member instead of keeping it encapsulated as an instance field. I&#39;ve also seen many devs just dismiss validation by <a href="/why_you_shouldnt_just_wrap_simple_code_in_a_trycatch.htm">wrapping the method in a try-catch</a>. Or they&#39;ll make a method instance when it could be static instead. It&#39;s okay to have personal coding preferences, but these kind of &quot;style&quot; things actually affect the functionality of the code. A candidate should be prepared to explain why these made certain &quot;style&quot; choices.</p></li></ul><p style="margin-top: 0px; margin-bottom: 0px">Obviously, recruiters know that the candidate can write code, and could stumble through 10 lines of C#. But the idea is that if a candidate struggles to write trivial code, without the aid of Visual Studio&#39;s intellisense, compiler, and debugger, then they don&#39;t <em>really</em> get it. In other words, if a candidate uses VS as a crutch for simple code, then they&#39;re probably just &quot;coding by coincidence&quot; as opposed to <a href="/a_reactive_learner_is_also_a_reactive_problem_solver.htm">proactively thinking through the code</a>. And while you can &quot;code by coincidence&quot; for easy problems, on small, standard, applications, it will result in endless bugs on larger, complex apps. For example, if a candidate doesn&#39;t realize that they need to check for a null input parameter on simple code (even when prompted), how can they be expected to validate complex and <em>critical</em> code?</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">Some interviewees seem to dismiss these coding questions as &quot;beneath them&quot;. The problem is that you must judge the unknown by the known. If a recruiter observes the candidate mess up simple code (that the recruiter can see), they&#39;ll be less likely impressed by fancy-sounding projects that they [the recruiter] cannot see. In other words, if for whatever reason the candidate cannot conceptually work through simple code, most recruiters won&#39;t even pay attention to all that allegedly complex code that the developer wrote elsewhere.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">As a candidate, this coding on the whiteboard is the chance to shine. This is not the time to say things like &quot;I guess this is how you do it&quot;, or &quot;I&#39;m trying to remember back in my college days&quot;. Rather, this is where the candidate can show that they know C# so well such that they can write it straight - without any crutch - and then explain it, and then adapt it on the fly. Now that&#39;s a great way to get off to a good start in an interview.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">FYI, here are some of the unit tests that I&#39;d run the above code through:</p><blockquote><p style="margin-top: 0px; margin-bottom: 0px"><span><font face="Courier New" size="2">Assert.AreEqual(0, GetPositiveSum(null));<br /><br />Assert.AreEqual(0, GetPositiveSum(new int[] { 0 }));<br />Assert.AreEqual(0, GetPositiveSum(new int[] { -1, -4, -4 }));<br />Assert.AreEqual(0, GetPositiveSum(new int[] { 0, -4 }));<br />Assert.AreEqual(0, GetPositiveSum(new int[] { Int32.MinValue }));<br /><br />Assert.AreEqual(4, GetPositiveSum(new int[] { 4 }));<br />Assert.AreEqual(10, GetPositiveSum(new int[] { 1,2,3,4 }));<br />Assert.AreEqual(4, GetPositiveSum(new int[] { -4, 4 }));<br />Assert.AreEqual(Int32.MaxValue, GetPositiveSum(new int[] { Int32.MaxValue }));<br />Assert.AreEqual(3, GetPositiveSum(new int[] { 0, 1, 2, -3 }));</font></span></p></blockquote><p style="margin-top: 0px; margin-bottom: 0px">.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p></span>]]></description><category>learning</category></item><item><title>Why you shouldn&apos;t just wrap simple code in a try-catch</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/why_you_shouldnt_just_wrap_simple_code_in_a_trycatch.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/why_you_shouldnt_just_wrap_simple_code_in_a_trycatch.htm</link><pubDate>Wed, 02 Jul 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=why%5Fyou%5Fshouldnt%5Fjust%5Fwrap%5Fsimple%5Fcode%5Fin%5Fa%5Ftrycatch</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">Structured programming languages, like C#, provide a try-catch ability to wrap an entire block of code, and catch if anything goes wrong. This can massively simplify error checking, especially when calling external components. However, like any good thing, it can also be abused. During interviews, or rushing out code, many developers resort to using try-catch as a quick way of doing error checking, but there&#39;s a catch (excuse the pun). For example, consider this trivial method to sum up an array of integers:</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; <span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">int</span> GetSum(<span class="kwrd">int</span>[] aInt)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">int</span> intSum = 0;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">foreach</span> (<span class="kwrd">int</span> i <span class="kwrd">in</span> aInt)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; intSum += i;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">return</span> intSum;<br />&nbsp;&nbsp;&nbsp; }</font></span></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">You can crash this code, such as by passing in null for the int array.&nbsp; To blindly wrap a simple method with try catch, just to catch normal logic errors like null variables or indexOutOfRange, has problems. </p><ul><li><p style="margin-top: 0px; margin-bottom: 0px">For performance, <a href="/improving_net_application_performance_and_scalability.htm">Try-catch is enormously expensive</a> compared to an if-then check. It could be hundreds of times slower. So it&#39;s bad design to use a try-catch for something trivial when an in-then will do just file, like checking if a variable is null.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">What will you do in the catch statement? Some devs may say &quot;I&#39;ll log my exception info here&quot; - but what info is that... that the developer didn&#39;t bother to do basic error checking?</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">It makes the usability worse. Perhaps instead of re-throwing an exception, or logging and going to the global error page, the method could have used an if-then to return a sentinel value instead. For example, perhaps a string manipulation method could just return the original value (or null) if the input parameters were invalid.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">It loses context. Say your code catches a null exception - that thrown exception doesn&#39;t tell you what variable was null. You&#39;ve lost context and information with which to fix the code. Using an in-then would have given you full access to all the local variables and their context.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">It makes all exceptions equal - a null or indexOutOfRange exception (things that are easy to catch with if-thens) are put on the same level as a critical outOfMemory error - i.e. both trigger the catch block. This in turn can distract the maintenance team, who gets swamped with tons of exceptions, most of them preventable.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Perhaps worst of all, it implies that the developer <a href="/a_reactive_learner_is_also_a_reactive_problem_solver.htm">isn&#39;t thinking about how their method can fail</a>. Rather than understanding the code and what it does, they just wrap it all in a try-catch, and move on. This means they could have not coded for valid use cases.</p></li></ul><p style="margin-top: 0px; margin-bottom: 0px">Try-catch has obvious benefits, but it has limitations and consequences too. There are times when it&#39;s much more beneficial to explicitly catch the error conditions with an if-then instead.</p></span>]]></description><category>style</category></item><item><title>The problem with &quot;I&apos;ll wait until my manager sends me to training&quot;</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/the_problem_with_ill_wait_until_my_manager_sends_me_to_tra.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/the_problem_with_ill_wait_until_my_manager_sends_me_to_tra.htm</link><pubDate>Tue, 01 Jul 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=the%5Fproblem%5Fwith%5Fill%5Fwait%5Funtil%5Fmy%5Fmanager%5Fsends%5Fme%5Fto%5Ftra</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span>With all the new technologies coming out, many software developers want to get sent to training seminars. Sometimes &quot;Training&quot; is fun - your company spends thousands of dollars to send you to a fancy building, during regular working hours, where you have an in-person expert guide you through some marketable skill. It lets you feel like you&#39;re part of an elite group, and on the insider track. Usually these sessions even provide free snacks!</span><span> <p style="margin-top: 0px; margin-bottom: 0px">This is great - until a developer uses it as <a href="/twenty_excuses_to_avoid_learning.htm">an excuse for inaction</a>, as in &quot;Rather than learn technology XYZ on my own, I&#39;ll wait until my manager sends me to training.&quot; For the vast majority of mainstream development technologies and techniques (C#, SQL, JS, HTML, XML, security, performance, automation, etc...), such thinking has some big problems.</p><ul><li><p style="margin-top: 0px; margin-bottom: 0px">Because live training seminars are expensive, managers are very reluctant to send you.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">If you&#39;re truly motivated, usually there are free (or cheap) alternatives instead. For example, there may be <a href="/the_new_lake_county_net_users_group.htm">free user groups</a> that meet in your area that offer presentations on hot topics. Sometimes there are even free MSDN events. Worst case, you can buy the $50 book.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Therefore, by the time management is willing to sink $3000 to send you to a training seminar, you could probably learn it faster yourself via <a href="/resources_for_learning_software_development.htm">some other method</a>.</p></li></ul><p style="margin-top: 0px; margin-bottom: 0px">Having special training for a cutting edge technology or proprietary tool is great. But a motivated developer shouldn&#39;t need to wait to be sent to training before learning C#, or how to improve code performance because that information is already freely available in many other formats besides in-person training seminars.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p></span>]]></description><category>learning</category></item><item><title>Silverlight TruckWars 2.0 -  Migrated to SL2  Beta 2</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/silverlight_truckwars_20___migrated_to_sl2__beta_2.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/silverlight_truckwars_20___migrated_to_sl2__beta_2.htm</link><pubDate>Mon, 30 Jun 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=silverlight%5Ftruckwars%5F20%5F%5F%5Fmigrated%5Fto%5Fsl2%5F%5Fbeta%5F2</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">I migrated <strong><a href="/silverlight__truck_wars_strategy_game.htm">Silverlight TruckWars</a></strong> to the SL Beta 2. I started working on TruckWars as a way to learn Silverlight back in the Alpha last year. Being a Microsoft product, there have been two more betas (with plenty of <a href="http://msdn.microsoft.com/en-us/library/cc645049(VS.95).aspx">breaking changes</a>), but I&#39;ve finally migrated it.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">Things of note - Beta 1 started supporting buttons, which obviously simplified things. For example, it helped me remove keyboard input. It also had some subtle changes that affected the gameplay. Also, there still is no dropdown. Before I was using an HTML dropdown to select the levels. Rather than jump through hoops, I just ceded the dropdown part until the next release.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">Because the code has been migrated from an alpha, to a beta, to another beta, it&#39;s becoming pretty screwy. Not the best, most agile code out there, but good for a demo of what cool stuff Silverlight can do. <a href="/silverlight__truck_wars_strategy_game.htm">You can play it here</a>.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p></span>]]></description><category>silverlight</category></item><item><title>The first LCNUG meeting - Windows Workflow Foundation</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/the_first_lcnug_meeting__windows_workflow_foundation.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/the_first_lcnug_meeting__windows_workflow_foundation.htm</link><pubDate>Sat, 28 Jun 2008 16:46:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=the%5Ffirst%5Flcnug%5Fmeeting%5F%5Fwindows%5Fworkflow%5Ffoundation</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">The first LCNUG meeting occurred this past Thur, June 26. It went well - about a dozen (very talented) people. Scott Seely presented on Windows Workflow Foundation, which you can <a href="http://www.lcnug.org/LCNUG/PastPresentations.aspx">download from the website</a>. The small number of attendees (as compared to the hundred who normally attend larger groups) allowed more community interaction and networking. Overall, a good success for the kickoff meeting of a new group. I&#39;m proud that Paylocity can help sponsor this.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p></span>]]></description><category>people</category></item><item><title>Do you have time to blog?</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/do_you_have_time_to_blog.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/do_you_have_time_to_blog.htm</link><pubDate>Wed, 25 Jun 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=do%5Fyou%5Fhave%5Ftime%5Fto%5Fblog</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span>I enjoy blogging, so I encourage others to try and enjoy it too. I&#39;ve met many people who say they&#39;d like to blog, but &quot;just don&#39;t have the time.&quot; I understand that we&#39;re all busy. I figure a single blog post can be small, with a few paragraphs, much like a big email. And, an average blog may have 2-3 posts a week. So, if you can cut out just one pointless email, every other day, then you&#39;ll have enough time to blog. And if you blog about what you&#39;re actively working on, then it&#39;s much faster, because the words, concepts, and code snippets are already at the tip of your tongue. Optimistically, there are ways to squeeze blogging into one&#39;s life.</span>]]></description><category>misc</category></item><item><title>Minimalist Code Samples</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/minimalist_code_samples.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/minimalist_code_samples.htm</link><pubDate>Tue, 24 Jun 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=minimalist%5Fcode%5Fsamples</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">A minimalist code sample is a snippet that demonstrates a specific purpose, requires no extra context, yet can still run. For example, <a href="http://www.dofactory.com/Patterns/PatternFactory.aspx">doFactory.com</a> explains design patterns with a &quot;real-world&quot; sample, and a &quot;structural&quot; (i.e. minimalist) sample. Because it abstracts out the context, the minimalist sample has several benefits:</p><ul><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Easier to apply: </strong>It is easier to apply to different contexts - such as new projects. </p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Easier to remember: </strong>It is much smaller (no context means less code), therefore it&#39;s easier to remember what the code was about. For example, I have a folder essentially called &quot;LearningSnippets&quot;, where I categorize different coding tricks. By keeping all the snippets small, they&#39;re fast for me to physically load, &quot;mentally load&quot;, and then run. The last thing I want is to dig through some 2000 line project, scratching my head, thinking &quot;how did I do that sorting algorithm?&quot;</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Easier to learn:</strong> It&#39;s easier to learn new concepts. Removing the irrelevant context means there&#39;s less to get distracted by, so you can focus on the specific concept that you care about.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Easier to show others:</strong> It is easier to show to others, such as a newsgroup, where other developers don&#39;t care about the business context. I sigh when I see some poor guy post a 5 page code question on a forum, because few people will sift through all that.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Easier to enhance: </strong>It can be much easier to enhance because the code is not constrained by some rigid business context.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>It is a courtesy to others: </strong>If you just care about a 3-line algorithm, it would be long-winded of me to hide that behind hundred of lines of business context and plumbing.</p></li></ul><p style="margin-top: 0px; margin-bottom: 0px">In .Net, many errors come down to a few bad lines of code - you&#39;ve got the wrong method, a bad input parameter, or some <a href="/i_know_the_concepts_but_not_the_syntax.htm">syntax error</a>. It becomes very convenient when working with others, or learning new concepts, to be able to isolate code down to the minimalist sample.</p></span>]]></description><category>learning</category></item><item><title>Natural Language Processing</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/natural_language_processing.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/natural_language_processing.htm</link><pubDate>Sat, 21 Jun 2008 15:29:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=natural%5Flanguage%5Fprocessing</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">I got very bad marks in grammar during middle school. It wasn&#39;t until after I graduated public school that I cared about writing, and hence grammar. Now, I find it quite fascinating, so I was interested to read about a <a href="http://www.codeplex.com/sharpnlp">CodePlex project - SharpNLP</a>. In their own words:</p><blockquote><p style="margin-top: 0px; margin-bottom: 0px"><font size="2">SharpNLP is a collection of natural language processing tools written in C#. Currently it provides the following NLP tools:</font></p><ul><li><p style="margin-top: 0px; margin-bottom: 0px"><font size="2">a sentence splitter</font></p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><font size="2">a tokenizer</font></p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><font size="2">a part-of-speech tagger</font></p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><font size="2">a chunker (used to &quot;find non-recursive syntactic annotations such as noun phrase chunks&quot;)</font></p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><font size="2">a parser</font></p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><font size="2">a name finder</font></p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><font size="2">a coreference tool</font></p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><font size="2">an interface to the WordNet lexical database </font></p></li></ul></blockquote><p style="margin-top: 0px; margin-bottom: 0px">So, you could type in a paragraph, and it parses that out into the different sentences, and then different words and parts of speech. Of course, I began to think if maybe this could be extended to be like the FxCop of technical articles. For example, according to the <a href="http://www.microsoft.com/MSPress/books/6074.aspx">Microsoft Manual of Style for Technical Publications</a>, the rules to merely capitalize a sub-title are non-trivial - there are 10 rules and it takes a full page to explain them. I wonder in theory if you could have a NLP (Natural Language Processing) tool run through a subtitle (as an input string), and apply the rules, much like you can parse a arithmetic expression for correct syntax. I was starting to toy around with it, but it seemed to quickly get difficult, so maybe I look at it another day.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">In the meantime, if you&#39;re interested in NLP, check out <a href="http://www.codeplex.com/sharpnlp">SharpNLP</a>.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p></span>]]></description><category>tools</category></item><item><title>Is developing a young person&apos;s profession?</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/is_developing_a_young_persons_profession.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/is_developing_a_young_persons_profession.htm</link><pubDate>Wed, 18 Jun 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=is%5Fdeveloping%5Fa%5Fyoung%5Fpersons%5Fprofession</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">Talking with another developer the other day, we began discussing if software engineering is really a young person&#39;s profession (we&#39;ve both been doing this for a while, have families, and aren&#39;t jumping to do the 70-hour weeks of boring features with boring technologies). Given the rapid turnout of new technologies, pressure from out-sourcing, and demanding projects, one might view the software world as incompatible with an older person, especially someone with a family who didn&#39;t want to spend 70 hour weeks at work.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">I&#39;m an optimist here, and I think that no -software engineering is certainly not just &quot;a young person&#39;s profession&quot;. There&#39;s a lot of advantages that older developers have, they:</p><ul><li><p style="margin-top: 0px; margin-bottom: 0px">Have more experience, so they usually have better intuition and a broader understanding with which to learn new technologies. For example, someone who already knew J2EE would pick up .Net much more quickly than someone with no computer background.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Have more understanding of the purpose of technology. They&#39;ve seen lots of business applications, so they know what they&#39;re trying to do.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Have a wider <a href="/free_development_tools.htm">stash of reusable tools</a> and source code to work with</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Can be wiser about what they invest in learning</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Have deeper knowledge. New technology is often built on top of old technology. I&#39;ve seen lots of young &quot;copy and paste&quot; developers become paralyzed when their program does anything abnormal - like throw a COM exception or accidently encode files in an unexpected format - whereas the older devs have been around and know how to handle that.</p></li></ul><p style="margin-top: 0px; margin-bottom: 0px">While new technologies do come out frequently, there are also many older technologies and concepts that still form the backbone of enterprise apps. Html, JavaScript, Xml, CSS, Sql, code generation, automation, and object oriented languages like C++ and Java,&nbsp; have all been around since the 90&#39;s. A senior developer who already knows these technologies can focus on learning just the new stuff, whereas a young developer still needs to come up to speed on these basics.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">Of course, I wouldn&#39;t say that <a href="/hiring_based_off_years_of_experience_an_analogy_with_art_an.htm">older developers are necessarily better</a>, but rather give everyone their chance. There&#39;s a lot to look forward to in software engineering, for both old and young developers. </p></span>]]></description><category>people</category></item><item><title>Upward spiral</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/upward_spiral.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/upward_spiral.htm</link><pubDate>Tue, 17 Jun 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=upward%5Fspiral</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">We&#39;ve all heard of the dreaded downward spiral, where you&#39;re behind schedule with lots of bugs, so you cut corners and rush sloppy work, only to create more bugs and get further behind. Some folks seem to think this is just a right of passage for computer programming, but it doesn&#39;t have to be that way. Just like there&#39;s a downward spiral, there&#39;s also an upward spiral, where you do good process and coding upfront, which saves you time, with which you can further improve your tools and process.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">I&#39;m a big fan of the upward spiral. The best way I see to jump on the upward spiral is to <strong>focus your resources on things that last, and avoid spending your resources on things that don&#39;t</strong>. For example, there&#39;s no benefit to you to waste hundreds of hours writing data-access plumbing code. You learn nothing new, you&#39;re probably not energized by it, and everyone around you likely just takes plumbing for granted. Things that &quot;last&quot; include your personal and technical knowledge, tools, helper classes, and any other thing that you can take with you to the next project or feature. Things that &quot;don&#39;t last&quot; are tedious bug fixes, plumbing code, obsolete technologies, and pointless trivia. These things help with the immediate task, but then are (usually) useless afterwards. </p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">Practical ways to spend your resources on things that last:</p><ul><li><p style="margin-top: 0px; margin-bottom: 0px">If you&#39;re developing on your own time, if at all possible, focus on learning new technology and techniques that you find interesting - as opposed to just plugging on a boring feature because it might impress your boss. Knowing the new techniques will let you <a href="/why_are_the_good_devs_ten_times_faster_than_the_average_ones.htm">develop much faster later</a>, which will <em>both</em> permanently enhance your developing skills, and impress your boss.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><a href="/resources_for_learning_software_development.htm">Try to learn something new each day</a>. Usually if you&#39;re working for 8 hours, you can squeeze in a half-hour of experiments that relate to that work. Learning something new each day will quickly add up. Ideally, a developer could happily answer the question &quot;what did you learn today?&quot;</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Actively pursue features that will teach you something. All else being equal, a good boss will want to give you features you&#39;re interested in because they know that you&#39;ll then be motivated to do a better job of it. So, aggressively show interest in the features that give you learning opportunities. Consider even investing your own personal time to prepare for it. If you invest two hours on the weekend to understand enough of the background to be qualified on a feature, which then lets you spend two weeks actually programming it hands on, that&#39;s a great investment.</p></li></ul><p style="margin-top: 0px; margin-bottom: 0px">I understand that sometimes your current project forces you into a rut, and you&#39;re just trying to survive. I still remember several 70 hr/week projects when I used to do consulting.&nbsp; But it&#39;s always good to keep your eye on the prize - even if right now sucks, at least be aware of that in order to strive for something better.</p></span>]]></description><category>learning</category></item><item><title>Smart vs. Smart Aleck</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/smart_vs_smart_aleck.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/smart_vs_smart_aleck.htm</link><pubDate>Tue, 10 Jun 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=smart%5Fvs%5Fsmart%5Faleck</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">An intellectually grueling field like software engineering will attract a lot of smart people. It also attracts smart alecks too. There&#39;s a big difference.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><table border="1" cellpadding="2" width="100%" style="border-collapse: collapse" bordercolor="#111111"><tbody><tr><td width="50%" bgcolor="#c0c0c0"><strong>Smart person</strong></td><td width="50%" bgcolor="#c0c0c0"><strong>Smart aleck</strong></td></tr><tr><td width="50%">Uses their smarts to help the project succeed</td><td width="50%">Tries to get people to think how smart they are. Usually their facts are wrong and their ideas are impractical.</td></tr><tr><td width="50%">Tries to build positive things up - i.e. create new process, actively solve problems</td><td width="50%">Constantly nitpicking trivia and tearing things down, without offering alternative solutions.</td></tr><tr><td width="50%">Ready to actually implement ideas</td><td width="50%">Retreats to empirical trivia or theory (perhaps by considering themselves &quot;visionary&quot;) </td></tr><tr><td width="50%">Willing to admit they&#39;re wrong in order to find the best solution</td><td width="50%">Avoids offering any criteria for falsification because they don&#39;t want to be &quot;trapped&quot; or be wrong.</td></tr><tr><td width="50%">Eager to have <a href="/a_junior_dev_codereviewing_a_senior_dev.htm">their own work reviewed</a> in order to get the best product, and learn from others.</td><td width="50%">Eager to review (and critique) others work, but resistant to apply the same standard to them self.</td></tr></tbody></table><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">No one likes smart alecks. I don&#39;t have a cure, but here&#39;s some ways I&#39;ve found to deal with them:</p><ul><li><p style="margin-top: 0px; margin-bottom: 0px">Encourage them to funnel their efforts into something good. For example, saying things like &quot;That&#39;s an interesting idea, why don&#39;t you try building it?&quot; or &quot;That&#39;s interesting trivia, but do you see anything with a higher rate-of-return to focus on?&quot;</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Don&#39;t be intimidated - smart alecks often try to intimidate others with big buzzwords or obscure trivia. But you can cut through the buzzwords by asking them to explain it in plain English. Smart alecks are dangerous to a project, so good developers have an obligation to defend the project against the <a href="/ego_star_vs_humble_average.htm">smart aleck&#39;s ego</a>.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Put the smart aleck in their place, perhaps using a standard pass-or-fail approach with agreed-upon rules. For example, you may say &quot;if your idea is right, then this C# method should not compile, are we agreed?&quot; Nothing like having the compiler itself crush a smart aleck&#39;s ego.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Fire them. It can be tough, but if they&#39;re writing bad code, while constantly distracting others with false alarms via pointless trivia and argumentative questions, they may just be &quot;not a good fit&quot; for the company.</p></li></ul><p style="margin-top: 0px; margin-bottom: 0px">There&#39;s a saying, &quot;If you have to tell someone you&#39;re a lady, then you aren&#39;t one.&quot; Likewise, smart people don&#39;t need to try impressing or convincing others that they&#39;re smart, usually people just recognize it as a side affect of the value they add.</p></span>]]></description><category>people</category></item><item><title>The problem with &quot;It&apos;s not what you know, it&apos;s who you know&quot;</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/the_problem_with_its_not_what_you_know_its_who_you_know.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/the_problem_with_its_not_what_you_know_its_who_you_know.htm</link><pubDate>Mon, 09 Jun 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=the%5Fproblem%5Fwith%5Fits%5Fnot%5Fwhat%5Fyou%5Fknow%5Fits%5Fwho%5Fyou%5Fknow</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">I remember when job-hunting back in college, lots of business majors would tell me &quot;It&#39;s not what you know, it&#39;s who you know.&quot; Some kids even used it as an excuse to avoid studying in order to go to parties instead (&quot;Why waste time studying pointless knowledge when what really matters is having a strong social network?&quot;). While there is some merit to the idea - i.e. you do want to build your network - this paradigm doesn&#39;t apply well to skilled labor that can be objectively measured, like software engineering.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">If a job doesn&#39;t require much skill, such that there are tons of qualified candidates, then of course personally knowing the hiring manager is a competitive edge. From their perspective, if all else is equal, hiring a known acquaintance mitigates risk. But, if a job does require a lot of skill, such that recruiters are actively competing to find that top talent, then they will beat a path to your door. In software engineering, <em>if you have the knowledge, then people will want to know you</em>. It&#39;s a two-way street: developers what to be employed, and companies want the best employees.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">I think of it like talent in the NBA - some players just play better than others (I believe all people are equal, they just some have different skills). That&#39;s why scouts are running all over the nation, constantly trying to woo the top free-agents. If you&#39;re the top NBA draft pick, even if you don&#39;t know anyone yet, scouts are going to want to know you.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">Sure, I understand that cronyism and nepotism exist, but in software engineering, such corruption would put that recruiter at a serious competitive disadvantage. Worst case, I&#39;d expect that a corrupt manager&#39;s greed would trump their cronyism, and they&#39;d hire the best talent. Anything else would essentially be throwing away money.</p></span>]]></description><category>people</category></item><item><title>The new Lake County .Net Users Group</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/the_new_lake_county_net_users_group.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/the_new_lake_county_net_users_group.htm</link><pubDate>Wed, 28 May 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=the%5Fnew%5Flake%5Fcounty%5Fnet%5Fusers%5Fgroup</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span>I&#39;m a big fan of user groups - it&#39;s great being able to meet other professional developers. That&#39;s why I&#39;m excited about a new user group being started in the ChicagoLand area: the <a href="http://www.lcnug.org/">Lake County .Net Users Group</a> (LCNUG). It meets at the College of Lake County. <a href="http://www.scottseely.com/">Scott Seely</a>, an author and former Microsoft employee, will be kicking it off with a presentation on Windows Workflow Foundation on June 26th. If you live in the northern Chicago suburbs, consider checking out the new LCNUG.</span>]]></description><category>people</category></item><item><title>Performance tips for a faster machine</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/performance_tips_for_a_faster_machine.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/performance_tips_for_a_faster_machine.htm</link><pubDate>Mon, 26 May 2008 14:14:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=performance%5Ftips%5Ffor%5Fa%5Ffaster%5Fmachine</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">We all want faster machines. Slow machines, especially ones that freeze up, constantly interrupt one&#39;s thought process and can pull them out of the zone. It&#39;s not just the extra 20 minutes spread throughout the day, it&#39;s also all the time lost to re-focus yourself after waiting for a long process. I&#39;m no machine performance expert, but here are tips I&#39;ve learned.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><strong>1. Run Defrag. </strong></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">You can run this via the command line, such that you hook it up to a weekly script. <a href="http://www.microsoft.com/AtWork/getstarted/speed.mspx">This MSDN explains</a>: &quot;Disk fragmentation slows the overall performance of your system. When files are fragmented, the computer must search the hard disk when the file is opened to piece it back together. The response time can be significantly longer.&quot;</p><blockquote><p style="margin-top: 0px; margin-bottom: 0px"><font face="Courier New" size="2">defrag c:\ /v /f</font></p></blockquote><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><strong>2. Clean up your hard drive.</strong></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">A crowded hard drive makes your machine run slower - there&#39;s just less wiggle room for the operating system. I&#39;ve heard some suggest that you should have at least 25% free. You&#39;ll need two big things for this: (A) a <a href="/making_backups_with_the_free_robocopy.htm">backup drive</a> for offloading infrequently used files, and (B) a tool to find obsolete files. One good, free, tool is <a href="http://www.ccleaner.com/">CCleaner</a>, which detects most of the common spots for dead-weight files. Another tool, <a href="http://www.win.tue.nl/sequoiaview/">SequoiaView</a>, shows all files sizes in a treemap graph so that you can easily see which files are taking up space.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><strong>3. Clean out your registry</strong></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">If you&#39;re continually installing and uninstalling programs, your registry may get bloated, causing big slowdowns. Modifying your registry is dangerous and could irreparably corrupt your entire machine (i.e. back up your registry and machine data first). But, given the potential performance gain, it&#39;s still worth doing some easy changes. While there are several commercial&nbsp; registry cleaner products out there, CCleaner is free and works well - it plays it safe and only removes the obvious registry errors. CCLeaner has a feature to clean out much of the garbage from your registry.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><strong>4. Adjust your UI settings</strong></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">Windows XP (I haven&#39;t touched Vista yet) lets you choose the balance between &quot;pretty UI&quot; vs. &quot;fast UI&quot;. The idea is that pretty graphics (shading, rounded corners, transitions, etc...) take extra resources to render. If you&#39;re a developer who wants speed and doesn&#39;t care about gradient-shaded window panels, you can turn that stuff off: In &quot;My Computer &gt; Advanced &gt; Performance Options&quot;, adjust for &quot;best performance.&quot; This will make everything look like old, grey, boxes - but it will be faster.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><strong>5. Kill or Block certain &quot;hog&quot; processes and system startup apps</strong></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">Background services are a big culprit for hogging resources, because these services could always be running. Skim through your Window Services to make sure that all the currently running (or automatic ones) are ok. If a service doesn&#39;t sound familiar, ask your IT department if you can kill it. In addition to services, applications that automatically start up when the machine turns on can make for a slow system startup. CCLeaner has an option for this as well, where you can explicitly block unwanted apps from automatically starting up.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><strong>6. Avoid running too many programs at once</strong></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">This is pretty obvious. Under Task Manager, the Performance and Processes tabs can show you your CPU, Commit Charge, and stuff like that.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><strong>7. Uninstall the programs you don&#39;t need</strong></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">The more stuff on your machine, the slower it will run. For example, if you no longer develop with VS 2003, remove it. This is also a good reason to avoid installing all those games on your poor, overworked PC. (But if your <a href="/excuses_for_installing_a_game_on_your_work_laptop.htm">laptop requires a certain game on it to function</a>, that may be understandable)</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><strong>8. Use batch scripts to turn off processes when you don&#39;t want them</strong></p><p style="margin-top: 0px; margin-bottom: 0px">Sometimes you need that heavy service running in the background, but sometimes you don&#39;t. For example, SQL Server can take a lot of resources. Consider having a batch script that starts it up and shuts it down - not just opening and closing SQL Studio, but stopping the actual service. You can use the &quot;net&quot; command in a batch script to start and stop services:</p><blockquote><p style="margin-top: 0px; margin-bottom: 0px"><strong>net</strong> <strong>start</strong> &quot;SQL Server (SQLSERVER2005)&quot;<br />net start &quot;Distributed Transaction Coordinator&quot;<br />&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><strong>net</strong> <strong>stop</strong> &quot;SQL Server (SQLSERVER2005)&quot;<br />net stop &quot;Distributed Transaction Coordinator&quot;</p></blockquote><p style="margin-top: 0px; margin-bottom: 0px"><strong>9. Startup script</strong></p><p style="margin-top: 0px; margin-bottom: 0px">I try to avoid re-booting my machine because I loose all my sessions - open windows, loaded files, running applications, etc... One thing that slightly eases the pain is having a batch script (clickable from my desktop) that <a href="/my_startup_script.htm">re-opens all my standard stuff</a>, like NotePad, Browsers, Cmd, and Windows Explorer. I don&#39;t necessary want this as part of my startup, but it saves me a minute to just click the batch and have several applications all re-open themselves.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><strong>10. Run Disk Cleanup</strong></p><p style="margin-top: 0px; margin-bottom: 0px">Sometimes your machine may run slow because of a bad disk. Consider running Disk Cleanup. This <a href="http://www.microsoft.com/AtWork/getstarted/speed.mspx">MSDN article</a> describes more (it also mentions freeing up disk space and defragmenting).</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><strong>Other ideas</strong></p><p style="margin-top: 0px; margin-bottom: 0px">There&#39;s always more you can do. I found these other articles to be informative reads:</p><ul><li><p style="margin-top: 0px; margin-bottom: 0px"><a href="http://asknerd.net/slowcomputer.html?src=google&amp;gclid=CNPh9rriiJMCFQUilwodSirxfA">Why is My Computer Running So Slow ?</a></p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><a href="http://www.pctuneuptips.com/tips/power">Top 10 Causes of a Slow or Freezing PC</a></p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Or, just <a href="http://www.google.com/search?hl=en&amp;safe=vss&amp;q=Windows+Machine+performance">google for more ideas</a></p></li></ul><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p></span>]]></description><category>process</category></item><item><title>What makes a process good?</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/what_makes_a_process_good.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/what_makes_a_process_good.htm</link><pubDate>Fri, 23 May 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=what%5Fmakes%5Fa%5Fprocess%5Fgood</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">I&#39;ve seen that there seems to be two different views of what &quot;process&quot; means, I&#39;ll refer to them as the &quot;pro&quot; and the &quot;con&quot;:</p><ul><li><p style="margin-top: 0px; margin-bottom: 0px">Pro - Steps to help save time and reduce tedious and error prone tasks. Examples include: continuous integration, <a href="/good_books_on_unit_testing.htm">automated unit testing</a>, and <a href="/codesmith_beyond_just_generation__doing_simple_data_analysis.htm">code generation</a>.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Con - Red tape, bureaucracy, and damaging politics - something that exists so that ivory-tower-folk can feel important. Examples include: wasting hours to reformat a private word doc so it meets &quot;standards&quot;, or manually going through all your (perfectly functional, production) code to switch the naming convention from Pascal to Camel case.</p></li></ul><p style="margin-top: 0px; margin-bottom: 0px">I&#39;ve seen projects where someone, with good intentions insists that &quot;we need to improve our process&quot;, while others, also with good intentions, just cringe. The problem is that even though they&#39;re using the same words, they still mean different things. Obviously any good project should avoid the bad and emphasize the good. </p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">With this, I offer several criteria that a good process should meet:</p><ul><li><p style="margin-top: 0px; margin-bottom: 0px">As a complete package, it should make life simpler. It should solve a specific problem that the team agrees needs solving. (run your tests, manage your source control, etc...)</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">It must always functionally work, from end-to-end. Process that produces bad output will just cause you bigger problems. It is better to <a href="/what_to_do_while_waiting_for_a_batch_process.htm">have a slower process</a> that works, then a faster process that randomly fails.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">It should have <a href="/making_process_results_public.htm">public results</a> so that everyone can see what happened</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">It should be publically documented, such as on a <a href="/wikis_and_web_content_management.htm">team wiki</a>, so that others can understand it (as opposed to always bugging you for questions)</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">It should be easy to maintain (automated [<a href="/cnug_presentation_followup__msbuild_with_source_code_samples.htm">perhaps with MSBuild</a>], machine-independent, abstract out variables like pathNames to a config, etc...)</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">It should be easy to setup. Process that is a pain to install (perhaps requiring third party components that you don&#39;t have licenses for) will eventually just be ignored.</p></li></ul><p style="margin-top: 0px; margin-bottom: 0px">There&#39;s probably more criteria, but a process that fulfills all these is off to a very good start.</p></span>]]></description><category>process</category></item><item><title>A reactive learner is also a reactive problem solver</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/a_reactive_learner_is_also_a_reactive_problem_solver.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/a_reactive_learner_is_also_a_reactive_problem_solver.htm</link><pubDate>Thu, 22 May 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=a%5Freactive%5Flearner%5Fis%5Falso%5Fa%5Freactive%5Fproblem%5Fsolver</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">It&#39;s much easier to be reactive than proactive. A reactive person looks at what already happened and tries to make sense out of it - they&#39;re always playing catch-up. A proactive person needs to understand the rules beforehand so well that they can anticipate the possible scenarios that may happen.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">This is why so many developers are re-active learners. For example, they&#39;ll first be given a problem or coding task, then they&#39;ll google to figure out the syntax, concepts, and usually code with trial and error until it appears to work (i.e. &quot;coding by coincidence&quot;). It&#39;s a very re-active approach, and it suffices for an average programmer. </p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">The problem is that a re-active learner will always be a re-active problem solver because before you can solve the problem, you need to first understand it. This means you need to learn the concepts involved. Furthermore, if you haven&#39;t learned the concepts yet, you can&#39;t know how the system will react, which means it will likely react in ways you didn&#39;t intend. For example, a developer who never learned about concurrency or scalability will be in for a big surprise when their procedures start running in production with multiple users. Such an error can sound very cryptic, especially if &quot;<a href="/tips_for_making_machineindependent_code.htm">it works on my machine</a>&quot;, but randomly fails in production. Instead of designing their code proactively to deal with the problem (where such a solution would be much cheaper), they&#39;ll have to try to reactively first learn what happened, and then hope that it&#39;s still solvable.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">Therefore, a good long-term approach is to not just reactively google coding questions as you come across them, but to also proactively read the actual books and language specifications themselves. That way, you know before hand what to expect from the technology, without waiting for it to do something intentional - when learning the solution may be too late.</p></span>]]></description><category>learning</category></item><item><title>Using Linq to sort and filter entity lists</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/using_linq_to_sort_and_filter_entity_lists.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/using_linq_to_sort_and_filter_entity_lists.htm</link><pubDate>Mon, 19 May 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=using%5Flinq%5Fto%5Fsort%5Fand%5Ffilter%5Fentity%5Flists</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span></span><span><p style="margin-top: 0px; margin-bottom: 0px">One of the big new features for .Net if LINQ - Language Integrated Query. There&#39;s lots of good tutorials out there - you can see <a href="http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx">101 examples</a>, download a <a href="http://www.linqpad.net/">free GUI editor</a> from the guys who wrote C# 3.0 in a Nutshell, or even just google it. As I was toying with Linq (via the very good chapters from C# 3.0 in a Nutshell), I especially enjoyed using Linq to query objects. Here&#39;s the test snippets I was running.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">First, I created a trivial entity:</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; <span class="kwrd">public</span> <span class="kwrd">class</span> Employee<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">public</span> Employee(<span class="kwrd">int</span> age, <span class="kwrd">string</span> strFirstname)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">this</span>.Age = age;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">this</span>.FirstName = strFirstname;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">public</span> <span class="kwrd">int</span> Age { get; set; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">public</span> <span class="kwrd">string</span> FirstName { get; set; }<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">string</span> ToString()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">return</span> <span class="kwrd">this</span>.FirstName + <span class="str">&quot; (&quot;</span> + <span class="kwrd">this</span>.Age + <span class="str">&quot;)&quot;</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }</font></span></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">Then I set up an MSTest project (perfect for stubbing out things like this), and added this initializer to always give me an Employee array:</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><span>&nbsp;&nbsp;&nbsp; [TestInitialize]<br />&nbsp;&nbsp;&nbsp; <span class="kwrd">public</span> <span class="kwrd">void</span> SetData()<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _employees = <span class="kwrd">new</span> Employee[]<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">new</span> Employee(39, <span class="str">&quot;Homer&quot;</span>),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">new</span> Employee(39, <span class="str">&quot;Marge&quot;</span>),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">new</span> Employee(7, <span class="str">&quot;Lisa&quot;</span>),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">new</span> Employee(9, <span class="str">&quot;Bart&quot;</span>),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">new</span> Employee(3, <span class="str">&quot;Maggie&quot;</span>)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br />&nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp; Employee[] _employees;</span></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">Now, I can write some test snippets.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><strong>Filter an Entity list</strong></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">Given an array of Employees, I can filter them by business rules, such as getting all employees over 10 years old. We used to need to handle this (in C#) by writing a custom loop that checked each item. Now, Linq gives us a <a href="/whats_your_favorite_domain_specific_language.htm">Domain-Specific-Language</a> to just handle this, usually with 1 line of code. </p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">Note the &quot;n =&gt; n.Age &lt; 10)&quot;, this is where the <a href="/i_know_the_concepts_but_not_the_syntax.htm">syntax</a> may seem new. This is where you can put your appropriate filter expression. Linq then provides a ToArray method to ensure that an array of employees are returned - as opposed to some differently type dynamically-crated object.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; [TestMethod]<br />&nbsp;&nbsp;&nbsp; <span class="kwrd">public</span> <span class="kwrd">void</span> FilterEntity()<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Employee[] ae = _employees.Where(n =&gt; <strong>n.Age &lt; 10</strong>).ToArray&lt;Employee&gt;();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Assert.AreEqual(3, ae.Length);<br />&nbsp;&nbsp;&nbsp; }</font></span></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">This alone is great. There&#39;s no fluff wasted. It&#39;s a single line, and every keyword and expression maps to a specific concept: &quot;Given an array of <strong>employees</strong>, filter them <strong>where</strong> the <strong>age &lt; 10</strong>, and then return an <strong>array</strong> of <strong>employees</strong>.&quot;</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">It gets better - the filter expression can contain your own custom method. In this case, I created a &quot;HasBigName&quot; method to check for custom logic (the length of the string). </p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; [TestMethod]<br />&nbsp;&nbsp;&nbsp; <span class="kwrd">public</span> <span class="kwrd">void</span> FilterEntitySpecial()<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Employee[] ae = _employees.Where(n =&gt; <strong>HasBigName(n.FirstName)</strong>).ToArray&lt;Employee&gt;();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Assert.AreEqual(3, ae.Length);<br />&nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp; <span class="kwrd">public</span> <span class="kwrd">bool</span> HasBigName(<span class="kwrd">string</span> s)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">if</span> (s == <span class="kwrd">null</span> || s.Length &lt;= 4)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">return</span> <span class="kwrd">false</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">else</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">return</span> <span class="kwrd">true</span>;<br />&nbsp;&nbsp;&nbsp; }</font></span></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><strong>Sort an Entity list</strong></p><p style="margin-top: 0px; margin-bottom: 0px">Linq makes it easy to sort entities by their fields. In this case, I can sort the employees by their first name.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><span>&nbsp;&nbsp;&nbsp; [TestMethod]<br />&nbsp;&nbsp;&nbsp; <span class="kwrd">public</span> <span class="kwrd">void</span> SortEntity()<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Employee[] ae = _employees.OrderBy(n =&gt; n.FirstName).ToArray&lt;Employee&gt;();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Assert.AreEqual(5, ae.Length);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Assert.AreEqual(<span class="str">&quot;Bart&quot;</span>, ae[0].FirstName);<br />&nbsp;&nbsp;&nbsp; }</span></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><span></span><p style="margin-top: 0px; margin-bottom: 0px"><strong>Conclusion</strong></p><p style="margin-top: 0px; margin-bottom: 0px">Linq is a great example of something that was <em>possible</em> to do before, but wasn&#39;t always practical. Developers don&#39;t like writing&nbsp; extra lines of plumbing code just to do mundane things like sorting and filtering, so it&#39;s a huge win to have a means to quickly handle that.</p></span>]]></description><category>coding</category></item><item><title>Beyond functionality for enterprise apps</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/beyond_functionality_for_enterprise_apps.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/beyond_functionality_for_enterprise_apps.htm</link><pubDate>Thu, 15 May 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=beyond%5Ffunctionality%5Ffor%5Fenterprise%5Fapps</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">Many developers are so pressured by demanding schedules that their goal is just to &quot;get the job done&quot;, by which they mean &quot;it functionally works.&quot; While this is a great first step, professional programming requires more, such as:</p><ul><li><p style="margin-top: 0px; margin-bottom: 0px">Maintainability</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Performance</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Scalability</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Security</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Testability</p></li></ul><p style="margin-top: 0px; margin-bottom: 0px">As you go from a <a href="/career_path_from_hobbyist_to_professional.htm">hobbyist toy to an enterprise app</a>, these criteria become self-evident. They&#39;re buzzwords that everyone has heard, but surprisingly few seem to put into practice. Interesting questions to ask yourself (or someone you need to interview):</p><ul><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Maintainability</strong> - Have you ever had to write code that will be maintained by other people? How did you code differently to make it more maintainable?</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Performance</strong> - Have you ever had to write code that was performance critical? How did you ensure that that code was fast enough?</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Scalability</strong> - Have you even had to write code that was used by more than 1 million users? What might you do differently to ensure the code handled that?</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Security</strong> - Have you ever had to write code that protected secure data and you knew someone would try hacking it? How did you make it secure?</p></li><li><p style="margin-top: 0px; margin-bottom: 0px"><strong>Testability</strong> - How would you ensure that your code could be tested?</p></li></ul><p style="margin-top: 0px; margin-bottom: 0px">Of course some of these, like performance tuning, may take more time. But that goes with the territory of large-scale apps.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">In general, I come across two kinds of programmers - those that just worry about functionally &quot;getting it done&quot;, and those that look beyond functionality. It seems the first group digresses into boring copy and paste work, whereas the second is constantly on an adventure doing new, fun things. The beauty is that there&#39;s nothing that stops someone from jumping into the second group. You can read about all the techniques online, use open-source tools, and often it&#39;s even faster. For example, anyone could use NUnit, or MSTest to write unit tests to help their testing, or read about Refactoring or <a href="/design_patterns.htm">design patterns</a> for more maintainable code.</p></span>]]></description><category>style</category></item><item><title>&quot;I know the concepts, but not the syntax&quot;</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/i_know_the_concepts_but_not_the_syntax.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/i_know_the_concepts_but_not_the_syntax.htm</link><pubDate>Wed, 14 May 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=i%5Fknow%5Fthe%5Fconcepts%5Fbut%5Fnot%5Fthe%5Fsyntax</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">I hear it a lot from developers - &quot;I know the concepts, but just not the syntax.&quot; The thinking seems to be:</p><ol><li><p style="margin-top: 0px; margin-bottom: 0px">There&#39;s too much out there and I can&#39;t know it all</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">The concepts are what really matter</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">The syntax is just trivial stuff that I can look up.</p></li></ol><p style="margin-top: 0px; margin-bottom: 0px">Therefore, the idea is that the developer knows the important stuff (concepts), and shouldn&#39;t be blamed for not knowing the unimportant stuff (syntax). Fair enough as long as you know enough syntax to get the job done. However, more often than not, I see developers who continually shrink the first category and enlarge the second. For example, I&#39;ve seen developers refer to standard concepts for which they&#39;re heard the buzzword but don&#39;t understand (OOP, exception handling, n-tier architecture, client-server models, design patterns, etc..) as &quot;syntax&quot;. Some people think this is a smart way to avoid saying &quot;I don&#39;t know.&quot; The problem is that these things are not syntax - syntax is language specific details for a single implementation. For example, various languages can each have their <a href="/different_types_of_comments.htm">own syntax to create comments</a>. The concept is &quot;creating a comment in code&quot;, the syntax is what you actually type to do it (such as // or /* ... */ in C#). </p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">A general rule is that concepts transcend any one language. For example, C++, Java, and C# all use OOP, so questions like &quot;What is an abstract class&quot; or &quot;What is polymorphism&quot; are conceptual questions - they have nothing to do with syntax. Likewise, all these <a href="/coding_vs_configuration.htm">xml config files</a> (like the ASP.Net web.config, or even MSBuild) have little to do with syntax - the whole point of making them in xml is to bypass any syntax problems. Rather, they&#39;re about &quot;do you understand the problem space?&quot; If you know the concepts to tune a web application, ASP.Net&#39;s web.config suddenly makes a lot more sense.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">I realize at the end of the day, implementation requires us to know the syntax. In fact, many developers can copy and paste chunks of code without even knowing that conceptually is going on. To such a developer, everything is effectively syntax. However, there&#39;s always the benefit of being able to step back and differentiate between the two.</p></span>]]></description><category>style</category></item><item><title>Converting an object from JSON and back in Silverlight</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/converting_an_object_from_json_and_back_in_silverlight.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/converting_an_object_from_json_and_back_in_silverlight.htm</link><pubDate>Tue, 13 May 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=converting%5Fan%5Fobject%5Ffrom%5Fjson%5Fand%5Fback%5Fin%5Fsilverlight</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<p>JSON (<a href="http://www.json.org/">JavaScript Object Notation</a>) provides a convenient way to serialize an object, like &quot;Employee&quot; with first and last name, to a string. This can be very useful in Silverlight apps, such as when you need to pass complex objects to and from a web service.</p><p>There are APIs in Silverlight that make it relatively easy to roundtrip an object from a JSON string and back. Here are two wrapper methods.</p><p>These use the assemblies System.IO and System.ServiceModel.Web (which contains the necessary namespace System.Runtime.Serialization.Json). It also uses the two static utility methods I blogged about to <a href="/convert_from_a_memorystream_to_a_string_and_back.htm">roundtrip from a MemoryStream</a> and back (<span>GetMemoryStreamFromString and </span><span>GetStringFromMemoryStream).</span></p><p><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; <strong><span class="kwrd">public</span> <span class="kwrd">static</span> T ConvertFromJSON&lt;T&gt;(<span class="kwrd">string</span> strJSON</strong>)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.Json.DataContractJsonSerializer d = <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">new</span> System.Runtime.Serialization.Json.DataContractJsonSerializer(<span class="kwrd">typeof</span>(T));<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MemoryStream m = GetMemoryStreamFromString(strJSON);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; T obj = (T)d.ReadObject(m);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">return</span> obj;<br />&nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp; <strong><span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">string</span> ConvertToJSON&lt;T&gt;(T obj)</strong><br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Runtime.Serialization.Json.DataContractJsonSerializer d = <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">new</span> System.Runtime.Serialization.Json.DataContractJsonSerializer(<span class="kwrd">typeof</span>(T));<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MemoryStream m = <span class="kwrd">new</span> MemoryStream();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; d.WriteObject(m, obj);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">string</span> strJSON = GetStringFromMemoryStream(m);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">return</span> strJSON;<br />&nbsp;&nbsp;&nbsp; }</font></span></p><p>I assume that the code is self-explanatory. Perhaps the only note is that it <a href="/using_generics_for_dynamic_return_type_and_validation.htm">uses Generics to dynamically set the return type</a>. You could also optimize the methods for performance by instantiating the <span><font face="Courier New" size="2">DataContractJsonSerializer </font></span>once, and making these utility methods, as opposed to static methods that re-create it every time.</p>]]></description><category>silverlight</category><category>sample_code</category></item><item><title>Is Silverlight just another buzzword?</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/is_silverlight_just_another_buzzword.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/is_silverlight_just_another_buzzword.htm</link><pubDate>Mon, 12 May 2008 14:30:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=is%5Fsilverlight%5Fjust%5Fanother%5Fbuzzword</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<p>There are always new buzzwords coming out in software development. One of those buzzwords gaining more traction is &quot;<a href="http://silverlight.net/">Silverlight</a>&quot;, a Microsoft technology to enable rich UI web applications.</p><p>I think that Silverlight is great, and is far more than a buzzword. I see it offering several big benefits:</p><ol><li><strong>Graphical API </strong>-&nbsp; Silverlight lets you draw and animate vector graphics. For example, you could easily do a graph. ASP.Net had ways to handle this, but they were slow and cumbersome (for example, use GDI+ to <a href="/securing_images_from_unauthorized_users.htm">create the image on your server</a>, and then load it up).</li><li><strong>Programming a compiled language (like C#) on the client</strong> - This is just awesome. Whether you&#39;ve written <a href="/benefits_of_farseer_2d_physics_engine.htm">an entire physics engine</a> that you&#39;re running on the client, or just doing complex validation, the ability to code difficult logic in a first class language like C#, as opposed to a brittle scripting language, is invaluable.</li><li><strong>Rich object and event model - no more postbacks, easy to add controls, etc...</strong> - You could <a href="/adding_and_removing_items_from_an_html_listbox.htm">modify the DOM using JS</a>, but it&#39;s so much easier to do this with Silverlight. For example, try dynamically adding an entire complex UserControl with JavaScript - it&#39;s doable, but hard. It&#39;s one line in silverlight. </li><li><strong>Cross-browser compliant</strong> - Silverlight just works on the main browsers (IE, Firefox, etc...). No more pulling your hair out because you forgot to check some DOM method nuance.</li><li><strong>UI rendered through xaml</strong> - Silverlight lets you create your &quot;Form&quot; via a markup language, somewhat like Html, but much cleaner. I think this is a cleaner style than creating it via the codeBehind (like WinForms).</li></ol><p>How does Silverlight doe this? In one sense, it &quot;cheats&quot; by requiring a small download (kind of like a flash player). So, Silverlight isn&#39;t just like Ajax, which plays by the rules of the web but just stretches them by leveraging the XmlHttpRequest object, but rather Silverlight plays a whole new game.</p>]]></description><category>silverlight</category></item><item><title>JavaScript enums</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/javascript_enums.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/javascript_enums.htm</link><pubDate>Tue, 22 Apr 2008 14:28:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=javascript%5Fenums</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span>While JavaScript does not explicitly have the enum keyword, you can work around it using JS rich objects to get the functional equivalent. Here&#39;s a minimalist example that defines the enum, passes it in as a parameter, and then checks for it in a switch-case statement. Although, this doesn&#39;t throw a &quot;compile time&quot; exception if you pass in an invalid value.</span> <p><strong>&nbsp;&nbsp;&nbsp; var Enum_Colors = <br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Red:0,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Blue:1,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Green:2,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Yellow:3<br />&nbsp;&nbsp;&nbsp; };</strong><br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; function DoStuff()<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TestEnum(<strong>Enum_Colors.Green</strong>);<br />&nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp; function DoError()<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TestEnum(<strong>Enum_Colors.Unknown</strong>); //Bad<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; function TestEnum(objColorEnum)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var str;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch(objColorEnum)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case Enum_Colors.Red:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str = &quot;red&quot;;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case Enum_Colors.Blue:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str = &quot;blue&quot;;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case Enum_Colors.Green:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str = &quot;green&quot;;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case Enum_Colors.Yellow:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str = &quot;yellow&quot;;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str = &quot;none&quot;;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert(&quot;The enum passed in is: &quot; + str);<br />&nbsp;&nbsp;&nbsp; }</p><p>&nbsp;<span>Thanks to VS2008, you at least get JS intellisence on the &quot;Enum_Colors&quot; object, so that&#39;s better than just typing in error-prone literal strings.</span></p>]]></description><category>javascript</category><category>sample_code</category></item><item><title>Convert from a MemoryStream to a string and back</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/convert_from_a_memorystream_to_a_string_and_back.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/convert_from_a_memorystream_to_a_string_and_back.htm</link><pubDate>Mon, 21 Apr 2008 14:14:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=convert%5Ffrom%5Fa%5Fmemorystream%5Fto%5Fa%5Fstring%5Fand%5Fback</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[<span><p style="margin-top: 0px; margin-bottom: 0px">A stream in .Net is a sequence of bytes. There are several types of streams. A common one is the <a href="http://msdn2.microsoft.com/en-us/library/system.io.memorystream.aspx">MemoryStream</a> which uses memory for its storage (as opposed to a file system, or something else). Several readers and writers require a stream as an input parameter, and you&#39;ll find that sometimes you&#39;ll just want to be able to easily convert from a string to a MemoryStream and back. Here are two easy utility methods to do that:<span><font face="Courier New" size="2"><br /><br />&nbsp;&nbsp;&nbsp; <span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">string</span> GetStringFromMemoryStream(MemoryStream m)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">if</span> (m == <span class="kwrd">null</span> || m.Length == 0)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">return</span> <span class="kwrd">null</span>;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m.Flush();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m.Position = 0;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StreamReader sr = <span class="kwrd">new</span> StreamReader(m);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">string</span> s = sr.ReadToEnd();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">return</span> s;<br />&nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp; <span class="kwrd">public</span> <span class="kwrd">static</span> MemoryStream GetMemoryStreamFromString(<span class="kwrd">string</span> s)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">if</span> (s == <span class="kwrd">null</span> || s.Length == 0)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">return</span> <span class="kwrd">null</span>;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MemoryStream m = <span class="kwrd">new</span> MemoryStream();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StreamWriter sw = <span class="kwrd">new</span> StreamWriter(m);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sw.Write(s);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sw.Flush();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">return</span> m;<br />&nbsp;&nbsp;&nbsp; }</font></span></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">We can easily test these with a round-trip method. Note that ideally we&#39;d have one test for each specific method, but this is just for demo purposes:</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px"><span><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; [TestMethod]<br />&nbsp;&nbsp;&nbsp; <span class="kwrd">public</span> <span class="kwrd">void</span> Convert_RoundTrip()<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">string</span> s1 = <span class="str">&quot;Hello World!&quot;</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MemoryStream m = GetMemoryStreamFromString(s1);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Assert.AreEqual(12, m.Length);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="kwrd">string</span> s2 = GetStringFromMemoryStream(m);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Assert.AreEqual(s1, s2);<br />&nbsp;&nbsp;&nbsp; }</font></span></p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p></span>]]></description><category>coding</category><category>sample_code</category></item><item><title>My Startup Script</title><guid isPermaLink="true">http://timstall.dotnetdevelopersjournal.com/my_startup_script.htm</guid><link>http://timstall.dotnetdevelopersjournal.com/my_startup_script.htm</link><pubDate>Fri, 11 Apr 2008 05:00:00 GMT</pubDate><comments>http://timstall.dotnetdevelopersjournal.com/console/comments/popup/?f=my%5Fstartup%5Fscript</comments><dc:creator>Tim Stall</dc:creator><description><![CDATA[&nbsp;<span> <p style="margin-top: 0px; margin-bottom: 0px">I don&#39;t like re-starting my machine because I need to re-open all the misc windows and files I have loaded. However, because I still need to reboot, I wrote a simple script to open common programs and files for me.</p><blockquote><p style="margin-top: 0px; margin-bottom: 0px"><font face="Courier New" size="2">REM: Open Windows Explorer</font></p><p style="margin-top: 0px; margin-bottom: 0px"><font face="Courier New" size="2">start explorer<br />start explorer<br /><br />REM: Open NotePad</font></p><p style="margin-top: 0px; margin-bottom: 0px"><font face="Courier New" size="2">start notepad<br />start notepad &quot;C:\MyDocuments\temp.txt&quot;<br /><br />REM: Open the DOS command window, default to a certain folder</font></p><p style="margin-top: 0px; margin-bottom: 0px"><font face="Courier New" size="2">start cmd &quot;/Kcd C:\Utils\MyTasks&quot;<br /><br />REM: Open Internet Explorer</font></p><p style="margin-top: 0px; margin-bottom: 0px"><font face="Courier New" size="2">start /B /D&quot;C:\Program Files\Internet Explorer&quot; iexplore.exe<br /><br />REM: Open a Visual Studio solution</font></p><p style="margin-top: 0px; margin-bottom: 0px"><font face="Courier New" size="2">start /B /D&quot;C:\MySolutions\StandardFiles&quot; StandardFiles.sln</font></p></blockquote><p style="margin-top: 0px; margin-bottom: 0px">This opens five main things:</p><ul><li><p style="margin-top: 0px; margin-bottom: 0px">Windows Explorer</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Notepad - a blank version, and one that stores a simple scratchpad of notes. You could also open <a href="/taking_notes_with_microsoft_onenote.htm">other scratchpads</a>.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Internet Explorer (could just as easily be firefox). There are also ways to <a href="/open_up_multiple_tabs_in_ie7_from_the_command_line.htm">pre-populate the tabs</a>.</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Cmd window - I set it to a directory that has a bunch of misc scripts (using the &quot;/K&quot; switch to call the CD command)</p></li><li><p style="margin-top: 0px; margin-bottom: 0px">Visual Studio - In this case I open a solution folder with a bunch of misc xml files that I use.</p></li></ul><p style="margin-top: 0px; margin-bottom: 0px">Of course you can add other programs to the list too.</p><p style="margin-top: 0px; margin-bottom: 0px">&nbsp;</p><p style="margin-top: 0px; margin-bottom: 0px">Lastly, I made a shortcut of this batch script on my desktop, so I just click it when Windows loads up. (You could probably <a href="http://windowsxp.mvps.org/Startup.htm">automate the startup tasks</a> if you want).</p></span>]]></description><category>process</category></item></channel></rss>