UA-5095748-1

Sunday, January 27, 2008

Finally, my identity shows up on the 1st page of Google search.

I admit that I have been vainly trying to get my name on the first page of Google search result ever since I started this blog. When I started this blog, my name showed on Google via LinkedIn around page 10. Over the last few weeks, I have added a bunch of entries to my LinkedIn profile. I link this blog to the profile and vice versa.

Today my Linkedin profile is entry number 2 for "ricky chang" on Google search result (with and without the quotes around the name).

I don't really know what this proves. I have a valid net identity? What's the bigger philosophical question here? I worry about that another day, today I'm number 2.

Why car makers hate me.

I don't actually know if they hate me, but I'm not the typical driver or buyer. I think the car industry would collapse if more people have my experience.

I brought only one car in my life so far. I have been driving my 94 Honda Accord for almost 14 years. I was out of college, working my very first full-time job at Microsoft. The Honda was my first big purchase. I got it brand new and I paid for it all up front. With more than 170,000 miles, the Honda is going great. I still get around 28 mpg. Not bad for a 14 year old year, compares well with some the real world mpg of the Prius.

Thinking back about my purchase decision. Here is the list of my intended consequences.
1) no debt.
2) drive it for at least 10 years.
3) great mileage.
4) family friendly.
5) environment friendly

I'm very happy that my intended consequences were right on the money. However, the best part is that I would be doing the exact the thing for the next car. My budget would be bigger, the meaning of family friendly is not vague notion anymore, and there is a new technology that redefined the meaning of environment friendly. The details would change, but the goals would be the exact the same. With a bit of luck, maybe I can drive my second car another 14 plus years.

The only remaining question is when should I buy a new car? I have came up a simple financial formula to answer that.... in the next blog entry.

Saturday, January 26, 2008

Get a refund for your diamond purchases

This seems to be for real. I spoke with my jeweler, and he's making a claim. Here is the website : https://diamondsclassaction.com/

File an online claim here: https://diamondsclassaction.com/secure/Instructions.aspx?AC=yes

Why not take a few minutes and fill out a claim. The deadline is May 19, 2008 so don't wait too long.

Wednesday, January 23, 2008

Must step through every line of code

The interactive debugger is probably the one of greatest invention for programmer productivity. It's right up there with high level languages, and OO design. You don't realize the importance until you had to give it up. Few years ago, I had to do some very low level C / assembly programming. I'm talking about no RAM, no OS, only 64 8 bit registers for memory, and 4k of ROM. Interactive debugger would have been a dream come true, heck, I would have happy with printf. Instead, I had 8 little flashing LEDs that I had to count. Crazy.

All good developers know that they should execute through every line of code they write. The code is working only when I see it working inside a debugger. Seeing is Believing.

One of my favorite programming practice is to set the breakpoints as I write the code or when I review the code after it's finished. I don't set the breakpoints on every line, however I set it at the beginning of every branch in the code. As each breakpoint kicks in, I verify the code is correct then clear it. After a few execution of the test codes, I visually see all the uncleared breakpoints. Any uncleared breakpoint shows where my test cases are inadequate. How awesome is that!

Using this technique ensures that I have stepped through every line in the code. Uncovered missing test cases. Performed all the positive and negative testing. This is made possible because of a integrated IDE and interactive debugger. Interactive debugger is truly one of the greatest invention for programmers productivity.

Tuesday, January 22, 2008

comments required!

Got a nice feedback the other day from a client. They had a code review of my work and they appreciated the level of comments in the code.

I'm a die hard fan of comments in the code. There are two common arguments against comments in code.
- code should easy to read
- comments becomes out of date to the code (more stuff to maintain)

These arguments has some merit. Code should be easy to read, meaningful variable names, etc. But that's not an excuse for not commenting the code. Good code is not a substitute for good comment. Good comments made good code great.

Comments do become out of date to the code, and it's confusing when the code is different from the comment. Still, it's good information about why the code might once behaved as the comment indicates.

My programming style:
I comment all the functions, decision points, and logical blocks; no need to comment every single line. The important thing to comment is the purpose of the block. The code itself should explain the how the task gets done and comments indicate the intended purpose. It's quite tedious to go back and add comment afterward. It's much easier to write all the comments first then write the code. This extra step helps me to think clearly about the logic of the function and plan out the work that needs to be done. When I write the comment, I'm not concerned about the variable names, structure, efficiency, optimization, memory usage, variable type, or million of little things that a programmer thinks about when coding. The comments focus purely on correctness of the logic.

Saturday, January 12, 2008

p2v is cool

Enough about Quicken and finances for now. Time to talk about something geeky that I did recently that solved a real problem.

My laptop died over the holiday after 3 years of abuse from me. The timing was not bad, there were some great laptop deals floating around. I finally settled on a Toshiba with Microsoft Windows Vista Home Premium pre-installed. My first reaction was to reformat and install XP Pro right away. However, I decided to give Vista a chance before blowing it to bit heaven. My dilemma is now how do I migrate all my applications to Vista when most of the applications were not compatible or untested. Then I came across VMware Converter and VMware Player. The idea is so simple it seems far fetched. I will convert my old laptop physical image to a virtual image then run it inside Vista as a guest OS. At least that was the theory. I was not expecting it to work.

To my great surprise, just about everything worked liked a charm! I borrowed a laptop from a friend, swapped in the my hard drive and booted up. Then I installed VMware Converter my desktop computer, and pointed it to the laptop. The converter worked its magic over the network which took about 4 hrs and created a 30 gig image file. In the meantime, I installed VMware Player on Vista. I copied over the guest OS image on to the new laptop. It boots up and I'm in. It was amazing! It just worked, no configuration, no additional setup, no tweaking, nothing! It just boots. Now, I have my old laptop running inside my new laptop. I used bridged networking for the guest OS. Basically, I have two laptops running off a single hardware. I spend the next few hours testing network connectivity, various applications, etc. I only run into one issue. QuickBook didn't like the change over. The licensing data was lost and wouldn't run. Some kind of copy protection data got lost in the conversion.

I has been running this setup up for about 3 weeks now. Vista has found its place so I will keep it around. The guest OS is running great with only a minor performance hit. I need to upgrade my laptop's hard drive to 7200 rpm to get better performance.

Technology that works. Gotta love that!

Wednesday, January 9, 2008

earthquake insurance

Another friend asked me if I have earthquake insurance and why. I thought that was a very good question too. Definitely, one of those financial education and planning type of question that I like to discuss here.

Here is my reply:

Yes, I buy earthquake insurance for my personal home and but have a high deductible. Here are 3 reasons why..

1) I believe that if you are prepared for the worst then the karmic odds of the worst happening is reduced. In part, I'm just worried. You never know when the next big one is going to hit, but it has been a long time since the last big one in SoCal. I know that the history of earthquake doesn't predict the next one but I can't shake the feeling another one might be around corner.

2) I doubt the math would ever make sense to buy insurance but I can't afford not have the insurance in case the worst happens. Suppose there is a major quake and your house is damaged / destroy. I still owns the mortgage and HELOC, but no place to live and not enough cash reserve to rebuild. I can't get money to rebuild because I can't get a new loan. No house that I can sell. I can't sell the the land to cover the mortgage and HELOC.

At this point, I'm bankrupt. GAME OVER. I'm living on the streets. A likely scenario that my house is only partially damaged in a major earthquake and my deductible is too high to collect. I'm only protected from bankruptcy.

3) I buy because earthquake insurance is expensive. I know that sounds quite silly. The way I look at the situation is that if risk of earthquake is low then the premium would be low. The insurance companies can sell a lot insurance to a lot more people if the premium was lower and they can make more profit. The risk is high therefore the premium cost is high. I believe that insurance company are 100x smarter and 100x the knowledge compared to me. They probably have a team of Ph.D.s running risk models. If there enough competition between various earth insurance companies, then the price should be reflective of the risk. Not like auto insurance where service actually matters to some people because we all regularly deal with auto insurance. The expected service is not a factor in my decision, only premium cost vs. coverage.

On a side note, by the same logic, I buy a small amount of universal life insurance. Death is for SURE and the insurance company for SURE will pay and therefore the premium is very high. On the other hand, 5 or 10 year term insurance is cheap for my age but the odds of me dying in that time frame is very low. I know most people don't recommend universal life insurance but I went against the common logic. (Perhaps an entry for the blog if people are interested.)

In summary, my reasons for buying earthquake insurance: It makes me feel better, protection against bankruptcy, and betting with the house instead of against the house. In my sometime overly active imagination, there is a universal roulette ball rolling and I hope it never lands on the "00" but just in case, I'm covered for the financial worst case scenario.

Saturday, January 5, 2008

Software Architecture Lifespan

Okay, I want to coin this new term.. "Software Architecture Lifespan"

This idea has been in the back of my mind for many years now. I have worked in big companies, startups, and startups that grew into middle-size companies. I have seen lots of software grow and change. It gets tweaked and tweaked and refactored and refactored until it could bear no more then finally, it gets rewritten. I use to think this is bad, that somehow software engineering as a science and discipline has failed. Now, I actually think this is a very useful and practical exercise.

I would now argue that rewrite is not an failure but a sign of maturity in the business and technology. It should be a key requirement for any application development strategy and product roadmap plan. Instead of being a painful business and organizational crisis, it should embraced. One of the software architects job should be to plan for the various major architectural changes and all the rewrites involved.

The technical team should in tendum with the product team to develop a product roadmap and an architectural roadmap. The product roadmap defines a set of functionality and level of performance necessary to achieve a business goal and customer requirements. The architectural roadmap will parallel the product roadmap. This set of features can be easily and efficiently implemented using this set of architecture. As the business and software matures, a new architecture is needed to better manage the new set of functionality and requirements. Each architecture has a fixed lifespan where it's optimal for certain conditions, then it's gracefully put aside and a new generation will step in. Each generation of software will have its own "Software Architecture Lifespan".

Recently, I used this concept in a technical evaluation for a client's software. The client wanted to assess if a rewrite was necessary. Instead of providing direct yes or no, I took their product roadmap to the existing architecture and demonstrated its strength and weakness, and show how the architecture must evolve. This method allowed me to be specific, I can show the architecture has a lifespan of maybe an year then an rewrite would be highly recommended. Since the timefrae is only a year away. They should start planning for the rewrite now so some of the new components can use the new architecture and minimize the future rewrite cost. And we know where the existing architecture is effective, they can still plan for rapid development of new features to keep up with customer demands.

I have another personal example how of this model is useful. The client was an early stage startup with a big business plan. They wanted all these bells and whistles in the software. They wanted this sophisticated J2EE, N-tier architecture that can scale to hundreds of thousands of users. I blunted told them that's silly. I wrote the software using PERL and MySQL in about 3 weeks instead of the 6 to 9 month they budgets for. This was over an year ago, the business is growing nicely but has not even come close to maximize the capacity of the current system. The major advantages of the current system are it's easier to change, and easier to hire people to do the work. I saved them a TON of money.

Thursday, January 3, 2008

search on Google for the title and subtitle of this blog and the results are very surprising.

I just did a search on Google for the subtitle "I am the sum of my decisions and the intended and unintended consequences of the decisions". There is only 1 hit. The Google search the title "sum of my decisions" got 6 hits.

The results was very surprising to me. Only 6 hits for the title and only 1 hit for the subtitle?!? When I created the title and subtitle of this blog, I certainly didn't try to create something unique. I just want to make a statement of personal conviction for my blog. So the fact that there is only one entry is a big and pleasant surprise. The second aspect of the surprise is that Google has already indexed it. I guess since blogger is run by Google, they would indexed it asap, but the turn around seems quite fast to me.

Perhaps as more people start reading this blog, the usage would spread. That would be the best and biggest surprise of all!