Monday, August 27, 2007

Nullable type and its usage

During a thought process, I came cross a dilemma between using a Nullable struct and a self-created class. The benefit of using a Nullable struct is obvious: It makes the code look pretty and save a lot of code. However, the main problem is that I need more function than Nullable here. To me, it is a crime to use a precious byte (bool) to store the fact that the object is/not a null. Two reasons here: 1. The code that I am dealing with will be stay at system engine level. Thus, any such criminal wasting of space is questionable. 2. I also need to know the fact if the object is valid or not. This means another precious byte! Keeps on giving spaces at this 8:1 ratio will render the piece into oblivion in no time.
How to address this? There are two ways here, it seems. The first one is to take the matter into my own hands and wrap a generic struct with a byte and the target primitive type in question. This can be an elegant solution but comes without the help of .NET CLR in boxing and unboxing behavior, in addition to the inelegant usage of .value all over the place. The other is to keep the fact outside of the primitive types themselves and maintain them in the declaring class. This solution is even dirtier as it brings the problem of keeping the value and flags in sync (you don't want to get a null in the flag while the value is 1, assuming 1 is a meaningful number).
The best solution would be to inherit from Nullable and be able to manipulate the byte myself. However, .NET would NOT allow you to inherit from a struct. So this is not workable.
Thus, I am trying to simulate the Nullable in your own code.But it doesn't seem to get the same kind of treatment from the compiler. There must be more to it than just implement the implicit Nullable operator and explicit T operator.

Tuesday, August 7, 2007

It is going to be a blood bath out there for ARM loan borrowers

I noticed this on the just posted article from theimbreport.com. The analysis they did on the 2/28 loans originated in the second half of 2004 is nothing short of mind-boggling:
"At reset, the remaining UPB was $291 million with a 30+ day delinquency percentage of 43% on the UPB at reset and 13% on the original UPB. However, as these loans aged an additional six months, a further 47% of these loans paid off (leaving a UPB of only $154 million or 15% of the original UPB) and the delinquency percentage fell to 31% on the UPB at reset and 9% on the original UPB..."
Remember, these loans got reset in Q3 and Q4 of 2006, when the real estate market was at its absolute peak. This means that out of all the 2/28 loans (ARM loans with a two year fixed period), 43% of them are delinquent! And this rate is still 31% 6 months later!
To translate the above into layman's term: If you are a home buyer in late 2004, when the market was STILL not as crazy as 2006, and you chose a nice, low monthly payment ARM loan, then it is highly possible (43% odds) that you will not be able to afford it after the rate is reset.
This is almost a doomsday scenario for any average home buyer. Imagine: Are you going to buy a house if you know 1 out of 2 chances you will not be able to afford it 24 months down the line? Worse, if you can not somehow refinance it or sell it before the monthly payments crashed you, (which is probably the case now a days), then you are looking at bankruptcy in its eyes...
This is just crazy... Am I missing something?...

Monday, August 6, 2007

Interesting article that I totally agree: A Guide to Hiring Programmers: The High Cost of Low Quality

This is a nice article regarding the value of good programmers. They are always under-estimated and poorly treated, as it shows. Of course, as the author, Frank Wiles, pointed out, this is the direct result of employer/employee relationship. So as to say, go your own ways, smart people!

Link: A Guide to Hiring Programmers: The High Cost of Low Quality

A new Monday, a new start

I have being think about starting a personal blog. And today, all of a sudden, I am telling myself: Let's do it...
Actually, it is so easy and so "fashionable" that it may seem like a crime not doing one. But I am also not a "fashionable" guy in myself, far from it. What I want is a place to share the thoughts that have been in my mind for sometime. So I can at least find some ease, instead of thinking about them over and over again... :)
"The challenge, of course, is to keep this blog fresh and attractive." Heck, this blog is just a vent of my thoughts, it doesn't need to be fresh and attractive at all. It just need to reflect what I am thinking. And my thoughts are not always fresh and attractive, to many others.
As you will slowly find out, the name laorient has some pertinent meaning to me. Go ahead and guess all the way...