Before we read the old article (Which I probably dont agree with any longer), the following wisdom from Andrew Wallace is presented for your increased education:
“ah, yes, until finally your entire program is twenty characters and written in incomprehensible gibberish consisting mostly of punctuation, which is the Brehaut Goal of Functional Programming…”
Feature Presentation
brehaut has been reading WikiWiki again. As a result he has (at least for the mean time) come to the conclusion that a good (although perhaps somewhat bureaucratic) language for general purpose OO development needs the following:
- Interfaces — Actual, formal interfaces as in Java and Objective C.
-
DuckTyping like all of python or obj-c’s
id -
Variables can be declared either with an interface (or set of) or an ‘id’ like interface (preferably just leaving the inferfaces out. Classes are right out.
- This applies to method and function declarations too obviously.
- Functions and methods as real objects (like python)
- NotImplemented method
- Public methods, protected ivars.
- List and Dictionary literals.
- No constructors, only Factories / Factory Functions
The thing here is that objects have classes, but variables conform to interfaces. There is no such thing as a variable of a given class
Things I am thinking about:
No actual subclassing, just tools to composition smarter. not sure if this is too draconian… Certainly, MI is right out. Subclassing smells like it is really just a special case of composition.
An example:
class MyClass(interfaceA, interfaceB) {
member1
member2
member3: expose(interfaceA)
def method1(...) {...}
...
}
In this example, any method is not implemented by MyClass that is part of interfaceA is automatically made to access member3’s implementation. Otherwise it is assumed that MyClasses implementation overrides.
Anonymous objects, this is like the object literal in javascript.
Things that are nice:
- List comprehensions
- Anonymous Functions
- No Semicolons.
Comments?
bah, nobody else cares :P – brehaut
I can mock your abysmal choice of dynamic typing because i know what i’m talking about. You can mock my choise of static typing. It is slightly ifferent of course, because i’m right, and you wrong :D – Ollie {edited by brehaut when he lopped out the preceeding paragraphs}
See Also:
- String Variables Considered Harmful
- Dont Distinguish Between Classes And Interfaces Perhaps i am wrong? hmm
- Limits of Hierarchies
