I read this article on reddit and while I thought the author was correct that RSS is really a bad design, I think he missed the real underlying reason why. That reason is that polling is always wrong. Always. Really!
RSS ends up fundamentally being a polling technology. Everyone hits your site saying, â€œhey, you got something new?â€
â€œHow about now?â€
â€œStill nothing, huhâ€
Over and over it asks, never taking a break. What is the appropriate speed at which it asks? 1 hour? 1 second? Who knows.
Itâ€™s not just internet protocols that poll. Polling as a technique is pervasive, hitting every level from the highest to the lowest. Does your OS go out and hit your CD-ROM drive every so often looking for a disc to finally be inserted? Why isnâ€™t there a SCSI command that makes the drive send a command to the computer when a disc is inserted? If there is, why isnâ€™t your OS using it?
What about something simple like the volume slider in your system tray? My friend Jim was using Intelâ€™s PowerTool and discovered the Gnome volume control kept taking the processor out of C3 sleep. Turns out the volume control was waking up constantly and polling ALSA to see if another program had changed the volume behind its back. ALSA even has an API for being notified of the volume change!
Even at the low level of embedded programming there are the same choices. Does your mouseâ€™s microcontroller poll a GPIO to see if youâ€™ve pressed the mouse button, or does the button trigger an interrupt?
Why do people poll?
Thereâ€™s only one reason. Itâ€™s easy. Itâ€™s trivial to wrap your head aroundâ€“You just loop forever, checking for whatever youâ€™re polling for and then sleeping for a little bit. But to do it the right way is more complicatedâ€“you need to have to have some infrastructure. You need a way to register for the event you want, which implies you also need some way of getting called back when your event happens. In some cases (like the mouse button), itâ€™s almost as easy to do it the right way as it is to poll. But others, like the RSS case, itâ€™s much harder.
To do RSS properly youâ€™d need some way of getting events pushed to you. One way would be with email, as that infrastructure already exists. But given the amount of disparate email servers and RSS readers, it might be hard to hook your RSS reader to your email. Or you could simulate a callback by having the server hold the connection open until something happens. But given that the connection will eventually time out, thatâ€™s really just a degenerate way of polling.
Ah, forget it. Letâ€™s just pollâ€¦