Re: Methods, Named Parameters
From: Ignacio Machin \( .NET/ C# MVP \) ("Ignacio)
Date: 12/22/04
- Next message: Ignacio Machin \( .NET/ C# MVP \): "Re: Methods, Named Parameters"
- Previous message: MaSTeR: "Re: Confuesd about abstract class vs interface"
- In reply to: Peter Hardy: "Re: Methods, Named Parameters"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 22 Dec 2004 09:56:30 -0500
Hi,
No always and not for sure, what if you select weirds or not explicit names
for the parameters, then you get nothing from it.
AFAIK the only language that supported this was VB IIRC, and frankly I
never saw it used extensely.
Cheers,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation "Peter Hardy" <pete@nospam.com> wrote in message news:OjMs%23a45EHA.2180@TK2MSFTNGP12.phx.gbl... > Hi Guyz, > > Thanks for the feedback. I find named parameters (hey, I don't choose the > lingo) to be a useful way to document code. > > For example, calling > > ticket = new FormsAuthenticationTicket > ( > version = 1, > name = txtUserName.Text, > issueDate = DateTime.Now, > expiration = DateTime.Now.AddMinutes(30), > isPersistant = false, > userData = "Users", > cookiePath = FormsAuthentication.FormsCookiePath > ); > > says a lot more to anyone reading the code than > > ticket = new FormsAuthenticationTicket > ( > 1, > txtUserName.Text, > DateTime.Now, > DateTime.Now.AddMinutes(30), > false, > "Users", > FormsAuthentication.FormsCookiePath > ); > > I have this sinking feeling I'm gonna have to learn Visual Basic now ... > And > just before Christmas too :( > > Cheers Pete > > "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> > wrote > in message news:OgxIsq25EHA.2592@TK2MSFTNGP09.phx.gbl... >> Hi Peter, >> >> Nop, C# does not support named parameters, only "positional" >> parameters. >> >> Cheers, >> >> -- >> Ignacio Machin, >> ignacio.machin AT dot.state.fl.us >> Florida Department Of Transportation >> >> >> >> "Peter Hardy" <pete@nospam.com> wrote in message >> news:OhM3MK25EHA.960@TK2MSFTNGP10.phx.gbl... >> > Hi Guys, >> > >> > Can I use named parameters in C# Methods. i.e doFoo(fname="do", >> > lname="Foo"); >> > >> > Cheers, Pete >> > >> > >> >> > >
- Next message: Ignacio Machin \( .NET/ C# MVP \): "Re: Methods, Named Parameters"
- Previous message: MaSTeR: "Re: Confuesd about abstract class vs interface"
- In reply to: Peter Hardy: "Re: Methods, Named Parameters"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|