Monday, December 26, 2011

Time

Time is a precious and scare resource. I believe time is a stick to measure how important one thing or one person to you. The more time you spend on something, the more important it is to you (maybe unconsciously). But the things that are measured as important to you are not necessary the things that you (consciously) think to be important to you. For most of us, there are something fall into that category; otherwise you would not be complaining about procrastination or time wasting. So? Start spending more time (as in amount) on the things that you consciously, that you want to care about! Initially, just put sheer number of hours on them. Reduce time wasting on unimportant things by spending more time on more important things.

Then there comes the concept of 'deliberate practice'. It is not only pure quantity of time that matters, but quality of the time you spend too. For the things you want to improve, you must do it at a more difficult level, with more concentration (no multitasking) and thought (think about how you can do it better). You are not practice for the sake of spending time, you are practice to learn something new. And, doing is more effective than reading. It does not mean that reading is not important; reading is important as a tools to extend your box of knowledge. But at the end you must be able to turn the knowledge you acquire into action. It only counts when you can produce something of your own. So try to produce something everyday. For a programmer, write some line of code. For an artist, sketch a new piece of drawing.

*On a side note, I should spend more time with my family, especially my sister.

Wednesday, December 14, 2011

Australia Adventure (1): Google Sydney Internship



The first thing I would like to talk about my Australia adventure is the internship at Google Sydney.

Google Sydney is a relatively small office, compared to the size of Google. There are about 500 employees in the office, occupying 3 top floors of the Accenture building near the Darling habour and the casino Star City. There are a lot of engineering teams in the Sydney office: Docs, Maps, Chrome, etc. I was in the Google App Engine team.

My project was a very difficult project; it was one of the toughest projects I have ever done. The difficulty did not only come from the project itself, but came mainly from acquiring necessary knowledge in order to do it. Google love to build their own technology. Actually, they invented a lot of new technologies to foster their development process. They are fascinating. But imagine you was in my shoes, you had to understand the current implementation of the system, which was complicated and not always well documented, while learn 5-6 new advanced things at the same time. You had to design and implement the project using something you did not know, which was different from the thing used currently, which you also did not know. To add to the complication, it required a few new and/or uncommon knowledge that even your host did not know well. The only thing I was familiar with before taking the project was the language, Java.

Although I was always confident of my skill, I was still doubtful if I could complete the project with the remaining time of my internship. In fact, when I started, I only expected that I could finish the back end implementation. At the end I managed to finish not only the back end, but also API and front end presentation of the project. I was totally happy about that.

The project was tough, but it was also a fascinating learning experience. It challenged me not only in technical ability, but also work habit. Given limited timing, I needed to learn to work more efficiently. I learned to keep myself on track by constantly writing down what I need to do. (There were many times what I wrote was "what should I do now?" But even so, it was still helpful to keep me on the topic). I also learned that taking appropriate break was crucial. I would occasionally retreat from the computer, go to a tea drop and lie down there alone, musing about what I was doing. Many times I came back with a clearer understanding of the stuff I just consumed, some few ideas. Sometimes I was still as clueless, but I acknowledged that resting was not enough, that I had to come back and stick to the problem longer. I found that if you were stuck at a problem, it was usually better to take a break, then change the approach to the problem. By the way, strange as it may sound, I am growing detached from my laptop.

When it came to actual code implementation, I realized that code design (code organization) was not trivial. My first trunk of code actually required a lot of changes in design (thanks for my host who suggested me better and better design). It took me several times to get it (kind of) right. The final code was much cleaner in design than the initial code. One lesson I learned was avoiding over design or over generalization. Sometimes it is better to have a very good, clean (and explicit) design for the very specific problem at hand, than a general solutions with multiple levels of abstraction. A more explicit lesson was using class constants to capture things that class need to use. That way, when someone use that class, they do not need to know about the dependencies required to use it in most cases.

Another thing I would like to talk about is testing. Google requires testing extensively. Every functions must be tested. I learned a lot about automated testing throughout the internship. However, I cannot help to think that aggressive testing significantly slow down development time. In fact, I believe I spent around half of the implementation time writing testing code. However, automated testing is still crucial. The question is how much is right? In the context of a start-up, I think product development should be the focus. Automated testing code should be added to the core, frequently used functionality only, or when something is broken several times. Facebook is pretty big already and yet extensive testing is not yet enforced.

There are few other lessons I have learned (or reaffirmed that it was right) as well, such as better estimation of the time needed to complete a task (that is, including sufficient buffering time in the estimation). I have got a better understanding of my skills. Or breaking tasks down to smaller, easier to complete and review changes. Each change should implement one and just one small improvement. If you need to implement a big feature, you may (and should) have a draft CL (diff) to have the view of the big picture, but when write check-in code, break that CL down to multiple small CLs. In Facebook, Google or a big company, it makes it easier to get your changes checked in the code trunk. In a small start-ups, it helps reviewing code easier. By the way, unlike testing, code reviewing should be done even in small company. At least have a glance of what others write..

Lastly, to praise Google, their internal technologies are very awesome and advanced stuff. Despite of their complexity, they are relatively easy to use (well, in most cases).

Now let us talk about social stuff. It was unfortunate that my project did not involve cooperation with lots of other people in the App Engine team. We do chat and joke around a lot during lunch and dinner time though. My colleagues are, generally, nice and geeky. However, it took me longer to get along with the team compared to at Facebook. I guess it is because of the nature of Facebook. We are friends on Facebook and know a lot about others more personally. It gives a higher sense of closeness. People at both companies are smart and friendly though. It led me to believe that I can expect awesome people at any office in both companies (come on, these geeky people are always nice anywhere you go). The more important thing is whether you like (/love) what you are doing or not. Another intern who worked at Intel before confirmed to me that people there are also very nice and fun, but he did not enjoy it totally due to the kind of work there. (Talking about that, I feel that the team could do better at selling me the idea of Google App Engine. For example, why I should work for App Engine instead of Amazon Cloud Computing service? They kinda took it for granted that I would be passionate about GAE. For my main project, however, I immediately realized its importance and/or benefits to developers, so it was not hard to convince myself doing it, despite of its complexity.)

I have also got some taste of working with people in different timezone. But it was not fun (no wonder Facebook resist opening engineering office in different timezone). Your progress could easily be put on hold if you depended on response of people in another half a day away. They only started working when you were out of office! Sometimes I made changes to my work, and had to wait until the next day to receive reply before I could continue doing anything. It was not too bad for me, because I usually had something else to do during the waiting time. However, I did get blocked a few times. It was much worse for another intern friend of mine. He complained to me a lot about how he would do nothing in the afternoon because he had made all his changes in the morning, and had to wait for comments from people in Mountain View office to get back to him first.

There are tons of other benefits working at Google, such as free food, flexible working time, game room, break anytime you want, massage, etc. etc. and etc. They are all awesome but do not need much  discussion.

Overall, the internship was totally worth it. I feel that I have grown tremendously throughout the term. Now, after the two internships at Facebook and Google, I have much better understanding of software development process in real life. My confidence was just leveled up one more time. However, it is also a good reminder of my current ability. I still have yet a lot of things to learn. But I will continue growing =)

Thursday, September 1, 2011

My Facebook Experience!

The internship was an awesome experience. But if I have to say only one thing about it, I would talk about my colleagues there. It was the first time I have seen such genuine and passionate engineers. It sounds weird and prolly corny but I always feel they were very true to themselves. Their actions were always original and suggested a free, happy will. They were kinda transparent and easy to get along. They were helpful to me and treated me really nice. And they never seems to be bothered no matter how much I annoy them haha.

I'd sum it up about them in a sentence from the film "Juno":
"You're, like, the coolest people I've ever met — and you don't even have to try!"
P/S: Just to update since some people still don't know. I'm going to Sydney soon for my Google internship. There won't be NOC afterward and yeah, it's Google Sydney not Google Mountain View.

Friday, May 27, 2011

Just dance [Lady Gaga]

Don't want to be corny but suddenly I feel so grateful to end up at NUS 2 years ago. Since then I've met lots of wonderfully people. Just feel awesome now.

I guess what I tried to say was that no matter what direction our life might lead us to, we will still end up alright. That is, if we adapt a positive view of life. I took 2 gap years to apply for US universities but eventually failed to land on any of them and ended up at NUS. But now I'm happy for that. And I never feel ashamed of failing so hard back then.

Monday, March 7, 2011

Because you're young (?)

Recess week was over for a week already, but I haven't really escaped from the hibernation mode gained after it. Well, the reason for hibernation was not that I slacked too much in the recess week and carried it over, but it was the exact opposite! I was too tired. It was really stressful. The first time I really wanted to slack off and sleep the whole day. Except for 1 day I went for part time job, I spent most of the time in PL1! 2 nights slept there! (And some sleepless night also). We (I have a handful of companions, more on them later) would stick with the computer all the time, occasionally slept for a couple of hours.

Let me tell you, marathon programming is not fun at all. It really kills your nerves. And after long hours of programming, your mind doesn't really think straight. You will occasionally find a silly bug (I always say all bugs are silly) that cost you hours of debugging. Someone would ask why didn't we choose a healthier life style, like taking proper rest. But there's something called deadline!

There is some merit in this comic. The word you hear the most in a programming lab is probably "WTF." In different languages!

Actually, I cannot really blame our (evil) prof (=P) for all the suffering. He's quite evil, indeed. But a huge part of the time I spent there were for extra features! It's written there, clearly, that they are not required. Not required for an A+, not required for a free trip to WWDC. But I wasn't really want to die for an A+, or strongly interested in the free trip (I will be near there anw!). So I really really wondered why I suffered so much for it. Actually I wondered more about my friends. LOL. They were like having lots of extra features by Thursday already, yet on Sunday you still found them camping in the lab! I was actually quite slack compared to them; I only really camped at the lab since Thursday. For them? Some of them stayed in the lab all the way from Monday to Friday! One of my friend (Long) said something like: "I know that I'm not (as) good, so I'm gonna spend more time on it!" Very deliberate! I respect. Another one (Hoang) got a midterm on Monday, so he decided that he would go back on Saturday (he had a lot of extra features already, like different wolf's breathes -- real different breathes, not just different in appearance like most people) and study for his mid term. But Sunday I still found him come back to the lab, continue working on his game! There were something that bugged him and he couldn't stop working on it (yet!).

I did not really ask others for their ultimate reasons, but if they were like me, which is very likely, it would mainly because you wanted to make something decent. Without the extra features, the game wouldn't be really cool. It would not be really a game, even. So you went and implemented some extra features, which brought a long hours of debugging and testing. Besides, you have to fix here and there to fit the new thing in also. Ultimately you literally killed yourself for some cool features you wanted. There's no point to regret, though.

Besides, there is one thing I realized when looking at my friends and myself: once you're stuck at a point, you're not gonna give up easily. It's not really wise sometimes, but it's what happened. There's a certain force that attach you to the code until you eventually solve the problem. I think a bug can be considered a mystery that we have to discover (and solve!), otherwise it's gonna bug us the whole time. It's really funny when it comes to meal time. We would wait for each other to finish the piece we're working on, because no one was willing to stop. But you thought you could cook something up while waiting for others, so started coding something. You couldn't make it, though. By the time others wanted to go, you'd want to work just a little more on your code. And they started to wonder if they could have something done meanwhile... Well, you know the story. It always took 30minutes - 1 hour until we eventually went for meal.

One thing I think it was good for was building relationship (friendship). After so much hours suffering together, I think we really became closer. Everyone would willing to help other to debug their program. I must admit that others' insights are always very helpful! Even critical! Thank to my friends (experience) I saved a lot of time debugging. I hope I helped them a little also. Never forget to ask for others' piece of advice when you're stuck at something; they might know something you don't. (Especially true in this case, because we are all very new to objective-C and iOS).

In the other hand, I think spending too much time on the problem sets wasn't a really good idea. You're gonna go through hell to become stronger, but when you're busy with some assignments, you will not have time to discover other stuff. Besides, you need to have time to ponder and reflect about stuff happened. In this case we didn't have much time to explore ideas for final project. (I can't really blame anyone though). But what really bugged me was that Patrick didn't do anything special / really extra features / outside requirement for his game. He always did, wayy extra actually. And another friend complained that he didn't feel the passion to implement the extra features. He said that it wasn't his idea, and it wasn't very significant to do it anyway, so it didn't really fueled him to die die for it.

P/S: I really think I overdid it this semester when taking 6 modules, one of which is cs3217, and doing part time job, which takes around 10 hours a week. Sometimes I felt like killing myself literally. I need to learn to cope with stress better :-(

P/S2: the title was a little random. It was the first thought come to my mind before writing this, so I will just keep it there.

Friday, February 18, 2011

"I'm feeling lucky!"

Yes! I have finally received (and accepted) internship offer from Google Sydney! It will be from Sep to Dec this year. So my upcoming year will be like this:

- Facebook (CA) Internship May to August.
- Google Sydney Internship Sep to Dec.
- THEN 1 year NOC at SV / Stanford ??

That sounds pretty crazy, don't you agree?

It wasn't very easy. Looking back 2 months everything was pretty crazy! There were so many troubles and uncertainties need to be attended. But I'm glad that I have finally had everything sorted out.

Honestly, I'm not sure if it's the best plan. But it is so exciting that I will not be hesitate to carry it out! Quoted sis Zi, "It's gonna be a challenging year!" (Nam nay nhieu thu thach day!) Whatever it is, I'm gonna face it with an open mind and a determined heart!

"Hãy yêu ngày tới dù quá mệt kiếp người. 
Còn cuộc đời ta cứ vui. 
Dù vắng bóng ai, 
Dù vắng bóng ai."
-- "De gio cuon di" - TCS
(Mac du ko phu hop voi tam trang bai viet lam nhung ma phan nao the hien tam trang trong tgian vua qua =)

Sunday, January 23, 2011

Week 2? Sure or not?

It's hard to believe that we're only in the second week of this semester. I've always stayed back until late at the Mac lab for the last two weekend. This week I spent around 12-14 hours on the problem set. First week it was around 8 hours. I'm not sure how much others are spending on them, but it's not likely to be a lot less than that -- the psets are really long.

I'm not whining though; it is actually very interesting. It has been long I haven't felt I am learning so much about software engineering (and feel excited about it). Yet it's just the second week of school! I'm excited about the remaining 11 weeks (worried at the same time lol).

Objective-C is a very cool programming language. I love the way method can be defined; it's very descriptive and clear. It makes functions pretty intuitive and easy to remember. Property (dot notation) is cool and flexible. I haven't really made (real) use of its features though. Memory management turns out to be not as daunting as it seemed at first. Most of the time we don't really have to care about it because everything is auto-released. (It got me twice though... Never mind, I've understood it better!).

The coolest thing of problem set 2 is actually the testing thing. Never I seen writing unit test can be achieved so easily. And all the tests are automatically run at the compile time! It'll be very convenience for regression test. It encouraged me to do incremental testing and write test case early too! After writing few function(s), I would process to write test for them and start debugging immediately. Haha, I've never tested my program so systematically. I think we can do the same thing (creating testing suites) in Visual Studio, but too bad I didn't know that last semester, and stuck with lots of regression test.

And writing good code is always rewarding. Sometimes I feel excited & impressed when looking at a piece of well written code. Especially when it's mine =)) (sorry for bluffing=P).

By the way, it's a big mistake if I don't mention the awesomeness of the 27'' iMac. Wow. It's really really cool. You're immersed by the really big screen in front of you. It occupied your mind easily. And it's beautiful. You feel very different when you stare at the desktop filled by a great photo (esp, when it's a landscape photo -- you can feel and appreciate the vastness of the scene). My screen is usually divided to host 3 files at a time, it made switching between files no longer a pain. It really helps keep your concentration to a really high level. I'm not really used to it yet though. (and working with the Interface builder was a pain when its windows spread all over the screen, mixing up with other apps easily. (It's suggested to give Interface builder 1 desktop on its own, but we don't have "Spaces" installed). As long as people don't chit chat too much and too loudly, the lab is a perfect place!

Oh and the ipad! It deserves it own post! I will write about it later.

On a side note, I still remember that I'm taking other modules as well. And luckily, the professors are all very funny (humorous) and interesting. Still, I must be more proactive / active / prepared..

So far so good. It's still yet to see if I can survive this semester!

Thursday, January 20, 2011

Practice

A striking thought come to me when I think about the running yesterday, and about practice in general. It was very different from my belief so far.

In doing heavy, harsh practice (or training), one shouldn't have to resort to too much pure willpower to finish it (ie continue because of pure determination, with no interest at all). If one reaches the state that he has lost all his interest, he should continue, but not for too long. He better takes a break soon, have some reflections or so, rather than continue just because he has to complete it! The reason is that if you relied on will power alone, without interest, you might be discouraged to repeat the training in the long run. It's like you win the current round but lose your interest, and lose the big game. Practice should be used to foster interest, not destroy it.

An analogy to this is that you don't want to eat your favorite dish repeatedly for too long. It's gonna become your hate dish. You better have it once in awhile, and the rest of the time your mind will dreaming about having it again!

However, certainly without harsh training you're not gonna be able to improve your skill. Ideally you should exceed your current limit, yet refrain from using up all your willpower. That's knowing you limit and your real limit.

That's tricky. It might not work for me, because if I stopped before I completed the training, I might feel like a loser. Also, I'm not sure how much of it is true, and to what extend or what situation should it be applied. Please feel free to give me your thoughts on this.

Thursday, January 13, 2011

New semester has started!

*.. and it's gonna be really really long!

It's been a long time I haven't written anything. There were a lot of things I wanted to write about. However, you think you need sometimes for reflection after some days. Then after a few days, things became less relevant and you didn't have the urge feeling to write about them anymore.  You probably even forgot about them already.

In fact, that might be an attribute of Martians? I don't mean I'm a Martian but you sure know the analogy between men and Mars, women and Venus. It is said that men has a tendency to solve his problems by himself.  For awhile I tried to express my thoughts about different stuff, but then I still couldn't resist the men's tendency to hide in my cave and think about things on my own. Probably... Actually it's just a lame introduction about that I am taking a writing module named WP2201C Mars and Venus (Mis)Communication. Throughout the semester I will keep blogging the topic in this blog: http://justanearthling.blogspot.com/ Please follow it!

Another module I want to mention is CS3217, iPad Programming. Yes! I've loaned a brand new iPad for the whole semester! Com'on, how cool is that? (Does it sound like any particular person?) I'm planning to blog diligently about the learning experience during the course of the module. (Hopefully more often than how I blogged during CS3216 course). One thing I want to hight light about the course so far is how prof (prof == prof Ben Leong) appreciated writing good documentation. You probably think that it's a waste of time, or you tend to skip it. But it's NOT about you! It's about the ones that have to read and maintain your code. It's about that poor fellow, not you! Give him some mercy. In case you haven't read it, you probably want to read my old blog post about this matter: http://manhhung741.blogspot.com/2010/09/one-day-of-programmer.html. After the experience I've determined to write good comments and documentations of my code. I am carrying it out really seriously!

That's it for today! Stay tuned for more updates.