TheAppleBlog has a great article on why the green button in OS X is broken and needs fixing. To me the bigger annoyance is the red button. Sometimes the red button quits the application other times it just closes the window and leaves the application running. The logic behind the behavior is that if the application only ever has one window, such as System Preferences or Calculator, the red button quits. But if the application can have multiple windows like Microsoft Word or Safari the red button closes the window, but leaves the application running. It sort of makes sense, but unfortunately the logic is so obtuse that the button ends up seeming totally inconsistent. The big problem is the behavior is based on what the program is capable of, not it's current state. Most user don't have a clue which programs can have multiple windows and which cannot, nor should they really care. If I had to guess between iPhoto and iTunes which could have multiple windows, I'd guess iPhoto... and I'd be wrong. It would make much more sense if the behavior of the button were based on the current state of the application, i.e. how many windows the program currently had open.
So what should it do?
If it were up to me, when the red button is clicked for an application's last remaining window, the user would be prompted to quit the application or just close the window. Simple as that. To me this is much more logical and user friendly as the behavior of the button is based not how many windows the program is capable of having open, but how many windows the program current has open. Here's a little mock-up of what the prompt could look like.
So if the application has only one window, it is (by definition) also the application's last remaining window and the behavior would be pretty much the same as it is today. But if a user systematically closes all the windows of an application, he would be prompted to quit the application when he get's to last one which is probably what he was trying to do in the first place. A couple nice side effect of this, is that it would give users the option to close the window for things like System Preferences without quitting it. Also, the prompt clues people in to the fact that on the Mac OS an application can be running even if it doesn't have any windows, a detail that is very easy to miss. Cmd+Q should still quit without a prompt, unless there are unsaved documents, just as it does now. This way longtime Mac users can still use Cmd+Q as they're used to, and longtime Windows users can quit applications by using the little X in the corner as they're used to. And of course Mac newbies won't bog down their system because have a bunch of programs running that they didn't properly quit.
Just One Exception
The only exception to my proposed red button behavior would be for the Finder. Closing the last Finder window shouldn't prompt you to shut down your Mac.