Saturday, 30 June 2007

Add Command Line Parsing to your applications

Sometimes you have some job to get done (e.g.: loading custom format text files in to a db) and you must be fast. So you take your favorite editor and write a script in your favorite scripting language. Next time that a similar problem comes to you, you edit the script making it more parametric.
For accomplish this task you can take two ways (not mutually exclusives):
  1. use command line parameters
  2. use a configuration file
If the script importance is growing you can evaluate a porting to .NET/Mono platform and use my Command Line Parsing Library to easy parse command line arguments. (The project was recenlty moved from GotDotNet to CodePlex).
For managing conifiguration data check out my Common Utility Library (but be careful, the software is experimental and can change very quickly disrupting backward compatibility).

My personal taste is to use command line options and I've used the Command Line Parsing Library for this purpose for more than two years. The project will grow, but I think that for now is quite stable.

Tuesday, 26 June 2007

Mono compilation problem (GMCS)

I found a compilation problem working on a litte project that I want to publish as soon as possible.
The problem happens when inheriting from IEnumerator<T>. If you want to go deeper see the detailed description of bug 81948 on their bugzilla.

Thursday, 14 June 2007

Unit Tests Sources == Initial Documentation

If you publish a library with its source code, I think it's completely useless without some kind of documentation.
If these sources are subject to change frequently (because you're giving to the developers community a work under construction), you normally will not have time to prepare documentation and examples.

OK. In this case the only think you can't omit is including in your package unit tests sources.
Here I want to give prominence to coding unit test classes with the same accuracy you write the rest of the code.
Putting particular attention to name and to write high quality code inside test methods, it will produce your initial documentation "automatically".
Of course when you release an advanced beta or production quality code, you'll include a standard library reference (more on this argument in future).

Monday, 4 June 2007

Console.WriteLine("Hello World!");

I've finally decided to publish my personal web log. Even if my primary language is italian, I will post in english in order to allow more people to read it.
I know that my english is not perfect, for that please execuse me in advance. I hope however that it is sufficiently clear.

This blog will focus on .NET development. Published code will be 100% compatible with Mono the open source Linux/Unix incarnation of .NET (see their web site for detailed platforms support).