Concept
What programming structures and memory concepts support reusable code?
"anonymous class a class that is defined “inline” without declaring a named class; typi- cally created because the instance has a single use and there is no reason to create multiple instances. 484 anonymous function a function that has no identifier or name, typically created so that it can be passed as an argument to another function as a callback. 144 call by reference when a variable’s memory address is passed as a parameter to a function, enabling the function to manipulate the contents of the memory address and change the original variable’s value. 142 call by value when a copy of a variable’s value is passed as a parameter to a function; the function has no reference to the original variable and thus changes to the copy inside the function have no effect on the original variable. 140 callback a function or executable unit of code that is passed as an argument to another function with the intention that the function that it is passed to will execute or “call back” the passed function at some point. 144, 366 closure a function with its own environment in which variables exist. 485 concatenation the process of combining two (or more) strings to create a new string by appending one of them to the end of the other. 178 deep copy in contrast to a shallow copy, a deep copy is a copy of an array or other piece of data that is distinct from the original. Changes to one copy do not affect the other. 166, 319, 443, 449, 557 dynamic programming a technique for solving problems that involves iteratively com- puting values to subproblems, storing them in a table so that they can be used to solve larger versions of the problem. 208 dynamic typing a variable whose type can change during runtime based on the value it is assigned. 31, encapsulation the grouping and protection of data together into one logical entity along with the functionality (functions or methods) that act on that data. 30 enumerated type a data type (usually user defined) that consists of a list of named values. 309, 436 function a sequence of program instructions that perform a specific task, packaged as a unit, also known as a subroutine . 133 function overloading the ability to define multiple functions with the same name but with with a different number of or different types of parameters. 145 garbage collection automated memory management in which a garbage collector at- tempts to reclaim memory (garbage) that is no longer being used by a program so that it can be reallocated for other purposes. 165, 383 inheritance an object oriented programming principle that allows you to derive an object from another object, usually to allow for more specificity. 390, 423, 449, 466, 571 immutable an object whose internal state cannot be changed once created, alternatively, one whose internal state cannot be observably changed once created. 390, 423, 449, 466, 571"
Related Ideas
- Why are functions useful in programming?ComputerScienceOne · Functions
- What are the key features of functions in PHP?ComputerScienceOne · Declaring Functions
- What foundational programming terms describe data, code, and computation?ComputerScienceOne · Glossary
- How can functions be assigned to variables and used as callbacks in PHP?ComputerScienceOne · Generalized Rounding
- How can factory functions simplify the creation of structure instances?ComputerScienceOne · Factory Functions
- How can pointers be used to pass variables by reference?ComputerScienceOne · Passing By Reference
- How should a class manage owned collections and avoid shallow copies?ComputerScienceOne · Composition
- How should a copied structure avoid sharing references?ComputerScienceOne · Factory Functions