Why is Clojure dynamically typed?

If a program is compiled you can’t change it anymore. This is wrong. In image-based systems, like Lisp (Clojure can be seen as a Lisp dialect) and Smalltalk, you can change the compiled environment. Development in such a language typically means working on a running system, adding and changing function definitions, macro definitions, parameters etc. … Read more

Pitfalls/Disadvantages of Functional Programming [closed]

It’s hard for me to think of many downsides to functional programming. Then again, I am a former chair of the International Conference on Functional Programming, so you may safely assume I am biased. I think the main downsides have to do with isolation and with barriers to entry. Learning to write good functional programs … Read more

Functional programming and non-functional programming

One key feature in a functional language is the concept of first-class functions. The idea is that you can pass functions as parameters to other functions and return them as values. Functional programming involves writing code that does not change state. The primary reason for doing so is so that successive calls to a function … Read more

Are FP and OO orthogonal?

Orthogonality implies that two things are unrelated. It comes from mathematics where it means perpendicular. In common usage it can mean two decisions are unrelated or that one subject is irrelevant when considering another subject. As used here, orthogonal means that one concept doesn’t either imply or exclude the other. The two concepts object oriented … Read more

The difference between Reactive and Functional-Reactive programming

Functional Reactive Programming (FRP) is a specific programming model with a specific semantics. (Actually, there are two variants, which are sometimes called “classic FRP” and “arrow FRP”.) I’ve given a summary in an answer to “What is (functional) reactive programming?”. As I said there, the two key properties for me have always been (a) precise … Read more

How do functional programming languages work?

If functional programming languages cannot save any state, how do they do some simple stuff like reading input from a user (I mean how do they “store” it), or storing any data for that matter? As you gathered, functional programming doesn’t have state—but that doesn’t mean it can’t store data. The difference is that if … Read more

Alternatives to Object-Oriented Programming?

Functional programming is another programming paradigm that is popular, mostly in academics. The best example of a functional programming language is Haskell and Standard ML. The fundamental difference between functional programming and object oriented programming is that you are programming in the sense of data flow instead of control flow. See the presentation Taming Effects … Read more

Mixins vs. Traits

Mixins may contain state, (traditional) traits don’t. Mixins use “implicit conflict resolution”, traits use “explicit conflict resolution” Mixins depends on linearization, traits are flattened. Lecture about traits ad 1. In mixins you can define instance variables. Traits do not allow this. The state must be provided by the composing class (=class using the traits) ad … Read more