Top "Optional-parameters" questions

An optional parameter is one that a caller can include in a call to a function or method, but doesn't have to.

C# 4.0, optional parameters and params do not work together

How can i create a method that has optional parameters and params together? static void Main(string[] args) { TestOptional("A",…

c# .net c#-4.0 params optional-parameters
Any way to specify optional parameter values in PHP?

Let's say I've got a PHP function foo: function foo($firstName = 'john', $lastName = 'doe') { echo $firstName . " " . $lastName; } // foo(); --> …

php function optional-parameters
Does C support optional null parameters?

In Python, I'm used to things like def send_command(command, modifier = None): and then the modifier argument is optional, …

c null optional-parameters function-declaration function-parameter
Possible to have Guid as an optional parameter in asp.net mvc 3 controller action?

I was trying to have an index action on a controller to optionally take a guid like so: public ActionResult …

c# c#-4.0 asp.net-mvc-3 optional-parameters
Are Options and named default arguments like oil and water in a Scala API?

I'm working on a Scala API (for Twilio, by the way) where operations have a pretty large amount of parameters …

scala optional-parameters named-parameters
How can I create an optional DateTime parameter?

I have this function that returns a reference type. Now, this function has two optional parameters both of which are …

c# optional-parameters reference-type
Passing in NULL as a parameter in ES6 does not use the default parameter when one is provided

Is there a known reason why passing in null as a parameter in ES6 does not use the default parameter …

javascript ecmascript-6 optional-parameters
Is there any reason to declare optional parameters in an interface?

You can declare optional parameters in an interface method but implementing classes are not required to declare the parameters as …

c# c#-4.0 optional-parameters
Why optional parameters must appear at the end of the declaration

In all programming languages supporting optional parameters that I have seen there is a imitation that the optional parameters must …

c# java language-agnostic language-design optional-parameters
Method cannot be marked @objc because its result type cannot be represented in Objective-C

am exposing swift API's in Objective-C and the Objective-C runtime. When i add "@objc" before the function throws an error "…

ios objective-c swift optional-parameters objective-c-runtime