Wednesday, October 20, 2010

A small tip to .NET bloggers...

I have a small tip for .NET bloggers out there:

Will you please include full namespaces in your example code?

For people not yet well versed in the .NET API that you describe or use in your code, nothing is more frustrating than copying a couple of lines of code from a blog and then finding out that it doesn't compile because they have not referenced the right assembly and/or included the needed using statement for the namespace.

What would you prefer to find as an example in a post that describes how you can let Windows open a website in the default browser by simply starting a new process with the URL as the commandline?

  1. System.Diagnostics.Process.Start("http://blog.peshir.nl/");
  2. using System.Diagnostics
    ...
    Process.Start("http://blog.peshir.nl/");
  3. Process.Start("http://blog.peshir.nl/");
    You find the Process class in the System.Diagnostics namespace.
  4. Process.Start("http://blog.peshir.nl/");

To me any option is fine, except the last one.

No comments:

Post a Comment