Stateless functions still deal with state, they just don’t hold onto it. Without state to mutate, a so-called stateless function doesn’t do anything.
In declarative languages, your state is the sum of everything you’ve declared. You don’t query results out of thin air. Computational results logically conclude from everything you set up.
HTML ““has state””, as in it has a DOM, but it doesn’t do anything with it. You don’t mutate the DOM after it’s built, or query the DOM to compute results that weren’t trivially evident from the state you declared.
You can do those things with JavaScript. But all that proves is JavaScript is a programming language, and HTML is just a data format it can interact with.
So, writing stateless functions, or working in declarative languages doesn’t count?
There’s no such thing as a pure functional language. All it would accomplish is warming the CPU up. All such languages store data away at some point.
I didn’t say there is…
Your statement implies it. Having stateless or declarative functions that never store or retrieve data would mean they are pure functions.
Stateless functions still deal with state, they just don’t hold onto it. Without state to mutate, a so-called stateless function doesn’t do anything.
In declarative languages, your state is the sum of everything you’ve declared. You don’t query results out of thin air. Computational results logically conclude from everything you set up.
HTML ““has state””, as in it has a DOM, but it doesn’t do anything with it. You don’t mutate the DOM after it’s built, or query the DOM to compute results that weren’t trivially evident from the state you declared.
You can do those things with JavaScript. But all that proves is JavaScript is a programming language, and HTML is just a data format it can interact with.