Strict Evaluation Definition & Meaning

Strict evaluation, also known as eager evaluation, is the evaluation strategy used by most functional programming languages where an expression is evaluated as soon as it is bound to a variable. Strict evaluation is in direct opposition to lazy evaluation, where the evaluation of an expression is delayed until its value is needed. Haskell is the most popular programming language that uses lazy evaluation. Most programming languages use strict evaluation for function arguments (sometimes referred to as parameters) such as Java, Scheme (a Lisp language), and JavaScript.

Using strict evaluation results in code that is easily understandable in terms of execution order, an easier debugging process compared to other evaluation strategies, and the responsibility for code performance being shifted to the programmer, meaning a careful code optimization process is required.

Evaluation strategies in programming

Evaluation strategies are used in programming languages to determine when to evaluate the arguments of a function call and what kind of value to pass to the function. There are many evaluation strategies, but most fall under one of two umbrella categories: Strict and lazy evaluation.

Strict evaluation strategies

  • Call-by-value: The most common evaluation strategy that consists of copying the content of the actual parameters into the formal parameters. If the function is able to assign values to its parameters, only its local variable is assigned, meaning anything passed into a function call is unchanged. Call-by-value is not a single evaluation strategy but rather a family in which a function’s arguments is evaluated before being passed to the function. Programming languages such as C, Eiffel, and Common Lisp use a call-by-value strategy.
  • Call-by-reference: Another common strategy. Whereas the call-by-value strategy copies the content of the actual parameter to the formal parameter, a call-by-reference strategy copies the address of the actual parameter to the formal one. A function receives an implicit reference to a variable used as an argument rather than a copy of its value. C++ uses the call-by-reference strategy.

Lazy evaluation strategies

  • Normal order: An expression is evaluated by repeatedly evaluating the left-most, outer-most reducible expression first.
  • Call-by-name: The actual parameter is only evaluated if used inside the function. If a parameter is not used in the function body, it is never evaluated. If it is used several times, it’s re-evaluated each time it appears.
  • Call-by-macro-expansion: Similar to call-by-name but avoids substitution. Provides developers with a mechanism to add new syntax to the core language grammar known as macros. Macros are expanded into code by a macro preprocessor.
  • Call-by-need: A parameter is evaluated only if it’s used. Once the first evaluation happens, the result is cached, so further uses of the parameter don’t require re-evaluation.






Abby Dykes
Abby Dykes
Abby Dykes is a newly-graduated writer and editor for websites such as TechnologyAdvice.com, Webopedia.com, and Project-Management.com. When she’s not writing about technology, she enjoys giving too many treats to her dog and coaching part-time at her local gym.

Top Articles

Huge List Of Texting and Online Chat Abbreviations

From A3 to ZZZ we list 1,559 text message and online chat abbreviations to help you translate and understand today's texting lingo. Includes Top...

How To Create A Desktop Shortcut To A Website

This Webopedia guide will show you how to create a desktop shortcut to a website using Firefox, Chrome or Internet Explorer (IE). Creating a desktop...

The History Of Windows Operating Systems

Microsoft Windows is a family of operating systems. We look at the history of Microsoft's Windows operating systems (Windows OS) from 1985 to present...

Hotmail [Outlook] Email Accounts

  By Vangie Beal Hotmail is one of the first public webmail services that can be accessed from any web browser. Prior to Hotmail and its...

Abacus Definition & Meaning

An abacus, also known as a counting frame, is a mechanical device used...

Legacy Code Definition &...

Legacy code refers to source code that has been inherited from a previous...

Unregulated Power Supply Definition...

An unregulated power supply is a system that transforms input voltage into direct...