Showing posts with label tools. Show all posts
Showing posts with label tools. Show all posts

Wednesday, May 30, 2012

Free WMI Code Creator - WMICodeCreator.exe

I’ve tinkered with WMI in the past, usually to find some IIS, network, or process information on remote machines where there wasn’t a readily-available API. I realize as the world of .Net APIs expand, the need for WMI shrinks, but it’s still an underlying technology that lets you do “magic” when there appears to be no other way.
However, the problem I’ve often had with WMI is finding the exact query to run. To my knowledge, it didn’t have intellisence, and I never clicked with the reference manual. I recently found a tool that makes it easy to generate WMI snippets – the free WMI Code Creator v1.0. Yes, this tool is from 2005, yes that means I am absolutely no WMI guru, but I still wanted to pass it along.
The tool provides a GUI to select the various namespaces and classes from which to construct your WMI query, and then lets you select the properties (“columns”) to return.  Then, it lets you execute the code on the fly. The tool just worked. Here’s a snippet of what it returns for querying process information.

using System;
using System.Management;
try
{
       ManagementObjectSearcher searcher =
               new ManagementObjectSearcher("root\\CIMV2",
               "SELECT * FROM Win32_Processor");

       foreach (ManagementObject queryObj in searcher.Get())
       {
              Console.WriteLine("-----------------------------------");
              Console.WriteLine("Win32_Processor instance");
              Console.WriteLine("-----------------------------------");
              Console.WriteLine("Family: {0}", queryObj["Family"]);
              Console.WriteLine("ProcessorId: {0}", queryObj["ProcessorId"]);
              Console.WriteLine("ProcessorType: {0}", queryObj["ProcessorType"]);
       }
}
catch (ManagementException e)
{
       MessageBox.Show("An error occurred while querying for WMI data: " + e.Message);
}

Monday, May 30, 2011

Tool - WinSplit Revolution - move windows between monitors

A coworker showed me a useful (and free!) tool that conveniently positions open windows on your screen.

The tool is Winsplit Revolution, and it let you use hotkeys to instantly move your windows, such as flipping a window between different monitors, or having two windows split on the same monitor. It also provides hotkeys for many other features, including maximizing and minimizing (you can use default OS keys, but I find the winsplit ones more convenient).

As a free tool that just works, I'm glad to have it.

Sunday, May 30, 2010

Three cautions with mocking frameworks

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/three_cautions_with_mocking_frameworks.htm]

I'm a big fan of unit testing. I think in many cases, it's faster to developer with unit tests than without.

Perhaps the biggest problem for writing unit tests is how to handle dependencies - especially in legacy code. For example, say you have a method that calls the database or file system. How do you write a unit test for such a method?

One approach is dependency injection - where you inject the dependency into the method (via some seam like a parameter or instantiate it from a config file). This is powerful, but could require rewriting the code you want to test.

Another approach is using mock or "isolation" framework, like TypeMock or RhinoMock. TypeMock lets you isolate an embedded method call and replace it with something else (the "mock"). For example, you could replace a database call with a mock method that simply returns an object for your test. This is powerful; this changes the rules of the game. It's great to assist a team in adopting unit testing because it guarantees that they always have a way to test even that difficult code. However, as Spiderman taught us, "With great power comes great responsibility". TypeMock is fire. A developer can do amazing things with it, but they can also burn themselves. If abused, TypeMock could:

  1. Enable developers to continue to write "spaghetti" code. You can write the most tangled, dependent code ever (with no seams), the kind of thing that would get zero test coverage, and TypeMock will rescue it. One of the key points of unit testing is that by writing testable code, you are writing fundamentally better code.
  2. Allow developers to get high test coverage by simply mocking every line. The problem is that if everything is mocked, then there's nothing real left that is actually tested.
  3. Make it harder to refactor because the method is no longer encapsulated. For example, say a spaghetti method has a call to a private database method, so the developer uses TypeMock to mock out that private call. Later, a developer refactors that code by simply changing the name of a private method (or splits a big private method into two smaller ones). It will break the related unit tests. This is the opposite of what you want - encapsulated code means you can change the private implementation without breaking anything, and unit tests are supposed to give confidence to refactoring.

TypeMock can work magic, but it must be used properly.

Wednesday, May 13, 2009

Troubleshooting Visual Studio Profiler with ASP.Net

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/troubleshooting_visual_studio_profiler_with_aspnet.htm]

Visual Studio 2008 (and I think 2005) come with a built-in .Net profiler. Profilers are especially useful for troubleshooting performance bottlenecks (Related: CLR Profiler for old versions of Visual Studio; SQL Profiler). There are already good tutorials on it, so here I'm just offering misc tips and troubleshooting. Basically, you can go to Analyze > "Launch Performance Wizard", and just select all the defaults. You can use this with ASP.Net web projects too.

Error: When trying to start, I got "Value does not fall within the expected range".

Solution: You can set the config of a website to "Any CPU".

Error: VSP1351 : The monitor was unable to create one of its global objects

Other times I got this error:

Error VSP1351 : The monitor was unable to create one of its global objects (Local.vsperf.Admin). Verify that another monitor is not running, or that another application hasn't created an object of the same name.
Profiler exited
PRF0010: Launch Aborted - Unable to start vsperfmon.exe

Solution: You can use Process Explorer to see what is locking "vsperf.Admin", and then kill that process tree. For me, it was the aspnet_wp.exe process.

Error: PRF0010: Launch Aborted - Unable to start vsperfmon.exe

Sometimes I got this error:

PRF0010: Launch Aborted - Unable to start vsperfmon.exe
Error VSP1342 : Another instance of the Logger Engine is currently running.
Profiler exited

Solution: I restarted Visual Studio (yes, it's lame, but it appeared to work). I also ensured that all other instances of VS were closed.

Error: Sometimes clicking the stop button caused IE and VS to crash, without even collecting data

Solution: By just closing the IE browser directly, it worked.

Monday, May 4, 2009

Cool Tool - NDepend for automated code metrics

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/cool_tool__ndepend_for_automated_code_metrics.htm]

Given human nature, and all the tedious things that go into coding, the coding standards that survive are usually the ones that you can automate with some external tool.

Code Metrics is one such type of governance. Two of the most popular metrics are line count and cyclomatic complexity. Perhaps the best tool on the market to assist with these (and much more) is NDepend.

For example, say you want to prevent developers from writing huge methods, or huge files. You could use the command line for NDepend to check for method-line-count, and then fail any check-in that doesn't meet this policy - just like you could fail a check-in that doesn't compile or breaks a unit test.

Cyclomatic code complexity is another one - this (to simplify it) measures the number of dependencies. The more dependencies, the harder to instantiate something in a test harness, so this is actually a big deal. You could reduce dependencies by leveraging interfaces and abstract classes, using injections, or the like (whole books are written about this).

This is just the tip of the iceberg. NDepend has dozens of these types of metrics.

Initially I tried to use Visual Studio's "code metrics" feature, but for some reason I cannot fathom, you cannot run it from the command line - which of course makes it useless for an automated build (which is the whole point). At least VS code coverage had undocumented techniques to work around this.

I realize there are open-source options for basic file line count, but I personally haven't come across any that can effectively do the other metrics like method line count and cyclomatic complexity.

Bottom line - if you're trying to enforce automated governance through your build, consider checking out NDepend. Yes, there's a license fee, but if it saves you even 10 hours by preventing issues and bad design, then it's paid for itself. Also, being aware of these types of metrics is the kind of thing that helps take a developer to the next level.

[Disclaimer - I haven't fully implemented this myself yet, it's still in a research phase, and I'm just sharing my findings]

Thursday, January 15, 2009

Tool: Survey Monkey

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/tool_survey_monkey.htm]

Surveys are a great way to find team consensus and get everyone's opinions - especially anonymous surveys. While you could use blank sheets of paper, another way is to offer a web survey. A great tool for that is Survey Monkey. I've taken several surveys with them before, but what I didn't realize is that you can set up a free account, and start sending out real surveys right away - almost like setting up a free hotmail account. Of course there are limits, and they sell packages for more advanced features and quantity. However, for small and simple online surveys of 20 people, the free product works great.

You could ask your team all sorts of questions, like why don't we write more unit tests?, why do we break the build?, what would it take to work twice as fast?, and the like.

Monday, January 5, 2009

Benefits of writing a new tool

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/benefits_of_writing_a_new_tool.htm]

I'm a big tool fan. I especially get a kick out of writing my own, custom tools - if it doesn't exist yet. Here are some benefits for writing your own, new tools:

  • Very practical - A custom tool can fill a very practical niche, and let you complete a task much faster than the alternative. Usually if there's some tedious task that takes more than an hour, and I can write the tool in an hour, I'll write the tool to do it.

  • You can consume it - There's something special about seeing your own code in action, especially when it's sparing you from a lot of tedious grunt work. I still get a kick out of running the MassDataHandler tool which makes it trivial to insert test SQL data.

  • Small scale - If you're working on large (legacy) applications, whipping out a small tool can be refreshing. Some custom "throw-away" tools can be as quick as an hour to write.

  • Huge variety - It's easy to get pigeon-holed into a specific technology or application framework. Writing a tool lets you explore areas of .Net that you might never get the chance to look at else wise. For example, some application developers might never touch reflection, diagnostics, threading (!), networking, or even streams because their application framework (usually written by someone else) abstracts those all away.

  • You can share it with the world - Tools are usually isolated and self-contained (i.e. not glued to a huge framework), and hence easy to share. They are often business-independent, so you can open-source a development tool without revealing any business secrets.

Friday, June 20, 2008

Natural Language Processing

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/natural_language_processing.htm]

I got very bad marks in grammar during middle school. It wasn'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 CodePlex project - SharpNLP. In their own words:

SharpNLP is a collection of natural language processing tools written in C#. Currently it provides the following NLP tools:

  • a sentence splitter

  • a tokenizer

  • a part-of-speech tagger

  • a chunker (used to "find non-recursive syntactic annotations such as noun phrase chunks")

  • a parser

  • a name finder

  • a coreference tool

  • an interface to the WordNet lexical database

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 Microsoft Manual of Style for Technical Publications, 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.

 

In the meantime, if you're interested in NLP, check out SharpNLP.

 

Sunday, January 27, 2008

Tool: Microsoft SQL Server Database Publishing Wizard 1.1

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/tool_microsoft_sql_server_database_publishing_wizard_11.htm]

I was experimenting around with some starter kits, and I came across this good, free tool - Microsoft SQL Server Database Publishing Wizard 1.1. Basically, it can write a database schema, and data, to a sql script. I think it has a command line API too!

 

I found this useful when trying to deal with some database in a starter kit that I couldn't access outside of Visual Studio. I wanted to be able to script and extend it. It was in an ASP.Net 2.0 app_data folder. I'm sure there was a way around it, but this approach seemed so much faster for me. I scripted the database, and then re-ran the script in SQL Studio, and changed the asp.net db connection strings to that new database.

Wednesday, December 12, 2007

What's your favorite Domain Specific Language?

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/whats_your_favorite_domain_specific_language.htm]

I love domain specific languages (DSL). The idea is that instead of programming at a low level (i.e. tedious and error-prone), you program at a higher level of abstraction. This means coding with a language (or even class library) that closely maps to the problem domain. For example, here are several domain specific languages. While you could try to do without, it just becomes so much easier with them:

 

DSLPurposeExampleManually doing without:
Regular ExpressionsFind and replace patterns in textFind all numeric decimals in a fileYou could use core string methods like SubString and IndexOf
SQLManage database dataSelect all employees that meet a certain criteriaYou could do selects by getting the entire dataset and cycling through the object model
XPathQuery xml dataGet the custom order xml nodes where price is less than $100You could step through the xml with a reader, or loop through an XmlDocument
MSBuildMicrosoft's build engine to automate your processesCompile your application on a build server, run unit tests, and then produce MSI outputsYou could use System.Diagnostics to manually run a bunch of commands, and keep track of error conditions and logging output yourself.
String Format ExpressionsFormat a string using var.ToString("myPattern")Format the number 12.3456 to only two decimal placesYou could use core string methods, and pick apart the variable, and re-assemble it.

 

The point is that while someone could get by without knowing the appropriate domain language, it's just not practical to tackle the domain without it. Each of these has tons of tutorials and quickstarts, so there's no reason to avoid them. An application developer should probably be comfortable with most of these.

 

So, what's your favorite domain specific language?

Thursday, September 20, 2007

Free Development Tools

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/free_development_tools.htm]

A lot of programmers get their start as young hobbyists. However, young hobbyists often don't have the money to buy expensive development tools.

Fortunately, in .Net, you can get most of the core development tools for free.

  • Microsoft provides express editions for its platform. They're more limited than the commercial products, but they get you started.

  • Even a hobbyist should still have source control (note that this isn't .Net specific, you could use it to manage any files)

    • A free, open-source, source control system (which is way better than VSS) is Subversion.

    • Even if you are the sole developer, source control still is invaluable:

      • It lets you keep track of all your changes, giving you the confidence to experiment with big changes because you know you can just roll back. This is much better than copying your entire project each time you do something big.

      • It lets you view the entire revision history of your code

  • There are tons of free helper-tools, like NUnit for unit tests, FxCop for static code analysis, and more. Scott Hanselman does a great job of summarizing these.

Given that the knowledge is free (via millions of internet tutorials, blogs, and reference guides), and the tools are free, all you need is a computer and motivation, and even the young hobbyist can become a great developer.


Living in Chicago and interested in working for a great company? Check out the careers at Paylocity.

 

Thursday, July 12, 2007

Using CodeSmith to create your own Domain-Specific-Language

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/using_codesmith_to_create_your_own_domainspecificlanguage.htm]

Using CodeSmith to create your own Domain-Specific-Language

Yesterday I mentioned about software factories and domain-specific languages (DSL). A DSL is just that - working at a higher level language that maps to a specific problem domain instead of constantly re-inventing the wheel with a lower-level language. Some common examples of DSLs are:

  • SQL
  • Regular Expressions
  • XPath

Each of these could be achieved by coding in a "low level" language like C#, but you wouldn't think of doing that because it'd be too slow and error prone. It's so easy to use each language because it maps naturally to what you're trying to do in that domain.

This same concept applies to application development. For example, an application has different domains:

  • Initial data for your application (like security settings, roles, out-of-the-box dropdown values, etc...) - usually achieved with lots of custom SQL scripts.
  • UI formatting - usually achieved with tons of table or CSS references, or highly-refactored controls
  • Validation
  • Data access code

Each of these can have their own DSL, which you could easily create using a code-generator like CodeSmith. You could abstract the concepts to an XML schema, and then use CodeSmith as a "Compiler" to transform that xml into the appropriate output (sql, html, or C# code files). CodeSmith's out-of-the-box XmlProperty feature, along with text based templates and huge online community make it very easy to do.

For example, instead of having tons of custom SQL scripts for your security data, you may have a hierarchal XML file that (1) is completely refactored and maps directly to the business needs (something potentially impossible with a procedural language like SQL), (2) can be easily validated via the XML schema and CodeSmith checks, and (3) is much easier to track version history on.

Microsoft offers their own DSL toolkit, but I think it doesn't yet compete with CodeSmith because the MS DSL toolkit: (1) requires you to learn a whole new GUI syntax (whereas CodeSmith is intuitive C# and Xml templates), (2) seems limited in what it can generate, and (3) screws up Visual Studio by inserting a new reference (or something like that) into every project.

Once you start code-generating tedious stuff, such as using your own DSL, you'll never go back.


Living in Chicago and interested in a great company? Check out the careers at Paylocity.

Wednesday, July 11, 2007

Practical Software Factories in .NET

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/practical_software_factories_in_net.htm]

I'm a big fan of automation (especially via MSBuild and CodeSmith), so I'm very interested in the Software Factory community. I recently finished Practical Software Factories in .NET by Gunther Lenz Christoph Wienands. As I understood it, they emphasized four main parts for a software factory:

  1. Product Line Development - emphasis on a specific type of software (web apps vs. 3D-shooters vs. winForms)
  2. Reusable assets - class libraries, controls,
  3. Guidance in Context - this could be as simple as instructions in the comments of generated code
  4. Model-driven development (i.e. Domain Specific Languages) - working at a high level of abstraction.

A lot of this boils down to standardization, automation, and reuse - things already covered by classic books (like the Pragmatic Programmers). However, the software factory methodology provides a structured way to achieve those things.

I also found this book interesting because it discussed concepts at a much higher, and more practical level. for example, there are plenty of "syntax" books out there, like How to Program Technology X. There are also lots of conceptual books that address the theory and problems of software engineering, like Code Complete, The Pragmatic Programmers, Joel on Software, or The Mythical Man-Month. These transcend individual, and are therefore still relevant as new technologies come out.

Practical Software Factories is different because it both address concepts, yet refers to the current technologies, websites, articles, and open-source projects to achieve those concepts. So even a year or two from now, when the current crop of  tools and articles are replaced, its concepts will still be relevant, and likely implement-able with a new wave of tools.


Living in Chicago and interested in a great company? Check out the careers at Paylocity.

Sunday, May 20, 2007

Making a transparent Gif with the free Paint.Net

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/making_a_transparent_gif_with_the_free_paintnet.htm]

Sometimes a developer will need to make a transparent GIF, such as for a web page. This should be trivial - you essentially want to say "make every pixel that is color X be transparent", but most standard development tools (VS, Paint, etc...) don't let you do this. While there are lots of expensive graphics programs out there, most developers don't have these.

An easy way to make a transparent gif is using the free Paint.Net (written entirely in .Net).

  1. Download Paint.Net. It's a pretty good, free, graphics editing tool.
  2. Open up your image. Save it as a gif.
  3. In the Tool section, use the "Magic Wand" feature.
  4. Set it's tolerance to '0%'
  5. Drag it over the section you want to make transparent. The magic wand catches an entire region of adjacent, same-color-range, pixels
  6. Once the region is selected, then hit the delete key. [Updated 12/11/2007]

I find this convenient for simple web imaging needs. Also, Paint.Net has a ton of other features, like gradients, blends, and special effects.

 


Living in Chicago and interested in working for a great company? Check out the careers at Paylocity.

Friday, January 5, 2007

Free online JavaScript formatter

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/free_online_javascript_formatter.htm]

Sometimes you'll see JavaScript in what appears to be a garbled mess - no spaces, comments, or line breaks. This may be because JavaScript is transmitted over the wire, therefore it's faster performance to omit all those things that are unnecessary to the end user. However, they're great for the developer trying to read someone else's JavaScript. Hence, the need to format JavaScript.

There are several free formatters out there. Criteria I'm interested in is: (1) Accuracy, (2) Convenience - ideally an online tool as opposed to something I need to download, (3) Cost - ideally it'd be free, and (4) Length - I'd want it to be able to format large scripts, not just some 5 line demo.

There seems to be a lot to choose from: http://www.google.com/search?hl=en&q=JavaScript+formatter

Currently I'm looking at: http://www.jwmdev.tzo.com:8080/resources/js-tools/index.html

I'm also finding the NotePadd++ language feature helpful with this because it (1) color highlights JavaScript, and (2) match thes parenthesis and brackets for you (including nesting), making it very easy for you to format it yourself as you run through what the code actually does.

Thursday, January 4, 2007

MassDataHandler article in .Net Developer's Journal

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/massdatahandler_article_in_net_developers_journal.htm]

Paylocity recently published an article about the open-source MassDataHandler. This framework assists with testing the database.

We've also uploaded version 1.3, which offers several new features:

  • Improved handling of identity values and triggers: (1) Triggers no longer break the identity inserts, (2) You can specify identity inserts for a table-by-table basis using an Xml attribute on the Table element, (3) If you set IdentityInsert=On for a table without Identity, then it no longer crashes.
  • Improved extracting from existing data: (1) The Existing Data tab can now use a custom select that returns many tables, and (2) When using Existing Data tab, if you use a Custom filter, it will copy your Sql select values into the Xml file as a meta node.
  • Some miscellaneous bug fixes and enhancements.

You can download the framework on Microsoft's CodePlex site.

Thursday, November 9, 2006

MSBuild: Read and Write from a File to a Variable

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/msbuild_read_and_write_from_a_file_to_a_variable.htm]

MSBuild lets you easily read and write values from files into variables. While you could write your own custom tasks to do this, MSBuild provides out-of-the-box functionality with the ReadLinesFromFile and WriteLinesToFile tasks.

You can read from a file into a variable:

    <ReadLinesFromFile File="Version.txt">
      <Output TaskParameter="Lines"
        PropertyName="Prop1" />
    ReadLinesFromFile
>

This will store the contents of the file "Version.txt" in a dynamically created property "Prop1".

You can also write to files:

      <WriteLinesToFile File="myFile.txt" Lines="This is a test value." Overwrite="false" />
      <WriteLinesToFile File="myFile.txt" Lines="A second line." Overwrite="false"
/>

Tuesday, November 7, 2006

Foreach loop in MSBuild

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/foreach_loop_in_msbuild.htm]

Yesterday we mentioned how MSBuild can handle conditional logic. It can also handle looping using the concept of "batching" and ItemGroups.

<Project    xmlns="http://schemas.microsoft.com/developer/msbuild/2003">        <ItemGroup>        <ExampColl Include="Item">            <Number>123Number>        ExampColl>        <ExampColl Include="Item">            <Number>456Number>        ExampColl>        <ExampColl Include="Item">            <Number>789Number>        ExampColl>    ItemGroup>    <Target Name="ShowMessage">        <Message Text = "Number: %(ExampColl.Number)"/>    Target>Project>

The first step is to make an ItemGroup - which is simply a group of items that you can potentially loop through. Each ItemGroup needs the required "Include" attribute. For a basic example, lets just set this to "Item". The power comes in that you can add your own custom attributes to the ItemGroup, such as "Number".

You can then reference (and loop through) the ItemGroup using "%(.)", such as "%(ExampleCol1.Number)". When run, the above snippet produces the following output. Notice the Message task being called three times - once for each item in the ItemGroup.

Target ShowMessage:
    Number: 123
    Number: 456
    Number: 789


Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.01

There's a lot more that you can do with Task Batching, but this is a helpful start. You can replace the Message task with any task you want, and use the '%' character in any attribute of that task. It's a lot cleaner than the DOS for loop.

Monday, November 6, 2006

Conditional Logic (If-Then-Else) in MSBuild

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/conditional_logic_ifthenelse_in_msbuild.htm]

MSBuild provides the ability to do an if-then-else control structure, using the Condition attribute, which is available to every task. Simply put, the task only runs if the given condition is true.

An If-Then-Else means "if the condition is true, run the first statement, else run the second statement". This is logically equivalent to: If 'X' is true, run S1; If 'X' is false, then run S2. We can use the task's Condition attribute, with the ! ('Not') Operator to achieve this. For example, in the snippet below, if the variable "RunTask" is true, then the first line is run, else the second line is run.

    <Message Condition="$(RunTask)" Text="Do X" />
    <Message Condition="!$(RunTask)" Text="Do not do X" />

You can see a list of allowed conditional expressions in the MSBuild reference. It includes operators ( <, >, <=, >=, ==, !=, !, And, Or), parenthesis, and even an "Exists" function to see if a file exists.

Friday, November 3, 2006

The Benefits of Reinventing the Wheel

[This was originally posted at http://timstall.dotnetdevelopersjournal.com/the_benefits_of_reinventing_the_wheel.htm]

When someone else already makes a good, working tool, you may not want to reinvent the wheel and build a similar thing yourself. Of course we want to reuse code and not waste time repeating someone else's work. However, as an extracurricular activity, there can be benefits to creating your own version of an interesting tool:

  • Great learning opportunity - You'll understand something better when you build it yourself. You can then also compare your solution with the industry standard, and check for general trends to possibly improve your programming (i.e. "I did it this way, but they did it that way... ah... that's why they did it that way.")
  • A sense of personal accomplishment - you may a fun tool. That someone else already made a similar tool doesn't diminish your own adventure.
  • An appreciation for the tool when you see how hard it was to write.
  • The possibility that you can write it better.
  • You can customize it to your unique needs.
  • If the tool isn't free, you can now have your own copy that you don't need to worry about licensing for.
  • It's fun to write cool tools - even if someone else already has. Especially when you're a younger developer, you need to start somewhere - you can't always write flashy new things that no one has seen before.