Feb 12, 2007

I decidedly need to write documentation for my projects

See this email exchange I had earlier today:

Mono.GetOptions: howto?


FROM: Piercarlo Slavazza

Hi Rafael,

I'm considering usgin Mono.GetOptions for my .net project, and I would
like to know where I can find some documentation or at least some sample
code where to "quickly" figure out how to use the library - of course I
already googled around but I wasn't able to find any good snippets.

Another question: what's license applies to Mono.GetOptions?

Thanks you.
Regards,


FROM: Rafael Teixeira

The last question I'll answer first: the license is BSD/MIT, what
means mainly just use it and be happy.

There is a sample app in the sources (mcat), that show many of
Mono.GetOptions resources.

But It's my fault that little documentation is available.

Some (unfleshed) class documentation is here
http://www.go-mono.com/docs/index.aspx?tlink=0@N%3aMono.GetOptions

Many mono tools also use Mono.GetOptions, but the project that drove
its development is the now defunct mbas (his successor vbnc doesn't
use it).

The main gist is that you do things declaratively. Example:

public class MyOptions : Options {

[Option("Do some important thing", 'i')]
public bool important;

...
}

After calling the option processing in your main method, your instance
of MyOptions, will have 'important' set to true if the command line
have an argument like

/i or /important

Deriving from Options (which isn't mandatory means you already inherit
a help command that generates automatically a help screen with all the
options you've declared.

I'm quite sure the Mono-list archives has some more extensive
explanation I gave some time (years) ago about the subject. Sorry but
I'm in a hurry now.

Thanks for evaluating the use o Mono.GetOptions.

I should point out that I'm starting to work on a better version to be
called Commons.GetOptions, but I now just have the early planning
being cooked (see this blog)

Have fun,

Jan 9, 2007

Commons.GetOptions the sucessor to Mono.GetOptions

I'll start Commons.GetOptions outside of Mono, and just keep Mono.GetOptions 1.0 stable (only security fixes) inside Mono svn. That would help with stability requirements for Mono colliding with the desire for innovation/improvements on GetOptions.

I'll post details as I progress with it. But some of the ideas I already have are:

  1. to make it I18n-friendly (either gettext and resources, by defining/using localization providers and matching tools)
  2. drop the multiple constructor overloads for the attributes, in favor of the supported syntax for field initialization by name
  3. refactoring into a layered design, that should allow for imperative definition of option sets, besides the declarative form currently supported
  4. subcommands support
  5. easier runtime addition of options
  6. a tool to compile a DSL (Domain Specific Language) to binary optionsets classes and/or generate (cia codedom) partial classes sources in any language that have correct codedom support installed.
  7. a GTK# GUI tool (also wrapped as a MD plugin) to write the above DSL (some call it a graphical DSL)
  8. A WinForms component/editor to define/generate/use the DSL
  9. Full Monodoc/VSNET Documentation
  10. Sample code also in Boo, VB.NET and Java(IKVM)

Nevertheless suggestions are welcome.

Nov 3, 2006

MS is getting some sense...

See the Novell/Microsoft cooperation/patent-protection agreements news, from Mono's perspective, of course:

http://tirania.org/blog/archive/2006/Nov-02.html

Oct 23, 2006

Some days you wake up an year older, but old problems still surround you...

Yeah, today I turned 45.

But I can't get past an uncompleted years-old Java project, that is keeping my hands contractually tied, and making it really hard not to go bankrupt.

Mild depression over the issue is probably the cause of a very large drop on my productivity as a developer, that only adds to the problem, making it harder to solve.

Even the projects I do really enjoy, like Mono and MonoDevelop, are suffering from this situation, as I can't get the inner peace I need to really contribute to them.

My loving wife and those two beautiful kids we have, are the only reason I really have to not give up on everything...

Happy birthday to me!

Oct 6, 2006

C#-scripting of Firefox, looks like something interesting

Vladimir Vukićević's post (Missing Pieces) opens up a nice prospect, of being able to script client-side with C#, and perhaps, Boo, and other CLR languages.

I think Mono fits the bill nicely on how to integrate with Firefox in Linux and elsewhere it is available, the same way it will be possible to do with the CLR in Windows Vista.

In truth, Mono's embedding API is a proven solution that, AFAIK, predates any MS disclosure of such a thing for .NET.

We just need to understand that this IE7-born integration, that is being "opened" to Firefox, isn't just some basic embedding API, but surely comes with a HUGE Object-Model attached of what is available in the browser to be scripted, and also some Security-Model which the central piece may be a list of running-time limitations and general assumptions.

Lots of fun, I foresee

Blogger Beta is Cool!!!

Much improved, specially template configuration. Anyway I had to edit the template xml-extended html by hand to suit my auto-width-behaviour needs.

Smart Software: Symbolic Links in Vista

Well, it looks like MS is recognizing some *nix strengths, and giving Vista some more 'unixability':

Smart Software: Symbolic Links in Vista


Funny, :)