You are made of the sea and the stars





I happened to saw this on Internet—-

Everyone who terrifies you is sixty-five percent water.

And everyone you love is made of stardust, and I know sometimes

you cannot even breathe deeply, and

the night sky is no home, and

you have cried yourself to sleep enough times

that you are done to your last two percent, but

nothing is infinite,

not even loss.

You are made of the sea and the stars, and one day

you’re going to find yourself again

It’s beautiful. But I have point out there are quite a lot infinite things on this world, e.g., the real numbers, the integers, etc.

The best advertisement for probability

One of my friend recommended an lecture on ted titled “on our mistaken expectations“, which is quite interesting.  The speaker, Dan Gilbert, successfully showed that how ridiculous human can be, when you use probability theory to judge their daily decisions, especially about how to spend their money.  Maybe my professor should recommend it to his students in his next year’s probability course, it will for sure help them at least to remember what expectation is defined.

But I’d say the most interesting part of talk is the Q&A at the end.  One audience argued that, when you evaluate of a decision, how we feel about the decision,  not only the factual consequence, needs to be taken into account, which, ironically, is exactly what Dan suggested in another talk.  And happiness, as far as I can see, is difficult to represent with numbers.

BTW at the very end, he pointed out that imaging about the future can help you to be more prudent.  I happened to know that some computer scientist are using this idea to save money for their retirement.  Just as I often tell friends, “whenever there is a problem, there is a computer scientist to solve it”.

Un poisson froid

L’histoire est d’un homme qui s’ennuie tellement de nourriture à micro-ondes qu’il a décidé de changer sa vie fircement.

C’est un film que je ne comprends pas très bien. Donc je pense je n’ai pasbeaucoup à dire. Tout ce que je peux suggérer, c’est ne pas manger trop avant d’aller le regarder. Parce qu’il ya trop de sang et de cadavre dans le film. Vouspouvez vomir quand vous le ecoutez. Et ne pas le regarder si vous vous sentezunfortable a sens sexuel

BTW, pop-corn salé n’est pas si mauvais que je supposais.

How do you want to die?

I watched “Kill me please” last Tuesday.  It’s unusual that I postponed so long to write a review for a movie I like.  Part of the reason is I have been avoiding to think about it, part of reason is I don’t really know what to say about it.

This movie is an outstanding demonstration of black humor.  When I was watching it, I laughed spontaneously from time to time, but I always felt a bit uncomfortable about my reaction to the more or less miserable and depressing plot.  It seems that I have built my happiness on others’ mournful tragedies, which I’ve been despised for many years.  This feeling kept me away from contemplating the meaning of it most time of last week.

And it’s a movie hard to understand. The main suspense is answered at the end of the movie which might be a main reason it has a score as low as 6.2 on imdb.  Moreover, the behaviors of almost every character are just inexplicable, even if they are dramatically humorous.

But at least the movie made me clear about one thing – If someone asks me, “how do you want to die.”  My answer would be “There are so many things that I haven’t tried yet, I don’t want to die any time soon.”

TDD is hard

I finished Growing Object-Oriented Software Guided by Tests (GOOS) this afternoon. It’ a book that I sincerely hope I would have had the patience to read years ago.  It answers one deceivingly simple question in software development that has bothered me for a long time: How to practice TDD (Test Driven Development)?

When I first heard about the Golden Rule of TDD – “Never write new functionality without a failing test”, I was quite skeptical about it.  But after several years building software a big company, I completely recognized why TDD was so appealing. My company has very strict software development procedures that require lots of meetings and documents before really writing a single line of code.  But there wasn’t even one project that I worked on finally proved these times were not absolutely wasted.  This kind deep frustration made me I realise that it was the effort to try to put the behavior of software completely in documents before writing any code is simply hopeless when it comes to thousands of hours of programming. We simply couldn’t image exactly how the software with size actually works.

TDD has a different view of software development.  Instead of building software with a rigid, predefined blueprint, it thinks software as a plant that could grow big in a naturally, just like a tiny seed could sprout and become a huge tree.  We know it’s going to be tall, strong and beautiful, but we can’t really predicate how exactly it looks like.

I like this idea so much that I more or less tried it in all my following projects, even my ex-girlfriend’s homework, after I finished the classical TDD book, Test Driven by Example.  TDD did help, but I still felt uncomfortable about the final result from time to time.  And I couldn’t really convince my colleagues that it was necessary to write test before writing code.  As I became a senior engineer, I enforced TDD in my team.  However, as soon as I left the company 3 years ago, my former colleagues immediately dropped all those TDD rules and went back to the “write code – manual test” cycle.  But I don’t blame them.  To really benefit from TDD, there are a lot of difficulties to overcome. However, I couldn’t see how to address these problems properly at that time.

TDD was difficult because:

  • The test code often become messy after a while
  • Testing with 3rd party code, like persistence layer, is slow and
  • Refactoring code without certain design principles in mind often lead to chaos even if the size of code
  • Mocking objects are really tedious to
  • Asynchronous code are hard to
  • Tests are too fragile, simple change in requirements could break many test cases
  • Testing straight forward code make programmers feels they are wasting time
  • Direct dependencies (new objects everywhere) makes mocking difficult

These problems are why like the book, GOOS, so much.  It’s full of real experiences of TDD accumulated in the battlefield.  In my work, I’ve met almost all the difficulties this book covers.  And I have to admit that the approaches the author took to deal those problems are indeed better than my rushed solutions.

However the most important thing this book taught me is that while TDD could make better software, that doesn’t come free.  It requires very careful consideration of how to refactoring, great patience to make test code readable and maintainable, and experience to decide what and how to test. It’s not a magic that could summon beautiful codes from the emptiness. It’s a skill and an art like painting that must be learned by hardworking and practicing.

Yes, TDD is hard.  But as far as I can see, it’s still of best choice to coup the monstrous complicity in modern software systems.  If you have strong desire to write clean code as I do, I highly recommend you have a look of the book, Growing Object-Oriented Software Guided by Tests.

What were you like 11 years ago?

I watched Battle Royale tonight.  The movie was first released in 2000, so it was 11 years old now.  Even if time made some plots and lines more or less cliche, it is in large part still an impressive movie.

Why I missed it for 11 years?  I was still in university in 2000.  I was young, stupid, and impulsive, but somehow felt that I was completely different from anyone on this world. So when I heard everyone talking about it, my first instinct was that that’s not my cup of tea.

I was wrong.  It’s a good movie.  I like it just as most people in the cinema do.  Whether this very fact makes me less unique doesn’t really matter.  I had a joyful night.  That’s enough.

BTW, I’m really glad some part of my heart hasn’t really changed for the past decade.  If you ask me what I would do if I were on that island and had only 3 days to live, my answer is the same as 10 years ago – I will try to survive but I won’t hurt anyone even if that means I’m going to die.


Just heard what happened in Norway. This world is more horrible than any film.  It makes me really sad.

Let’s drown every criminal.


(I decided my blogs should be more concise.  By keeping writing blog as easy as possible, I might be willing to continue longer.  This is my first short blog.)

Disclaimer: This is a spoiler.

I just watch Unknown this afternoon.  As a mystery action movie, it’s quite attractive and challenging. I hadn’t found out the truth until 3 minutes before everything was told directly to audience, which I took as a shame, although I had had many guesses most of which were very science-fiction.  However, the writer of the movie seems to like reality more.  At the end of the movie, the man who was awaken from a coma only to find his identity was taken by another man, turned out to be a killer who faked a cover id and planed everything.  However, in a traffic accident, he was drown in the river and lost his memory.  When he woke up, he just thought he was the guy that he fabricated.

Very realistic, isn’t it?

Only one question: How come, a cold blood assassin became a warm-hearted and decent man who risked his own life to save people whom he barely knew?  If that really works, why don’t we just put every criminal in the prison into a taxi and drown them in the water.  If they can survive, they will be born again.  If they are not lucky, who cares?  I bet this approach could save our society billions of dollars spent on keeping crminals in prison.

(I was trying to be sardonic.  So if you think I’m really suggesting what I wrote, I’m really sorry for my English.)