Archive for August 2008

 
 

Separating content and presentation, my ass

Here’s a test:

Find a couple of good-looking websites. Then take a look at their source code. Can you find one that didn’t mix content and presentation in their (X)HTML?

Fuck. I thought CSS was supposed to fix that, but CSS is so lame that people had to tweak their HTML in order to render properly with CSS. How is the current state of affairs an improvement over old-school HTML that mixed content and presentation?

Last time I’ve seen a fuck-up this bad was with the C++ standard. It seems that the C++ and W3 committees have taken the same path: don’t create a reference implementation, don’t create lots of tests with expected result sets, just write an long document and hope that vendors will get it right.

Impromptu testing from Visual Studio

Oana has a good guide for calling any function from your code from the Visual Studio Immediate Window. As I’m not a fan of unit testing frameworks, I find this approach very appealing.

An added bonus is that I don’t have to install anything that mentions the word "integration" on my laptop. I like integration when done right, but have been burned too many times by software that does it wrong.

Solving the BitTorrent Bandwidth Problem

So the ISPs are bitching about BitTorrent and similar P2P applications hogging their pipes. Here’s what they can do to easily fix their problem:

1. Start supporting IPv6.

2. Allow and route source-specific multicast.

Problem solved.

Now when somebody wants to distribute a large file, and they want to devote, say, 10 Mbps to it, all they need to do is start multicasting their content continuously on a number of ports. One port should multicast at 5 Mbps, one at 2.5, one at 1.25, etc., for all possible receiver speeds.

Whenever the content is fully sent on one of these ports, simply start over and send it again and again. Add some redundancy and error checking to each channel, and you’re done.

It’s easy to to mathematically prove that this is the most efficient manner of sending the same content to multiple users. Way more efficient than BitTorrent and other P2P protocols.

Does this make sense for ISPs? They would lose a hefty chunk of money from companies like Microsoft (think of all the bandwidth they use when they post a service pack for Windows), but last mile ISPs would benefit tremendously. And as long as pirated content outweighs legitimate content and flat subscriptions are the norm for home users this would be a net win for them.

Notes:

1. This makes sense only for distribution of large files wanted for many users. YouTube probably couldn’t use it.

2. IPv4 supports source-specific multicast with IGMPv3, but that has its problems. IPv6 solution, now that it’s supported by all major operating systems, is a superior solution.