Top "Default-value" questions

A default, in computer science, refers to a setting or value automatically assigned to a software application, computer program or device, outside of user intervention.

How to use default value when `null` is given for a nullable function parameter?

In PHP 7.1 when the following function is called: private function doStuff(?int $limit = 999) { } with syntax like so: doStuff(null); the …

php null default-value php-7.1
Kotlin: Can you use named arguments for varargs?

For example, you might have function with a complicated signature and varargs: fun complicated(easy: Boolean = false, hard: Boolean = true, …

function kotlin default-value variadic-functions named-parameters
Default name with OpenFileDialog C#?

I set the default file name is answer_XXXXXX.csv in OpenFileDialog. But it displays like this. The default name "…

c# winforms default-value openfiledialog
Specifying default parameter when calling C++ function

Suppose I have code like this: void f(int a = 0, int b = 0, int c = 0) { //...Some Code... } As you can evidently …

c++ c++11 default-value language-construct
In Python, can I specify a function argument's default in terms of other arguments?

Suppose I have a python function that takes two arguments, but I want the second arg to be optional, with …

python function default-value arguments
In the Wicket DropDownChoice how can you replace "Choose one" to another text

I have a DropDownChoice like below: final DropDownChoice<Term> terms = new DropDownChoice("terms", new Model<Term>(), …

wicket default-value dropdownchoice
is it possible to React.useState(() => {}) in React?

is it possible to use a function as my React Component's state ? example code here: // typescript type OoopsFunction = () => void; …

reactjs typescript default-value react-hooks
Does PHP allow named parameters so that optional arguments can be omitted from function calls?

Is it possible in PHP to specify a named optional parameter when calling a function/method, skipping the ones you …

php default-value optional-parameters named-parameters php-8
Good uses for mutable function argument default values?

It is a common mistake in Python to set a mutable object as the default value of an argument in …

python arguments default-value mutable
C++ variadic template function parameter with default value

I have a function which takes one parameter with a default value. Now I also want it to take a …

c++ c++11 default-value variadic-templates variadic-functions