English
[1Day-1CS] Declarative Programming

[1Day-1CS] Declarative Programming

1 Day 1CS, A Quick Recap of Declarative Programming

Programming Paradigms

A development methodology that serves to give programmers a perspective on programming.

Declarative vs. Imperative

  • Declarative: a paradigm that focuses on solving for what (What)

  • Imperative: a paradigm that focuses on how to solve (How)

Example) Declarative: the address of your house (specify exactly where it is) Imperative: the route to the house (showing how to get to the location)

Types of Declarative Programming

Functional Programming

  • A programming paradigm that implements logic by stacking small pure functions like blocks, and higher-order functions for greater reusability.
  • Pure functions: A function whose output depends only on its input.

  • Higher-order functions: Functions that take parameters as values to generate logic.

Higher-order functions can be used if the language is First Class Object.

  • Characteristics of First Class Objects

  • Functions can be assigned to variables or methods

  • Can contain functions as parameters inside functions

  • Functions can return functions

댓글 작성

게시글에 대한 의견을 남겨 주세요.

댓글 0