4 ms·
Many new paradigms can be defined not by what they add, but what they take away. The most obvious example is GOTO. It's a very powerful tool. A GOTO can do any
by actsasbuffoon 12y ago
Many new paradigms can be defined not by what they add, but what they take away.
The most obvious example is GOTO. It's a very powerful tool. A GOTO can do anything you can accomplish with an IF, WHILE, FOR, etc. yet we got rid of it because that incredible flexibility made it hard to reason about. The result was structured programming.
Object orientation can also be looked at as the removal of shared global state. There are multiple definitions of OO, but I like Alan Kay's definition best. He said the two primary principles are encapsulation and message passing. Encapsulation is obviously the one I'm touching on here. Some people include class hierarchies and open recursion in their definition of OO, and those certainly do constitute new functionality, but as I said, I prefer Alan Kay's definition.
Functional programming can be looked at as the removal of mutation. Where once we could create side-effects whenever we pleased, FP tells us that we probably shouldn't. Removing mutation makes it easier to reason about our programs, just like removing GOTO.
Haskell goes even further and removes implicit ordering of execution. Because the language is lazy it probably won't execute your code in the sequence you were expecting. Due to immutability and referential transparency everything works out just fine anyway. This makes certain kinds of algorithm much more performant (Huett zippers come to mind).
Instead of asking what new features we can add to languages, perhaps we should ask what else can be taken away.