Why D Needs Attributes (Was: Command-line arguments)

superdan super at dan.org
Fri Jul 4 19:31:41 PDT 2008


Robert Fraser Wrote:

> superdan wrote:
> > narp. getopt is better for 2 reasons. first, if i want to have an option with a dash in it, with getopt you say;
> > 
> > bool showControlChars;
> > getopt(args, "show-control-chars", &showControlChars);
> > 
> > i and you and anyone who's used getopt once knows how to do that. but i have no idea how to do that in c#. there may be some shitty attribute to do so but i have to go check the manual. who wins?
> 
> So, just to be clear, your argument is "I don't understand the C# way, 
> so getopt is better"?

narp you are confused. there must be some option in the c# attributes that tells how to do conversion from dashes to non-dashes. my point was that that needs to be looked up whether or not you are versed in c# proper. with std.getopt you don't need to look that up because the string is distinct from the variable it binds to.

nice try though. one attempt at irony missed, two to go.



More information about the Digitalmars-d mailing list