On this page
  1. Declarative & Event-Driven Programming
  2. Contents
  3. Declarative Programming (What, Not How)
  4. Event-Driven & State-Machine Architectures

Declarative & Event-Driven Programming

Prev: Functional Programming | Up: paradigms | Next: algorithms_and_dsa
Rel: SQL, css, DOM Events & Delegation, JS Event Loop
Ref: Wikipedia — Declarative Programming
Tags: #public #prog #programming #paradigms


Contents


Declarative Programming (What, Not How)

Declarative languages specify the desired result or constraint, delegating the execution strategy to an engine or optimizer:


Event-Driven & State-Machine Architectures

In event-driven systems (GUIs, web browsers, network servers), control flow is inverted: an event loop waits for external inputs (clicks, packets, timers) and dispatches registered handlers. Pairing events with an explicit Finite State Machine (FSM) ((current_state, event) -> next_state) eliminates impossible UI or protocol states.

Linked from

Related notes