Friday, 27th May 2005

Endianness and Driving Conventions

We all know that endianness and portability issues matters mosty when we deal with ints, doubles etc. In this day of XML, HTTP which are character based, endianness doesnt matter much does it ?!.Makes one wonder why chip designers didnt come up with a standard, but in the question lies the answer itself, which byte order to choose as the standard.

An interesting analogy is choosing a standard for which side of the road to drive on. Isnt it a pain to car manufacturers that they need to come up to flavors of cars !!!. The issue cant be resolved by standardizing which side of the road to drive on because it just is too late now. (But to my suprise i learn that Sweden actually switched successfully from one side to the other in the late 1960s in order to standardize with the other Scandinavian countries.) But for other countries (not withstanding exceptions such as sweden), similar conversion would be very much impossible and a status quo must exist and the cost of this status quo (although not crippling) will cling to to car manufacturers !!!

Interestingly, as far as I'm aware the notion of "endianness" comes from a book called "Gulliver's Travels", in which there is (at one point) the story of a crushing war between two halves of the kingdom -- those who crack their eggs at the little end, and those who crack their eggs at the big end. This part of the book was about how people pick wars for stupid reasons, and how they should rather fight over the important things. Like how to crack eggs !!!

So if you talk between systems with bytes, or Strings, or Text, or XML, then it doesn't matter what endian-ness you are using. This is probably the best approach when you are developing business applications (db/corporate web work etc) but if its large conversion....when you transmit something like audio, video, or images, you need to think otherwise

Posted by Nikhil on Friday, 27th May 2005 in TechnoBabble

Post a comment