Cobol now has function pointers :O
OOP the Easy Way
Object-Oriented Programming the Easy Way: a manifesto for reclaiming OOP from three decades of confusion and needless complexity.APPropriate Behaviour
APPosite Concerns
FSF
Cobol now has function pointers :O
Apple noticed there are programmers outside the valley
If my summary sounds cynical, it’s because I’m cynical of the old Apple way where they only hired engineers who wanted to relocate within the shadow of (whatever the big thing in SV is: Stanford now, but probably HP when Apple was younger). I’m excited that they’ll get to hire from a broader range of applicants as they stagger, eyes blinking, into the wide world outside Cupertino.
Sometimes in describing a concept X in one domain, someone will ask “oh, is that like X’?” where X’ is the same concept or a very similar one, expressed in a different domain.
The quick answer is “Yes”, but that permits a range of interpretations from “X and X’ are the same things in different contexts” to “this domain that’s new to me can be thought of by analogy to the thing I already know. For example, what I know as X’ exists, except that they call it X”.
One long answer is “There exists an idea called Meta-X. Both of these domains contain expressions of this idea, but one represents it as X and the other as X'”. But now, possible interpretations include “Meta-X is pure and both X and X’ are tainted”, “Meta-X is some fundamental proposition about the universe”, “Meta-X is some meaningless fiction invented by Graham to sound profound”, “Meta-X is some attempt to conceptually combine two different real things”.
So neither answer is “correct”, and you can’t present information in a way independent of those trying to make use of it.
The next phase in technological convergence will be harder than the last, because it can’t be solved with technology. Last time the devices converged, some phone makers just needed to buy a photoelectric detector, a lens, and licenses for some MP3 patents.
But how can the various tab-sized computers I carry – my bank cards, SIMs, passport, building door card, transport cards, office ID – be integrated, when they mean different things to different people? Technologically, it’s really bad to keep them separate because you can’t just hold a bag of RFID tokens up to a reader and expect the right thing to happen. Socially, it’s really bad to converge them; I can’t imagine my bank, employer, train conductor and government all agreeing to the same terms on identifying me, nor would one company be an acceptable clearing house for all of that so rather than N distinct tokens we’d end up with N tokens you can use Anywhere™*.
Is Social Psychology Biased Against Republicans?
Pretty interesting, and an often unmentioned aspect of diversity (probably because political leaning is supposed to be a secret in democratic countries, if not because it’s usually acceptable to display ingroup/outgroup bias politically). But it’s very relevant in the social sciences, especially if it means that particular political views are more likely to be treated favourably or argued for by researchers.
On receiving a message with a parameter, sometimes an object just reverses the sense of what just happened and sends another message to the parameter object with itself as the parameter of this message. That’s a pretty hard sentence to read, but I couldn’t work out how to rewrite it, so here’s an example. A Smalltalk class might have a method like this:
Object>>#printOn:
printOn:aStream
"Append to the argument, aStream, a sequence of characters
that describes the receiver."
|description|
description := self description.
aStream nextPutAll:description.
I would do this as a matter of design: I can make it clear that I’m messaging one object and using another simply in a supporting role. It takes this:
foo doTheThing.
aStream nextPutAll:foo description.
and turns it into this:
foo doTheThing;
printOn:aStream.
In Objective-C, this pattern has an additional use due to the nil
sink for messages. Imagine formatting a string and appending the result to another string, but if the initial string is nil
then you don’t want to add anything. It might look like this:
if (emailText) {
NSString *quotedString = [NSString stringWithFormat:@"> %@", emailText];
[output appendString:quotedString];
}
because I don’t want the phrase > (null)
to appear in the output. But, with a bit of category magic, we can avoid the condition and make it clear that the email text is the important object.
[[emailText quote] appendTo:output];
I haven’t just hidden the conditional; it never appears. If emailText
is nil
then all the other messages will just get dropped, so neither quote
nor appendTo:
need to test for nil
.
Sometimes, the messages are just flowing the wrong way, and clarity can be gained by reversing the polarity.
[Update: oops! I had read Kent Beck’s “Smalltalk Best Practice Patterns”, and apparently absorbed his Reversing Method pattern. This post is basically a discussion of that pattern, and credit should go to Kent for originally creating it. My addition is the Objective-C specific nil
sink extension. Sorry, Kent.]
Everybody knows that the best way to sound intellectual and demonstrate the superiority of your approach to that thing you do is to wrap it in a fancy-schmancy noun term. This works particularly well with a term that can be expressed as a three-letter acronym, or TLA. In programming we have a whole raft of different [A-Z]DD disciplines, the UML, CRC, and your DBA probably does SQL. It also explains why functional programming has taken so many decades to take hold: FP is 33% less appealing as a mere acronym of two letters (or ATL).
When your term is sufficiently arcane or abstract, you don’t even need to actually do the three-letter nouny thing. Just tell people that what you’re doing is the three-letter nouny thing, and let everybody fill in the gaps. In fact, they’ll probably agree that not only are you doing that thing but then so are they. Soon, everybody will be doing the nouny thing.
So it goes with Object-Oriented Programming. We can construct all sorts of definitions for Object-Oriented Programming the term, so that everybody can get in on this highfalutin concept without having to do anything. The best time to arrange for this wide collection of meanings is as early as possible. Let’s look at August 1981.
The Smalltalk-80 system represents the current state of the object-oriented point of view as it has been reduced to practice by the Xerox Learning Research Group. The Smalltalk-80 system is composed of objects that interact only by sending and receiving messages. The programmer implements a system by describing messages to be sent and describing what happens when messages are received.
(“The Smalltalk-80 System”, Dave Robson and Adele Goldberg, BYTE Volume 6 Number 8 p.36)
SIMULA allows users to create object-oriented systems, but uses the standard data/ procedure-oriented ALGOL language to provide numbers, booleans, basic data structures, and control structures.
(op. cit.)
Instead of two types of entity that represent information and its manipulation independently, an object-oriented system has a single type of entity, the object,
that represents both. Like pieces of data, objects can be manipulated. However, like procedures, objects describe manipulation as well. Information is manipulated by sending a message to the object representing the information.
(“Object-Oriented Software Systems”, Dave Robson, BYTE Volume 6 Number 8 p.78)
The words “object-oriented” mean different things to different people. Although the definition given in this article may exclude systems that should rightfully be called object-oriented, it is a useful abstraction of the idea behind many software systems.
(op. cit., p.74)
To be truly “object-oriented”, a computer system must provide automatic storage management.
(“Design Principles Behind Smalltalk”, Dan Ingalls, BYTE Volume 6 Number 8 p.289)
This suggests a third principle for object-oriented design:
Messages: Computing should be viewed as an intrinsic capability of objects that can be uniformly invoked by sending messages.
[…]In most computer systems, the compiler figures out what kind of number it is and generates code to add 5 to it. This is not good enough for an object-oriented system because the exact kind of number cannot be determined by the compiler[…]
(op. cit., p.290)
An enabling condition for adequate flexibility of a user interface can be stated as an object-oriented principle:
Reactive Principle: Every component accessible to the user should be able to present itself in a meaningful way for observation and manipulation.
(op. cit., p.296)
[note: reactive programming woo]
So, you know what? Whatever you’re doing, it’s probably object-oriented. And whenever I say object-oriented, it may possibly mean whatever your meaning is.
Enough with the subtle allusions of the previous posts. What’s going on here is not right.
It’s not right that I get to pass as a member of the group of people who can work in technology, while others have to justify their very presence in the field.
It’s not right that “looking like me” is a pass to being considered for the best-paid jobs, while “not looking like me” is not.
[that last one took me a long time to understand. To me, it seems like I worked hard to get where I am, but I needed to understand that I was given the opportunity to work at the things I worked at. That all I needed to do was to work at it, not to work at it and convince everyone else that I was eligible to work at it.]
It’s not right that while I get a free pass into various fields of endeavour, others are told that they either slept their way into the field or are groupies or are unfuckable.
Previously, I avoided writing about this stuff because I thought I might get writing about this stuff wrong. Fuck. This. Shit. I’ve got social capital to burn; it’s much easier for me to get another job around this sector than plenty of people who are as good or better than me at doing the work. I might be worried about treading the line between being supportive and getting into trouble, but that’s not as bad as the line women, trans people, non-white people, non-straight people, disabled people have to tread between asking to be considered equally and keeping their jobs have to tread. I have one job: doing my job. I do not have two jobs: doing my job, and convincing people that someone like me should be allowed to do my job. If the cost of equality is giving up my free ride, then I give up my free ride.
The pipeline is not the problem, it leads to a vat of acid. No-one wants to lean in to a vat of acid. (Thanks to Cate Huston for that metaphor, it made a lot of sense to me.)
Our industry is exclusive, and needs to be inclusive. What should you do about this? I don’t know, I’m far from knowledgable. If your position is “I agree with the straight white guy that the world is broken, I should ask the straight white guy how to fix it” then perhaps you are the problem, just as I have been and am the problem.
What should I do about this? First step for me is to listen. To not tell people who are describing their experiences what my experiences are. To avoid thinking about my reply to people, and to think about what they’ve said. To stop looking for holes in arguments and to listen for opportunities to grow. Not just to grow me, but to grow others.
I was told yesterday that entity-relationship diagrams can be OK as high level descriptions of database schemata, but are not appropriate for designing a database. Enough information is missing that they are not able to model the problem.
Could the same be true of layer diagrams? Perhaps they’re OK as stratospheric guides to your software, but not useful for designing that software as too much information is missing.
I don’t think that’s the case, though. Layer diagrams tend to be pretty much interchangeable between systems, so that I can’t really tell which system I’m looking at from the layer cake. Add the difficulty that I probably can’t tell how the layers communicate, and certainly can’t tell how the subsystems within the layers are composed. All I can tell is that you like drawing boxes, but not too many boxes.