Thursday, May 03, 2007

XmlSerializer wierdness

Using XmlSerializer for transport purposes is in general a bad idea. "Ahead of the curve" teams in the industry who believe in using every new thing that comes out usually get caught in these landmines :).

There are a few reasons for this
  1. You need to expose every field that you want serialized as a public property/field. What a joy to that your object model does not hide anything ;)
  2. XmlSerializer does not work for Dictionaries (who would have a dictionary in their api?)
  3. XmlSerializer does not work for List of lists and some such (rare, but u will sometimes run into this landmine if you try to solve 2 creatively).
  4. You can leak a few dlls (and due to way windows virtual memory works, you will lose atleast 64k of virtual space for every dll) on every serialization attempt if you are not careful (blogged about his before)
  5. Many useful framework classes are not xml serializable (e.g. Regex)
Now that we are fairly convinced that it is a bad idea to use xml serializer for transport, we will decide that it is the right choice for configuration files... more about this in future blogs :)

BTW, the DataContractSerializer with dotnet 3.0 solves all these problems and it is an infinitely better beast.

Wednesday, April 25, 2007

Big company tax

People often wonder why it takes so long for a big company to ship, when a smaller one with much less resources can ship much faster. Is it because big companies hire incompetent people, dont know how to write software or run projects?

From what i have seen, the same software (say a messenger) will take much longer for a big company for the simple reason that much more has to be done to ship software, it is not done when the features are done and tested. Some of the things that small company folks never even think about:
  1. Clustering support
  2. Security reviews
  3. Windows Logo compliance (client and server if you have both)
  4. Legalese and trademark stuff. Oh, you are shipping a sample/demo code called "CatDemo"?? Legal wont approve, so go change all your samples and tests which use it to call it "DogDemo".
  5. Localization support, Does your software support turkish?
  6. Playing well with other products that the company ships. Oh, you mean you do not have an integration story with Office??
  7. Branding and ship vehicles. You are too small, so we will ship you with ProductLarge, so now lets make sure that we have an setup integration story with ProductLarge
  8. Run the million code analysis tools and do a superficial supress of all the crappy warnings that it generates? We dont trust your tests/perf tests to do a good job, we will warn you that you have a performance problem if you do a string catenation
  9. And btw, the next version of OS is shipping while you do this, so please make sure that you run on that too...
  10. and on and on ....
I think doing some of the above results in real $$ (clustering, loc etc), others are just the tax that smaller companies don't see as no one ever bothers to hack their code or sue them for some violation. And not doing it is not an option either[what do you mean, you wont support Vista :) ]

So net effect is that if you 100 hours of usual software work, you have around 200 or more hours of process work. Depending on competency of the folks who run the project, these things will be on radar right from start or turn up as surprises right at the end => more slips and chaos at the end.

This makes it frustrating for a developer at times, but the upside is that you get to work on stuff which small companies can never do [Database, OS, Servers, CLR etc] and have a corresponding larger reach .

Monday, April 16, 2007

Doing less...

I remember an interesting question about some of the microsoft products - how do they load up so fast. The response by a senior guy was unexpected and insightful... "Do less during load, it turns out you can do nothing very fast!"

Not surprisingly, the same attitude - doing less - can be taken to shorten release cycles, improve quality, ship with less resources, have a more balanced life, get time to explore a new field etc.

How many individuals/teams get this right?

Thursday, April 05, 2007

Mobile devices....

One of the cool things about working for a big company like M$ is the breadth of work that you can choose from (there are many uncool things as well and i don't have to mention them :) ).

Last 2 years i worked on the rfid platform for windows. As we go to the next version planning, i am pleasantly surprised by the changes that can happen to my work even without moving teams - we want to do rfid for mobile, rfid for for windows natively etc.. => we get to work on development for mobile devices, on user mode drivers for windows, on the activation services stuff for Longhorn Server etc. all in the same team.

Due to this work change, i think my blogs are going to take a mobile flavor going forward.

Monday, March 05, 2007

Water heals?

Came across this interesting site recently www.newstarget.com. It has interesting articles on how fucked up current medical institutions are (esp in america). India seems to be slightly lagging which came as a big shock to me :); I am sure we will catch up soon.
  1. Does the state own your body?
  2. The Abraham Cherrix cancer story the media won't print
I found something suprising and useful information about water (please dont dismiss this as some random crap before reading :) ):
  1. Healing with water
  2. Interview with Dr B
  3. Dr B's site
I usually drink less than a 1 litre of water a day, so tried fixing it by keeping a bottle nearby and drinking every so often. You actually feel pretty good physically when you have sufficient water in your body! If you have friends who have asthma, please try out and see what happens.