Day 57, last day of client project

Worked until 11:30pm. I am a freeman now.

Last couple of steps:

– Remove unnecessary comments

– Remove or disable all console.log()

– Remove unnecessary functions. Even in such a short project, there are major code refactors rendering some code irrelevant. It is sad to have to delete large chunk of working code. Well, someone said, if software engineers are paid to delete code, the world will be in a better place. Let’s hope that is true.

– There are still tons of bugs to fix, so I put all of them under a “known issues” page in the wiki.

We also demoed our personal projects in the evening. Some of them are really impressive, such as the dinosaur game, Felix’s RPG game, the recommendation engine Raccoon, Andrew’s 3d music visualizer, Chris’ Chrome plugin to control browser with a phone, Barry’s application to control multiple client screens with a phone. Very impressive indeed.


Day 54, Thorax 101

Only after using it for three weeks, I begun to understand the differences between Thorax and Backbone

– Thorax automatically fetch model/collection for a view when:

var view = new Thorax.View({
  model: myModel

var view = new Thorax.View({
  collection: myCollection

//Please don't try to fetch again

– “Note that while any view may bind a collection only a CollectionView will actually render a collection. A regular Thorax.View may declare a collection helper which in turn will generate and embed a CollectionView.” This means:

//in your admin.js file
var view = new Application.Views["web/admin"]({
  collection: admin
view.admin = admin; // this is absolutely necessary if view is a regular Thorax.View

//so that you can do this in your template, which is your admin.handlebars
{{#collection admin}}
  {{name}} //name is a property of the model inside the collection

Day 52, getting there

As expected, Larry spent only half a hour to fix the query. The biggest issue is, is, Sunday = 1 in SQL!!! We used JavaScript to convert dates to days and who thought Sunday = 1 in SQL. Lessons learned, certainly the hard way.

Additionally, I spent one hour trying to just submit that query through Sequelize and couldn’t get anything back. I hypothesized that I must have been missing some fields in the schema file, but can’t pin down the problem. In the end, I ended up using node-mysql to get my results back. Sign…

The good news is two of the most complicated queries are up and running, so we now have bandwidth to finish all the other stuff. At this point, it is likely that we will actually be able to finish the project on time.


Day 49, coffee surfing and the secret of happiness

The secret of happiness is imagining BART is going to strike every Monday and you are only told at 10PM Sunday night that, they are actually NOT going to strike. So, you will actually be able to go to work by train tomorrow. Seriously, this is the key to happiness. I think BART finally discovered the solution to Sunday blues and Monday blues.

The f**** BART was going to strike again tomorrow. The carpool was arranged and I even went out and bought a Fastrak. Until 10pm, good news, no strike for at least seven more days!!!! Yeah!!!! The entire house was celebrating and then we realized, this is the secret to a happy life 🙂 Your expectation is so low that you will celebrate for the opportunity to go to work on Mondays.

I did my fair share of working today. Spent an entire day at this place.
Peet’s Coffee & Tea @ Public Market
Address: 5959 Shellmound St #85, Emeryville, CA 94608
Phone:(510) 844-0850

Overall, positive. I paid my cheap coffee rent by buying breakfast with coffee in the morning and another coffee in the afternoon. I hope they don’t mind too much…

Wifi is fast. There are some power outlets. The Public Market has a big food court, and it is just at the back of Peet’s Coffee. Since Public Market has free Wifi too, you should always be able to find a place to sit. Most chairs inside Peet’s were uncomfortable and maybe they did that to keep people from occupying the desk for a long time.

Was fairly productive today. Spent most of my time working on the backend, writing functions to return JSONs for different routes.

I had so much trouble with Sequelize in the last couple days, now everything is just raw SQL queries inside Sequelize. It defeats the purpose of using an ORM, but hey, an ORM can run raw queries, but not the other way around.

With database queries come with callbacks and promises. The q library is neat and makes the code much easier to read.


Day 48, the power of dummy JSON

It is a simple but very powerful idea. Similar to the idea of ghost chart in management consulting, dummy JSON files allow you to set up your API server in hours instead of days.

Assuming you are writing /api/v1/tweets, instead of querying the database and return the correct result, you can just write the expected result in an object, and return the string version of it. For example, just do this in the node app:

var output = [{title:'tweet1'},{title:'tweet2'},{title:'tweet3'}];

The benefits are:
– many API endpoints can be set up in a short period of time
– reduce the uncertainty in the system. Basically, the backend shouldn’t cause any bug. All unexpected behaviors should come from the front end code
– allow parallel working streams. The front end developers can continue to work on the front end, without waiting for the backend.

I regretted that we haven’t thought about this early this week. It would save us so much time. With the help of dummy JSON, I was able to fix bugs in my front end code. When I am producing more backend code, I just remove the dummy JSON with the actual dynamically generated result. This is almost the idea working stream.


Day 47, everyone works on the backend

It was decided that everyone should start working on the backend now, since there are still so much work left on the backend. Client also suggested he could add new members to the team for a week, if necessary. It reminded me of the famous Mythical Man-Month, namely “adding manpower to a late software project makes it later”. I was glad that it was deemed unnecessary to add manpower.

The scope of the project wasn’t crazy, but we definitely made some mistakes. Again, the hindsight is always 20 20. After deciding on MySQL, we should have put more manpower on the backend. Also, the decision of everyone working on the backend should come a couple of days earlier.

Anyway, there is no way that I am going to take anytime off this weekend…. It is exciting to work on the backend too. I have already changed some routes to return the correct results for my front end code.


Day 35, memories

Have to leave all my old friends behind and rejoin the classroom. Now, back to work.

Notes on working on a client project:

Good projects are:
– under promise, over deliver
– many touch points including face-to-face, Skype, email

Bad projects are:
– No communication through out
– Big bang delivery in the end
– No hardstop
– Leaking client information on the blog

Advices are:
– Do NOT skip the regular check-in
– Be transparent about the progress

Before the kick-off meeting:
– Prepare questions

During the kick-off meeting:
– Take notes
– Try getting everything you need to kick off the project
– Try leverage the 30mins or 45mins effeiciently

Possible Questions for the kick-off meeting:

– Fork/pull vs branches
– Ticketing system
– Stack choices
– Web / mobile
– Third party integrations such as Stripe, Twilio or MailChimp

– Types of users
– User stories

– Business model
– Business roadmap