Hacker News new | ask | show | jobs
by Someone 832 days ago
> 90s apps used these Windows handle controls and it was not a performance problem.

That depends on the overhead per window. Microsoft Windows could use nested windows because it had separate Graphics objects to store such things as the current drawing pen, its position and the current font to use for drawing (https://learn.microsoft.com/en-us/windows/win32/api/gdiplusg...)

In comparison, on the classic Mac every window had a GrafPort that defined a boundary region, a clipping region, the current pen position, size, drawing pattern, etc.

The Mac could have such heavy-weight window objects because it didn’t nest windows. Instead, each window had a single list of controls that were much lighter-weight.

my gut feeling says separating the drawing state from windows as in MS Windows is the better choice, but I also think having separate entities called “windows” and “controls” as on the Mac is the better choice.

(its documentation is ‘less than stellar’, but it appears GrafPort still exists: https://developer.apple.com/documentation/applicationservice...)

3 comments

> (its documentation is ‘less than stellar’, but it appears GrafPort still exists:

GrafPort is part of QuickDraw, almost all of which was removed in 64-bit macOS. (A handful of QuickDraw functions survive, but they can't actually be used to do drawing, just to manipulate Point/Region/etc data structures.)

From what I understand, this struct/typedef remains in the headers to help with compiling legacy code–but all the APIs which take it as an argument have been removed, so it is essentially a useless vestige.

> my gut feeling says separating the drawing state from windows as in MS Windows is the better choice, but I also think having separate entities called “windows” and “controls” as on the Mac is the better choice.

I like to sum up the difference between Mac and Windows thusly. Probably glossing over a bunch of stuff but still:

* Steve Jobs toured Xerox and came away with an idea, and a fairly shallow one -- the windowed, mouse-driven, document-centric interface. This is what he then had his team implement in the Lisa and Mac. As implementations go, it was really good and it looked good, but it was really procedural Pascal code beneath. (You had to handle window moving and resizing yourself in early Mac OS. There were library functions to help, but you had to code all that into your application's main loop.)

* Microsoft, at right about the same time, was hiring guys out of Xerox PARC itself -- guys like Charles Simonyi -- and they brought with them a whole passel of ideas, not just concerning interfaces but also software design, things like objects and message-passing. That's why Windows could do things like handle the move and resize drag actions, and then just post WM_MOVE or WM_RESIZE to the target window. Windows were objects -- members of classes, even, and could receive messages.

Granted, Windows couldn't run in 128K -- and Jobs would pivot completely with NeXT and deliver an object-oriented desktop based on Smalltalk grafted onto C (Objective-C), but initially it seems Apple were trying to build a cheaper, more user friendly Xerox Star and Microsoft were trying to get as much of the Smalltalk environment as would fit in a PC without requiring devs to learn a new language.

FWIW, Steve agreed with your assessment. One of my favorite Jobs quotes:

I had three or four people who kept bugging me that I ought to get my rear over to Xerox PARC and see what they were doing. And so I finally did. I went over there. And they were very kind and they showed me what they were working on. And they showed me really three things, but I was so blinded by the first one that I didn’t even really see the other two. One of the things they showed me was object-oriented programming. They showed me that, but I didn’t even see that. The other one they showed me was really a network computer system. They had over a hundred Alto computers, all network using email, et cetera, et cetera. I didn’t even see that.

I was so blinded by the first thing they showed me, which was the graphical user interface. I thought it was the best thing I’d ever seen in my life.

One way to describe NeXT is Steve returning to the two things he missed @ Xerox.

I think the tradeoff with the Toolbox is that positioning controls with relative coordinates, and updating views when scrolling etc, is a huge PITA since you have to do it in application code – for example, I'm not aware of many classic Toolbox applications that had bottom window status bars before that required relative positioning. A few early applications just assumed 512x342 fullscreen (i.e. MacPaint.)

On the point of GrafPort still existing – Carbon was insanely backwards source compatible until QuickDraw was deprecated in the transition to 64-bit! [1] Conservatively-written 80s Toolbox code would work with some switching around of headers, and shimming getting/setting members of structs with functions.

[1] https://www.highcaffeinecontent.com/blog/20150124-MPW,-Carbo...

> for example, I'm not aware of many classic Toolbox applications that had bottom window status bar

I think that’s more either because they yet had to be invented or because giving up 16 or so pixels on a screen (the menu bar was 20 pixels high, IIRC) that’s only 342 pixels high wasn’t desirable.

> A few early applications just assumed 512x342 fullscreen (i.e. MacPaint.)

I think MacPaint can be forgiven for that. It was a miracle that it ran on a Mac with 128kB RAM.

An application on that machine had about 28kB free for a program. MacPaint allowed you to edit a 50kB bitmap, double-buffering the screen to avoid flicker, with full undo.

(And yes, paging to floppy disk isn’t fast. It did work, though)