3 ms·
> It's useless to categorize things as imperative or declarative without defining those words. Yes because his use of the terms "imperative" and "declarative"
by craigching 12y ago
> It's useless to categorize things as imperative or declarative without defining those words.
Yes because his use of the terms "imperative" and "declarative" are not the way I generally use them. When talking languages, I always thought you had imperative, functional, and declarative. Clojure is functional because of it's use of concepts like "functions are first order objects", closure, higher order functions, etc. I would never consider Clojure imperative.
EDIT: Possibly with the use of core.logic you could argue that it is "declarative" if you wanted to ;)
- MonkeyIsNull 12y ago> Clojure is functional because of it's use of concepts like "functions are first order objects", closure, higher order functions, etc. I would never consider Clojure imperative. I would agree with that. Putting Clojure in the imperative camp seems a little skewed. From the front page of clojure.org "Clojure is predominantly a functional programming language, and features a rich set of immutable, persistent data structures." But I don't think that's his point as seancorfield pointed out.
- cygx 12y ago> I always thought you had imperative, functional, and declarative That's not how I see it (but of course this largely depends on your definitions). The main paradigms are imperative and declarative (think Assembler vs. Prolog if you want to go to the extremes). 'Functional' describes the language at a different level, as does 'object-oriented'. If you go down to the core ideas, being functional is a declarative concept (mathematical functions are relations between sets), and object-oriented an imperative concept (objects are an abstraction over mutable state). However, that's not necessarily how these concepts appear in practice (a function call is an instruction to trigger a compuation, the set of messages understood by an object declares its interface), and almost all programming languages are multi-paradigm anyway.