Slashdot Mirror


Six Laws of the New Software

LordFoom writes "Still suffering from post-dotcom stress disorder, I keep my eye out for gentle balm to sooth my ravaged psyche. The manifestos at ChangeThis are not it. The most popular manifestos range from irritating to enlightening, with none of them particularly comforting. In particular the recent Six Laws of the New Software have done my dreams of writing lucrative code no good - although it has changed my idea of what money-making code is."

4 of 313 comments (clear)

  1. In a nutshell by winkydink · · Score: 5, Informative

    Keep it simple
    Keep it small
    You're not gonna be the next Microsoft
    Do many releases
    Comply with relevant standards

    --

    "I'd rather be a lightning rod than a seismometer." -Ken Kesey

  2. Next time I'll check the link better. by Anonymous Coward · · Score: 5, Informative
  3. Hint: How to avoid PDF lock-up in Firefox by QuestionsNotAnswers · · Score: 5, Informative

    Tools | Options | Downloads | Plugins

    Untick PDF.

    Now whenever you click on a PDF link you are prompted if you want to view it in Adobe PDF viewer.

    Works for me!

    --
    Happy moony
  4. Re:Here's another law to add by Leo+McGarry · · Score: 5, Informative

    This old saw needs to die, now. It's completely false to say that "the whole graphics subsystem is built on PDF." That simply isn't so. Let me explain where that came from.

    Back in the olden days, there was this thing called QuickDraw. QuickDraw was pretty incredible. It consisted of a full-featured set of routines for drawing on the screen, and the whole business fit inside something like 32 KB of ROM.

    QuickDraw was based on the idea of pixels. Everything was a pixel. Drawing with QuickDraw was based entirely around pixels.

    Quartz abandoned the idea of pixels in order to give programmers a device- and resolution-independent graphics toolbox. Quartz consists of two parts: a drawing library called Quartz 2D, and a windowing and real-time compositing system originally called Quartz Compositor. A couple years back, Quartz Compositor was re-implemented in GPU code and re-christened Quartz Extreme. (Quartz Compositor still runs on Macs without programmable GPUs.)

    The imaging model used for Quartz 2D was inspired by both Display PostScript and PDF, but it's not the same as either of them. Unlike QuickDraw, where everything was about pixels, in Quartz 2D it's all about paint. Quartz 2D establishes a floating-point coordinate system called a context, and the programmer draws on the context by defining regions and filling them with paint. Internally, everything is represented as a display list, as opposed to a bitmap like in the old days. The display list gets rendered to the screen by Quartz Extreme.

    Because Quartz 2D uses a similar imaging model to PDF's, Quartz 2D display lists can be translated to PDF trivially. The whole business is handled for you. All you have to do is request a Core Graphics PDF context instead of a regular Core Graphics context and draw to it just like you were drawing to a window. Core Graphics is responsible for translating your Quartz 2D display list into PDF.

    So let's be totally clear here: None of the graphics on your Mac are represented internally in PDF format until your program explicitly requests that a display list be saved in PDF format. Internally, everything is a Quartz 2D display list. The computer converts to and from Quartz 2D quickly and easily through the use of some highly optimized Core Graphics code.

    Now, you wanna know why Acrobat is so much slower than Preview? Because Acrobat uses its own PDF interpreter to go from PDF to QuickDraw. This takes a ton of CPU time, compared to going from PDF to a Quartz 2D display list. So Acrobat is both much bigger (because it includes a whole PDF interpreter) and much slower than Preview.

    On Windows or Linux or whatever other incredibly lame operating system you want to consider, a PDF reader is necessarily going to be big and slow, because it's gonna have to translate from PDF into some bitmap format. Old operating systems don't have the advantage of having an internal display-list graphics format that's conceptually similar to PDF, or a hardware-accelerated compositor that's responsible for turning those display lists into pixels. But that still doesn't change the fact that the PDF specification is wide open, and anybody who wants to should be able to write his or her own PDF reader for those old operating systems.

    Incidentally, Quartz 2D used to be notably slower than QuickDraw for doing lots of basic tasks. If you take antialiasing and transparency off the table and just deal with drawing lines, QuickDraw used to kick Quartz 2D's ass. No more, though, because Quartz 2D has recently been rewritten to take advantage of programmable GPUs, just like Quartz Compositor was rewritten and became Quartz Extreme. Now, depending on the kind of GPU you have, Quartz 2D can be anywhere up to 40 times faster than QuickDraw ...and that's with antialiasing and transparency. It's pretty amazing.

    Frankly, it kinda makes me wonder why more people aren't raving about Quartz. I guess it's probably because most people don't unde