On this page
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:
- SQL: declares which rows and joins you want; the cost-based planner chooses index scans and join algorithms.
- CSS: declares layout and visual rules; the browser engine resolves cascade, layout, and paint.
- Regular Expressions: declare a text pattern; the regex engine compiles an automaton.
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
- tuts/programming/paradigms Linked here; links to this page; shared tags: #paradigms, #prog, #programming
- tuts/programming/paradigms/functional_programming Linked here; links to this page; shared tags: #paradigms, #prog, #programming
- tuts/programming/algorithms_and_dsa Linked here; shared tags: #prog, #programming
- tuts/css Linked here
- tuts/databases/sql Linked here
- tuts/javascript/tutorials/event_loop_and_async_programming Linked here
- tuts/web/dom/events_and_delegation Linked here
- tuts/programming/paradigms/imperative_and_procedural shared tags: #paradigms, #prog, #programming
- tuts/programming/paradigms/object_oriented_programming shared tags: #paradigms, #prog, #programming
- tuts/programming shared tags: #prog, #programming