9 ms·
The story of round rectangles
- Semiapies 16y agoAn 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.
- swombat 16y agoDepends 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.
- Semiapies 16y agoMost 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.
- mryall 16y ago> 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.
- Semiapies 16y agoIn order: because I think they're harmful, yes, and as I stated, both. Also, I was not personifying the author.
- philwelch 16y agoShowing 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.
- Semiapies 16y agoWell, 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.
- joblessjunkie 16y agoI 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.
- pavlov 16y agoI 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.
- Someone 16y agoI 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.
- toddheasley 16y agoA lot of the best inventions seem obvious after the first person comes up with them. Especially when it comes to code.
- DLWormwood 16y agoI found this in the comments of the posted article’s website: http://news.ycombinator.com/item?id=1637442 http://news.ycombinator.com/item?id=1637442
- allwein 16y agoIt's not that doing rounded rects would be hard, but that doing them really fast would be hard.
- angrycoder 16y agoEverything is trivial in hindsight.
- aycangulez 16y agoI 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".
- Semiapies 16y agoWhat does the importance of rounded rectangles have to do with how satisfying or well-told a story is?
- mryall 16y agoA 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.
- Semiapies 16y agoYou'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.
- mryall 16y agoThe 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.
- avgarrison 16y agoI 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.
- sp332 16y agoFine, here's the source file. http://github.com/jrk/QuickDraw/raw/master/RRects.a 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.
- Jkeg 16y agoBecause everyone understands Assembly?
- sp332 16y agoDon'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).
- HeyLaughingBoy 16y agoShould 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 :-)
- sp332 16y agoHaha, just coincidence :-)
- 16y ago
- andrewf 16y agoI'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.
- Semiapies 16y agoExcept, 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.
- DLWormwood 16y agoThis 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 http://news.ycombinator.com/item?id=1637442
- msie 16y agoBill 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?
- philwelch 16y ago"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 http://folklore.org/StoryView.py?story=Mythical_Man_Year.txt
- mkramlich 16y agoBut 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.
- Luc 16y agoIf you would like to do some archaeology, the QuickDraw source code can be downloaded here: http://www.computerhistory.org/highlights/macpaint/ 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
- paulitex 16y agoI 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.
- wrs 16y agoThe 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.
- powrtoch 16y agoFor 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 http://en.wikipedia.org/wiki/Square_number#Properties
- tonystubblebine 16y agoThe visualization makes it seem obvious. Thanks.
- jacobolus 16y ago> 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)
- barrkel 16y agoIt 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.
- InclinedPlane 16y agohttp://en.wikipedia.org/wiki/Method_of_finite_differences http://en.wikipedia.org/wiki/Method_of_finite_differences
- ck2 16y agoSounds 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
- netdog 16y agoThe "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 http://en.wikipedia.org/wiki/Bresenham_algorithm
- Luc 16y agoThe circle version is here on Wikipedia (it includes the 1+3+5... trick): http://en.wikipedia.org/wiki/Midpoint_circle_algorithm http://en.wikipedia.org/wiki/Midpoint_circle_algorithm Generalized to ellipses: http://homepage.smc.edu/kennedy_john/belipse.pdf http://homepage.smc.edu/kennedy_john/belipse.pdf
- jcl 16y agoHmm... 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 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".
- siglesias 16y agoActually, 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.html http://www.gsb.stanford.edu/news/bmag/sbsm0702/feature_ideas...
- chunkbot 16y agoWe're fitting a lot more into a wooden block than we used to.
- duck 16y agoI wonder if that wooden block had rounded corners?
- megablast 16y agoLove 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).
- robrenaud 16y agoAre 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?
- shasta 16y agoFor 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.
- Someone 16y agoNot in this case. One of the variations must only draw an outline of the shape, and one must allow inversion of the pixels.
- jonknee 16y agoAlmost 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.
- Natsu 16y agoYeah, 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.
- Natsu 16y agoIt'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.
- mkramlich 16y ago
- alex_c 16y agoAmusingly, I'm looking around the room, and the most obvious examples of rounded rectangles are my MacBook, my iPad, and my iPhone.
- mryall 16y agoIf 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.
- barrkel 16y agoSomewhat 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.
- jonknee 16y agoEverytime 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.
- sspencer 16y agoI 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!
- bombs 16y agoIt'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!
- jonknee 16y agoI own it. I still lag on Folklore.
- YahYahYah 16y agoAnother apple cirle-jerk, yay!
- SkyMarshal 16y agoHN 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.
- steamer25 16y agoWe call 'em roundtangles.
- mkramlich 16y agoOnce 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.