Hacker News new | past | comments | ask | show | jobs | submit login
The story of round rectangles (folklore.org)
195 points by aycangulez on Aug 26, 2010 | hide | past | favorite | 77 comments



Actually, this is a fine lesson in persuasion, something that Chip and Dan Heath point out in Switch and Made to Stick; that is, reasoning that is highly concrete and visual is far more convincing and impactful than appeal to models, forecasts, spreadsheets, and schematics. I think Jobs here could have simply demanded rounded rectangles or appealed to some vague need for geometric completeness in the product, but imagine how powerful it must have been to take a walk outside and actually see how reality presented rounded rectangles at every turn, and how truly crippling the program would feel with this observation in mind if it didn't ship with the feature. The lesson is to reach beyond the world of formal logic and into the visceral world of sight and touch, where the real "aha" and gut judgments reside.

Here's another example, cited in the design and creation of the Palm Pilot:

"Jeff Hawkins, the team leader, wanted the Palm Pilot to be simple. It would handle only four things: calendars, contacts, memos, and task lists, but it would do them well. Hawkins fought feature creep by carrying around a wooden block the size of the Palm. Hawkins would pull out the wooden block to "take notes" during a meeting or "check his calendar" in the hallway. When someone would suggest another feature, Hawkins would pull out the wooden block and ask them where it would fit. Hawkins knew that the core idea of his project needed to be elegance and simplicity. In sharing this core idea, Hawkins and his team used what was, in essence, a visual proverb. The block of wood became a visual reminder to do a few things and do them well."

taken from http://www.gsb.stanford.edu/news/bmag/sbsm0702/feature_ideas...


You're right; but I think uprooting the persuasion from its source kills it. Steve didn't use that technique because it was persuasive; he used it because that's what he saw. After that calligraph class that connected so deeply, I bet he became aware of curved corners everywhere; and hated that computers rendered everything squarely... so when he saw fast curves, he grabbed it by the neck. When questioned, he probably spluttered "b-b-but look! all around you! can't you see?!" It's not a persuasion technique; but simply sharing the reality he saw.

Uproot it from reality and use it in isolation, and it has no life in it to persuade. Therefore: improve at seeing, not persuading.

(He'd have been more savvy at persuasion techniques if he'd complimented the poor guy first.)


"Steve didn't use that technique because it was persuasive; he used it because that's what he saw."

You can see a lot by just looking.


Nice. Talk about a Yogi Bera-ism!


I wonder if that wooden block had rounded corners?


We're fitting a lot more into a wooden block than we used to.


Love you last example, but of course what made the Palm so useful, and later on the iPhone, was the ability to add or code any application that you wanted. Palm eventually did this, and Apple made it incredibly easy (although 1 year after the first iPhones release).


If you would like to do some archaeology, the QuickDraw source code can be downloaded here: http://www.computerhistory.org/highlights/macpaint/

It's really nicely structured and has lots of comments!

EDIT: The code is in the BumpOval procedure in DrawArc.a


I don't know what I was expecting (C I guess), but upon opening the project it blew me away that it was written entirely in assembly by hand.


The original Mac had a 64K ROM. It's unbelievable what they packed in there. They used a lot of tricks to do it that are only possible in assembly.


The "clever way to do the circle calculation that only used addition and subtraction", which the article attributes to Apple employee Bill Atkinson in 1981, is in fact a variant of the Bresenham algorithm, devised in 1962 by Jack Bresenham at IBM, when Bill was still a kid.

see http://en.wikipedia.org/wiki/Bresenham_algorithm


Hmm... The Wikipedia article for the circle-drawing algorithm indicates that while it uses the same error-accumulation strategy as Bresenham's line-drawing algorithm, it was not actually invented by Bresenham.

http://en.wikipedia.org/wiki/Midpoint_circle_algorithm

I'm not sure how correct this is, as I don't have access to the full text of the papers involved. But it looks like if Bresenham did write the algorithm (and wasn't beaten to it by, say, Pitteway as Wikipedia implies), it wasn't until his 1977 paper, "A linear algorithm for incremental digital display of digital arcs".


The circle version is here on Wikipedia (it includes the 1+3+5... trick): http://en.wikipedia.org/wiki/Midpoint_circle_algorithm

Generalized to ellipses: http://homepage.smc.edu/kennedy_john/belipse.pdf


Bill Atkinson is a programming god. He was such a pioneer in so many areas. He created QuickDraw, MacPaint and Hypercard! Is there nothing he can't do??? I wonder what his background was when he developed Quickdraw. Did he have any previous graphics experience? How much previous experience could you have when you're the one who created the graphic routines powering the Lisa/Mac?


"How many man-years did it take to write QuickDraw?", the Byte magazine reporter asked Steve.

Steve turned to look at Bill. "Bill, how long did you spend writing Quickdraw?"

"Well, I worked on it on and off for four years", Bill replied.

Steve paused for a beat and then turned back to the Byte reporter. "Twenty-four man-years. We invested twenty-four man-years in QuickDraw."

Obviously, Steve figured that one Atkinson year equaled six man years, which may have been a modest estimate.

http://folklore.org/StoryView.py?story=Mythical_Man_Year.txt


But did Bill get 6 men's worth of pay? If the answer is no let that be a lesson to all super-talented/productive hackers out there whether you should strike it out on your man or work for The Man.


Amusingly, I'm looking around the room, and the most obvious examples of rounded rectangles are my MacBook, my iPad, and my iPhone.


If you look a bit further, I'm sure you'll see more. I see chairs, tables, a television, a remote control -- all with rounded corners. So many rounded rectangles, yet I never noticed before I read this article. It's funny how a story like this can change how you look at the world.


Like my Zippo!


We're luck that Steve didn't see dead people otherwise to this day our Macs would be full of ghosts.


Somewhat ironically, the object with sharp edges that annoys me most is my 2G iPod Nano, which, similar to the 4G iPod Nano, has a sharp rim all around both ends. The 2G is basically an extruded rounded rectangle and the 4G is like an extruded oval, in the same way a cylinder is an extruded circle.

I bought the 3G nano, but very seldom use it because the scroll wheel is too small. I didn't buy the 4G precisely because it had the same sharp edge problem as the 2G.


For anyone else whose jaw dropped at "the sum of a sequence of odd numbers is always the next perfect square", Wikipedia has a helpful visualization:

http://en.wikipedia.org/wiki/Square_number#Properties


> anyone else whose jaw dropped

Wait, really? You never worked out in school (or on your own before it ever came up in school) that

  1 + 2 + 3 + ... + n = n * (n + 1) / 2
and likewise that

  2 + 4 + 6 + ... + 2n = n * (n + 1)
and

  1 + 3 + 5 + ... + (2n - 1) = n * n
? (of course, it also comes up geometrically if you start looking at the number of little squares in a big square, and count the next row)


It always struck me as obvious; with a square of n*n, just add n + n (for the two sides) + 1 (for the corner) and you get the next square. 2n+1 progresses 1, 3, 5 etc., plain as day.

What got me thinking about it (at perhaps 11 or 13 or so) was trying to turn it into a way of calculating the square root.



The visualization makes it seem obvious. Thanks.


Sounds like a typical coder's week:

1. accomplish something pretty darn tricky to try to impress the boss/client

2. boss is only impressed for a split second before giving you a harder to accomplish task



I remember a few times creating something incredibly clever, that I thought was not possible, and trying to explain this to my boss. Of course, not being technical, they had no idea what was so special.


An unsatisfying story. The first half of the story is about an algorithm to produce ovals. Then most of the rest is Steve Jobs convincing the guy that rounded rectangles are desirable. Then, without any narrative about this actual central problem (which the guy had no idea how to do when the conversation with Jobs ends), we're told that he just happened to solve it.

EDIT: I find the bouncing up and down of votes for this interesting, particularly the reasons people give for disagreeing.


I disagree. Rounded rectangles are a signature Mac OS user interface feature. Thanks to post-Steve Jobs Apple, there is renewed interest in everyhing Apple, and rounded rectangles are truly everywhere. You would have a hard time finding a popular web site not using them.

What is really interesting in this story is not the algorithm itself, but how Steve Jobs convinced Bill Atkinson by taking a walk outside with him to show how common rounded-corners are in "real-life".


What does the importance of rounded rectangles have to do with how satisfying or well-told a story is?


A story can be satisfying because of its relevance. I think that is the case here. The topic is interesting to developers who want to understand how Apple approaches design, even though the story's structure might have some flaws.


You're misunderstanding my objection.

It does not matter how relevant you find some aspect of this story, it's still poorly told - and this should be especially clear if the focus on the the interaction between Atkinson and Jobs is what you consider key. Half of the story is about details of an algorithm that simply don't matter if the core of the story is Jobs badgering Atkinson into being willing to code rounded rectangles.


The background about the algorithm helps you understand why Bill is reluctant to go back and implement a new different drawing primitive. His reluctance is the reason why Steve needs to work hard at convincing him, which demonstrates the theme of the story.

I agree that it's probably too detailed in the first bit, but I don't see it as a major flaw for a series of articles about the development of the original Macintosh. The intended audience consists of hackers and developers who get intrigued by technical details.


If the first algorithm is worth spending time on, so is the second. If the second isn't, then the first isn't.


A bad story that is relevant, can still be interesting.

A bad story that is about some subject no one cares about, can not.


Depends what you're looking for. This isn't a story about some bit of code. It's a story about someone (Steve Jobs) who knows how to inspire and motivate people, and a practical example of how he inspired this excellent programmer to push beyond what he thought was capable, by getting across exactly why it was so important.


Most of the story isn't about that. If that's the center of the story, then the first half of it is merely going off on a tangent. It's a badly-composed story.

Nor do we need more "I told the programmer we needed this thing he said was problematic and he did it" management just-so stories.


Showing how clever the oval algorithm was gives us the right emotional setup to the conflict--Atkinson is justly proud of his own cleverness until Jobs, almost dismissively, demands even more from him. The central conflict of the story isn't between Atkinson and the problem, it's between Atkinson and Jobs, and the story holds itself to the emotionally salient facts about how that conflict is resolved--the rounded rectangles work and Atkinson is again very proud and happy.

Well, either that or Hertzfeld never got around to learning how roundrects were implemented.

I get your complaint, because that's not the conflict you wanted the story to center around, but given the conflict it does center around, I don't think it's that poorly composed.


Well, I'd rather the story center more firmly around the Atkinson/Jobs conflict or the whole sweep of Atkinson going from clever hack to being convinced about the rounded rectangles to figuring them out as well. I don't need to know the math to appreciate the trickiness of making quick ovals on Lisa hardware, but if we're going into that, I want to know how he worked out the roundrects as well.


> Nor do we need more "I told the programmer we needed this thing he said was problematic and he did it" management just-so stories.

Why would that be? Is this a kind of story you disagree with for some reason? Are you arguing that it's a bad story because it's badly composed or because you don't like the theme?

This story wasn't written by the manager in question, so I also don't see how you can personify the author in the first person in your pseudo-quote.


In order: because I think they're harmful, yes, and as I stated, both.

Also, I was not personifying the author.


I agree...I want to see the algorithm for drawing rounded rectangles! I assume that he was able take his oval rendering code and use it for the corners of the square. Never mind, that would probably still leave the story unsatisfying.


Fine, here's the source file. http://github.com/jrk/QuickDraw/raw/master/RRects.a

Edit: Luc already linked to the source archive in this thread, so I changed my link specifically to the RRects.a file.


Thanks! It's weird that a) Bill Atkinson also used all-caps for his mnemonics, as did I when I grew up on the MC68k; b) how it brings me back to the Amiga (yes, I know this code pre-dates the Amiga, but still).


Because everyone understands Assembly?


Don't worry, 68k assembly is easier to read than x86 assembly. This code is nicely structured and heavily commented. Don Knuth called Atkinson's QuickDraw and MacPaint code some of the best ever written.

Of course, if I'd actually read the code before linking to it, I'd have realized that this file doesn't really answer avgarrison's question because the algorithm is in DrawArc.a (see Luc's post earlier in this thread for an archive with the rest of the files).


Should we take it from your username and the comment about 68k assembly that you've played with the MC68332 a bit or is it just coincidence :-)


Haha, just coincidence :-)


Not sure if you mean to be pointlessly snarky or not, but hearing about his thought process and how he got a quick algorithm for a harder problem to work would have been much more interesting - and from a storytelling POV, would have been much better - than an abrupt "and then he came up with the solution", especially after the long bit on how he generated ovals.


I'm actually endeared by the story being a dump of everything the author witnessed, rather than being carefully engineered (with some stuff expanded on, some stuff dropped) to provoke a particular reaction in the reader.


Except, of course, that it isn't "a dump of everything the author witnessed" without things expanded or or dropped. A big chunk of it is exposition about an algorithm - and not even the one in question.

When you relate events, you inevitably "engineer" them, even if only unconsciously or by your judgement of what's relevant or not. Storytelling is about how to engineer usefully and usually entertainingly, particularly to the people you're telling the story to.


I especially don't buy the idea that Bill Atkinson, after demonstrating fast ellipses, would then claim that rounded rects would be "really hard." Indeed, the enhancement would be trivial.


I think that Atkinson probably thought that roundrects would be a useless addition that would bloat the library. (Remember, the entire Mac OS and applications needed to fit in 128K!)

It's easier to dismiss something as "entirely too hard" than to get into an argument about whether it's worth implementing.


A lot of the best inventions seem obvious after the first person comes up with them. Especially when it comes to code.


I disagree. I think round rects have more edge cases than ovals (such as a 10 pixels high rectangle with corner radii of 8 pixels)

It could also be that he thought it would be too hard because he knew he only had 42 bytes of ROM space to play with.


I found this in the comments of the posted article’s website:

http://news.ycombinator.com/item?id=1637442


It's not that doing rounded rects would be hard, but that doing them really fast would be hard.


Everything is trivial in hindsight.


This story has probably been told repeatedly, and it lost something being written down instead of told…

See the comment I quoted here:

http://news.ycombinator.com/item?id=1637442


Everytime I get linked to a Folklore article I end up hitting next until I look up at the clock and get amazed at how much time has gone by. True hacker stories.


It's also available in book form as Revolution in the Valley: The Insanely Great Story of How the Mac Was Made. It's always better to step away from the computer for a quick, inspirational read!


I own it. I still lag on Folklore.


I did not know this site existed, and now I do. I predict that I will burn through these at a fast rate while my builds are running...

Thanks for more interesting reading material, HN!


Are rounded rectangles actually hard? Isn't it just a matter of placing 4 quarter circles in the right places? If you can draw straight lines and you can draw ovals (and hence, the special case of circles), then you can draw rounded rects, right?


Almost everything is hard when you have 128KB of memory and a CPU that does only 8 MHz. Not to mention having to write in assembly.


Yeah, it's far easier on a CAD machine these days. I added that shape to our AutoLisp function library years ago and it only took me a few minutes, including testing.


It's weird. We haven't sold any of those in months. Today, I had two orders for rounded rectangles at work.

I'm 99.99% sure it's coincidence and confirmation bias, but some part of me wonders if this story played any part. But, if anyone in the southwest bought a window or glass table in that shape today, I might have played a part in doing the CAD.


Luxury! (Scottish accent)

I remember 48KB of memory and 4 MHz, no lowercase, no multi-tasking, only 40 columns text width, the keys were almost painfully hard to press down and you had to pay for all documentation, what little of it anywhere you could find.


From the comments section of the article…

    “At MacHack, when most of the original team was there and
    Andy told this story, Jef Raskin spoke up to say that he
    had told Steve about round rectangles being everywhere,
    and that's what got Steve obsessed about them.

    But what I found interesting was something Bill Atkinson
    said about creating the RoundRect routines. He said they
    turned out to be a lot easier to create than he thought
    they would be. I can't tell you how many times I've
    over-estimated something easy. I think it's something
    inherent in computer work.”


I've had that happen a lot. Something I thought would be very hard turned out to be fairly easy. And vice versa. Happened more when I was younger though. I think with time and experience one's prediction ability evens out a bit.


For the common case of a large rectangle with small radius corners, you can even just draw 3 rectangles and 4 ovals and have a tolerable amount of overlap.


Not in this case. One of the variations must only draw an outline of the shape, and one must allow inversion of the pixels.


HN Feature Request: A cron job that automatically submits and votes to the top of the front page 1 folklore.org story per week (or two weeks?).

Reason: Most of us that have been around a while have read this entire site, more than once usually, but most of the stories there are good enough to keep getting upvoted for any youngsters that haven't discovered it yet. Eg, it's one of the few links that can keep getting reposted over and over, and revoted to the front page over and over, probably till the end of the Internets. So lets just make it a cron job already.


Once again we see Steve's intensity and vision and single-mindedness.

Bill: Who cares?

Steve: Round rectangles.

Bill: Not important.

Steve: Round rectangles.

Bill: They're impossible.

Steve: Round rectangles.

Bill: Okay I'll try to figure out how to do them.

Steve: Okay now send in that Andy guy about that Switcher thing. And bring my checkbook.


We call 'em roundtangles.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: