7 ms·
I got taught a mix of java, CAML, and LISP. But I 'got' java. It's possible this is related to having dabbled with QBasic on a commodore 64, PowerBasic on an I
by rzwitserloot 5y ago
I got taught a mix of java, CAML, and LISP.
But I 'got' java. It's possible this is related to having dabbled with QBasic on a commodore 64, PowerBasic on an IBM-PC, and some x86 assembler, but my classmates without any experience universally just didn't really 'get' CAML or LISP and I kept catching them at thinking up the answer in an iterative way, and then dreading the 'hard part' of figuring out how to re-imagine that as functional.
Even when the exercises were designed specifically to be easy to write and understand in an ML variant.
I think the conclusion is that either society / community at large somehow prepares you for 'the paradigm' of iterative languages (I don't mean the IT world, I mean _all_ of society), or it's just easier to get it and start writing basics, vs. functional.
- rjsw 5y agoLisp isn't a functional language, there isn't any need to refactor an iterative solution to a problem.
- Mikeb85 5y agoLisp is definitely a functional language, even if you can compose functions in such a way to look like an imperative language.
- asdfuiopasdf 5y agoThere are functional Lisps, like Clojure or Shen, plenty of them are unopinionated / multiparadigm, like Emacs, Common Lisps
- Mikeb85 5y agoFunctional programming languages don't mean ML-like. It means based on lambda calculus.
- AnimalMuppet 5y agoThat's a fairly non-standard definition of functional programming, for two reasons. First, it's not the definition most people use for "functional programming". From Wikipedia: > In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that map values to other values, rather than a sequence of imperative statements which update the running state of the program. > In functional programming, functions are treated as first-class citizens, meaning that they can be bound to names (including local identifiers), passed as arguments, and returned from other functions, just as any other data type can. This allows programs to be written in a declarative and composable style, where small functions are combined in a modular manner. Second, aren't all languages based on lambda calculus, if you squint hard enough?
- Mikeb85 5y ago> trees of expressions that map values to other values Literally Lisp.
- AnimalMuppet 5y agoThat one snippet is, yes.
- asdfuiopasdf 5y ago> [Functional programming] is a [what it is], rather than a sequence of imperative statements which update the running state of the program. (defparameter *my-var* 0) (dotimes (i 10) (incf *my-var*)) Couldn't be functional :)
- bodhiandpysics1 5y agoAlso lisp isn't actually based on the lambda calculus (for one thing the lamdba calculus doesn't have recursion!! (besides through the Y combinator). Lisp is also evaluated in a very different way than the lamdbda calculus. Lisp has a syntax to declare function literals which takes its name from the lambda calculus, and you can express the lambda calculus relatively cleanly in lisp (i.e. you can write lambda expressions in syntactic lisp) but that's really the only connection.
- deleted 5y ago[deleted]