encyclopegia.org

Named parameter

In computer programming, named parameters, named-parameter arguments, named arguments or keyword arguments refer to a computer language's support for function calls to clearly associate each argument with a given parameter within the function call.

In computer programming, named parameters, named-parameter arguments, named arguments or keyword arguments refer to a computer language's support for function calls to clearly associate each argument with a given parameter within the function call. window.addNewControl("Title", 20, 50, 100, 50, true); Using named parameters in Python, the call can be written as: window.add_new_control(title="Title", x_position=20, y_position=50, width=100, height=50, drawing_now=True) Using named parameters in PHP, the call can be written as: $window->addNewControl(title: "Title", xPosition: 20, yPosition: 50, width: 100, height: 50, drawingNow: true); The version with positional arguments is more implicit. The versions that name parameters are more explicit. Depending on circumstance, a programmer may find one or the other to be easier to read. struct A { int a{}, int b{} }; void foo(A bar) { std::println("A.a = {}, A.b = {}", bar.a, bar.b); } foo({ .a = 1, .b = 3 }); MyFunctionCall( 20, /* x coordinate */ 50, /* y coordinate */ 100, /* width */ 5, /* height */ TRUE /* drawing now? */ ); Such comments are not checked for correctness and the order of arguments remains important. MyFunctionCall({ xPosition: 20, yPosition: 50, width: 100, height: 5, drawingNow: true }); MyFunctionCall({ width: 100, height: 5, xPosition: 20, yPosition: 50, drawingNow: true }); Compare to C99: struct MyParam { int xPosition; int yPosition; int width; int height; unsigned char drawingNow; }; … MyParam parameters = { .xPosition = 20, .yPosition = 50, .width = 100, .height = 5, .drawingNow = TRUE }; MyFunctionCall(&parameters); ==See also== Help:Template for named and positional parameters. Fluent interface Tag (programming) ==References== ==External links== https://web.archive.org/web/20070502112455/http://plg.uwaterloo.ca/~rgesteve/cforall/named_pars.html In C++ this paradigm can be easily implemented: Boost Parameter Library Named Parameters in various programming languages at Rosetta Code

References

No reference rows published for this article.

Cite this article

MLA

"Named parameter." encyclopegia.org, 2026, https://encyclopegia.org/wiki/named-parameter. Accessed 25 November 2026.

Chicago

"Named parameter." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/named-parameter.

APA

encyclopegia.org. (2026). Named parameter. Retrieved November 25, 2026, from https://encyclopegia.org/wiki/named-parameter

Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

head-directionality parameter

stub · references available

Ships named Belvedere

stub · references available

dynamic parameter

stub · references available

list of events named massacres

stub · references available

scale parameter

stub · references available

parameter

stub · references available

musical parameter

stub · references available

Ships named Sanssouci

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1361027741 · 0.5 · snapshot enwiki-001361027741

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.