Thursday, June 23, 2011

OOUIs and Naked Objects

I was reading Erik Naggum's take on so-called "free software", a perspective I agree with entirely. It's interesting to see how his prediction has been borne out. Though I wouldn't go so far as to say "free" software has destroyed inventiveness, since I think C/C++ and lately Java have done more than enough of that. Annihilating inventiveness I mean, not being inventive!

But I agree with him that "free" software is entirely dictatorial and very, very far from free. And I even have a good idea how to remedy this. But that's not the point. The point is that it inspired me to check out the license for GNU Smalltalk since I was planning to maybe use it. Yes it has no GUI but this is a plus for me. No, it has no IDE, but I can get around this by porting from Dolphin. It's either that or Pharo.

The Point

Well, the license to GNU Smalltalk seems sensible, but that's not the point either. The point is that I started reading the documentation for fun. And I found this little gem in it:

The Smalltalk programming language is an object oriented programming language. This means, for one thing, that when programming you are thinking of not only the data that an object contains, but also of the operations available on that object. The object's data representation capabilities and the operations available on the object are “inseparable”;

And that's important because for years I've struggled with what the fuck is a "naked objects" UI framework. I've read about it. I think it's a fantastic idea. And this is an improvement over "OOUI" which I hadn't the faintest clue what the fuck it meant, although it sounded good too.

So I knew what a naked objects framework did, and I had some ideas on how it did it. But I never had an Aha moment and I could never explain in any principled way what it was about or why to have one. Yes, I understood the practical advantages well, but I consider such "understanding" strictly third rate. The pathetic bleating of people who are incapable of understanding anything.

So What Is It?

It turns out it's all very simple. Simple and yet profound. After all, it only took me years and dozens of design iterations to get it. An OOUI is one where representations belong to objects. So in OOP, code belongs to objects. And in OOUIs, representations belong to objects.

Now, this doesn't mean that each object has one and only one representation. That would be as ridiculous as an object having one and only one method. What it does mean is that the farce of "pluggable views" in the MVC (Model View Controller) paradigm is chucked away as so much lying garbage.

The whole notion of pluggable views is a sick joke and a lie. Not just because it's impossible in practice. But because it's not even desirable. Looking through your class hierarchy browser at some class and having not the slightest fucking clue how it represents itself ... this is Not Good.


So anyways, I finally cottoned on to this ridiculously simple insight two days ago. It didn't help at all that the Naked Objects framework written for Java actually fails, totally and utterly, to heed this simple insight.

It also didn't help that so-called OOUIs are nothing of the kind. For one thing, people claim that Smalltalk has an OOUI but anyone who takes a look at Genera knows what a sick lying joke that is. There is no Smalltalk UI with Genera's abilities, and that's a really sad pathetic thing.

I would chalk up my view of OOUIs as an original invention except if Genera's UI is implemented the way I think it is, then it probably has it down. Or at least, that's how I invented it. By trying to imagine how I would implement the functionality I saw in that video of a Lisp Machine.

Now just think about this last paragraph and reflect upon it. An original invention ... replicating 30 year old functionality. There is something seriously wrong with the world when this can be said with a straight face.


Stanislav Datskovskiy said...

No reason to remain guessing how the functionality in Genera was implemented:

Warning: not a quick read...

Anonymous said...

Richard, don't take this badly, but you seem to have some sort of "diagnosis." Maybe AS, maybe HFA. And I'm sure you know it. I'm AS myself, so I'm not picking on you. Just sayin'.

If you haven't read it, you might consider Eric Raymond's "The Cathedral and the Bazaar" regarding "free" software. I was involved with Linux before he was, and I do fully understand what motivated the movement, and I still support it and am involved, but I also recognize the economic implications; making money writing free software isn't easy; I know that all too well personally, and that's far from the only economic issue.

BTW, lawyers have their own dictionary. Seriously. Lay use of such terms means next to nothing in a legal context in some cases, and it was very important legal issues that motivated the free and open software movement. Those are still very important issues, in both good and bad ways.

Objects. Simula was the first. I was involved with that, too. I think you're looking at MVC, at least, too concretely - it's more abstract, and it's very often been confused. The explanation I use is that model-view-controller are structure-appearance-behavior. The original paper didn't even mention "controller", but talked about "activity" instead. And don't try to map it to a modern understanding of OO - it predates that understanding, which has changed, and not in my view for the better.

When the term OO first came into wide use, folks talked about "the pillars of OO." The one that gets left out today - because C++ and Java don't support it - is "dynamic binding." Think message passing, and it was motivated by two application areas: dynamic simulation and user interface development. Objects essentially comprise state and behavior, and the basic issue is how to resolve "names" for those things, and when. So dynamic binding is OO is like "lazy evaluation" in functional programming: delay resolving until it's necessary, but not before. Statically typed languages like C++ and Java resolve at compile time, which is not dynamic binding.

What you call "code" is more abstractly "behavior". What you call "representation" is more abstractly "state", and that maps to "structure" or "model" in MVC.

MVC predates the idea of "design patterns", so it's not fair to judge it in those terms. Heck, it was an internship project, effectively, not meant to be interpreted as broadly as it has been, and that as much as anything is why it's been so confusing.

Real programmers, BTW, don't need IDEs. Just text editors. Especially OS programmers.

But lots of people agree with you about the 30 year thing. That said, I think C and Unix are more important - and long will be - than you apparently do.

Peace out, Richard. Try to be nice. And take your meds. You don't want to hurt yourself or anybody else - at least I would hope not...

Richard Kulisz said...

I'm tempted to erase the preceding comment on the grounds that he refers to Eric S Raymond's piece of crap "the cathedral and the bazaar" as if it's a serious work. And not a piece of fucking crap propaganda that violates Fred Brooks' The Mythical Man Month, exactly as Nikolai Bezroukov accused in A Second Look At The Cathedral And The Bazaar. And Bezroukov doesn't just have vastly superior credentials to that fucking worthless self-masturbatory hack nutball ESR, he also happens to be CORRECT!

In fact, the previous commenter drops the name of that piece of shite propaganda for no reason whatsoever. It's not in line with any point he's trying to make. It's just totally incoherent shite.

And so's his accusation that I have "AS" whatever the fuck that's supposed to mean. My first thought was Anti-Social Personality except the DSM-IV is a fucking joke. All political dissidents and artists apparently have "antisocial" personality. Ugh. My second thought was that HFA stands for High Functioning Autistic, which just proves this fucking moron knows nothing since HFA is a synonym for Asperger's Syndrome with no meaningful difference whatsoever.

Accusing me of it is fucking ludicrous since Autism is a breakdown in concrete synthesis. The difference between low-functioning and high-functioning is that the high-functioning still have ANOTHER cognitive faculty (analysis, logic) which they can rely on whereas the low-functioning have nothing and so they slide into catatonia or vegetable states since their minds aren't capable of absorbing or generating ideas.

In fact, while I'm at it, I'm going to say that psychopaths also seem to have broken synthesis. If my conjecture that there are only two types of synthesis (concrete and abstract) is correct then autistics have broken concrete, 90% of the population has broken abstract, and psychopaths have broken abstract AND broken concrete. You know what's the best part of my conjecture? It fits the statistics pretty well since there's about 1/10th as many autistics as there are psychopaths. Which is in line with 10% of the general population possessing abstract synthesis.

On the other hand, if my conjecture is right then it means that HFAs have some form of synthesis. A capacity I have not witnessed any sign of. This discrepancy can be explained by the notion of residuals. Autistics would thus have a residual amount of abstract synthesis, just enough to not be psychopaths.

The alternative is that there is an unknown third form of synthesis which is broken in psychopath. Or that there exists an unknown third form of cognition. The latter is not even remotely credible. The former isn't very credible either since there is no space left after concrete + abstract. The upshot is that 'Autistics are closely related to Psychopaths' is the most credible conjecture which explains Autism OR Psychopath. And it happens to explain both.

Some people believe that emotions and empathy are some lower more primitive part of the brain. This is the total opposite of the truth as research proves. The more complex the animal, the more complex the emotions. Psychopaths are lower animals, strictly lesser than human beings. And empathy is not some trick, it's a powerful general faculty. The lack of which makes formation of self-identity impossible.

Richard Kulisz said...

The fact it took me 8 paragraphs to refute this lying ignorant son of a bitch's first two paragraphs explains why I'm not going to bother correcting his crap further. A couple glances through the rest of his comment just shows more ignorant lies. I also suspect he's a psychopath and so lying through his teeth about his supposed personal history. (Remember, psychopaths are 10x more prevalent than autistics!)

Regardless, the notion that this pretentious garbage has anything to teach me makes me want to vomit all over him. It's a safe bet that I know 10 times more than he does. And if he is the 60 year old geezer he pretends to be, then I still know twice as much as he does in computer science alone. At half his age. Which makes it ridiculous how eagerly he showcases his pathetic "knowledge". Let alone the smarmy way he thinks he's my superior.

Whoever you are: FUCK YOU.

Oh and: get off my blog!