Review of "the mythical man month" chapter 1

Programming is fun and interesting. A lot of people can build functional programs, but only few of them can convert a program into a product or system. Why?

The joys of programming

  • Joy of building things
  • Fascination of watching complex system running
  • Delight to build thing without limitation
  • Excitement to learn new things
  • Pleasure to build useful tool for others

The joy of programming comes from the nature of a software. Software is abstract. You can build anything that you can imagine. You can build a complex software with no limitation, as long as it does not against logic. As the nature the programming is to automate repeated task, in other words, programming task are never repeat. The most excitement on programming is what comes from your imagination can produce visible output and become a useful tool for others.

Read More

Airbnb javascript style guide

I will pick some special rules and some rules i don’t think it is useful here

Objects

Rule 3.4: Define all the properties of an object in one place.

It is my common mistake. Don’t add properties to object once it defined. It is easy for other to miss the properties.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function getKey(k) {
return `a key named ${k}`;
}

// bad
const obj = {
id: 5,
name: 'San Francisco',
};
obj[getKey('enabled')] = true;

// good
const obj = {
id: 5,
name: 'San Francisco',
[getKey('enabled')]: true,
};

Read More

Example of leaky abstraction

Everytime we abstract a layer, some detail will be hidden. When there is some error or bug inside the abstraction layer, only the engineer understand the implementation of abstracted layer can fix it.

Leaky abstraction is a necessary evil, here is some of my own experience.

Github API and npm ‘request’ module

I use npm ‘request’ module to query pull request of a private repo. I use the correct authetication method, but still fail to get data from the API.

Here is the code copy from the example

1
2
3
4
5
6
7
request.get('http://some.server.com/', {
'auth': {
'user': 'username',
'pass': 'password',
'sendImmediately': false
}
});

Read More

Skills for hackathon

After joining angelhack, I identify some useful skill sets for hackathon.

Technology

The mission of developer in hackathon is to make software for presentation.

  • UI and UX is everything, developer should put most effort on it
  • Hardcode everything
    • If it can save development time
    • If it can make the presentation more smooth
      • If the computation is slow, just hardcode it to make it fast.
  • Forget everything about backend
    • Because it cannot be ‘seen’ by judges
  • Learn to use prototype tool and API before hackathon
    • This help us build good looking and ‘functional’ prototype.

Read More

Javascript 中嘅 this, call 同 apply

Javascript lexical functional scope,姐係variable嘅lifespan係一個個function咁計,每當有一個新function,就有一個新嘅scope。
另一個javascript嘅特點係first-class function姐係function可以係一個variable type,個function可以pass入第2個function,或姐一個function return另一個function.E一個特點令javascript好多時都會用到callback function E個pattern.

以上2個特點加埋一齊就會出現一D麻煩。

Read More

SaaS - Software as a slide

今日係參加嘅Angelhack同我想像中嘅Hackathon有好大出入。比起Hackathon,大部份嘅參加者更加似係參加緊Startup比賽。

Hackathon v.s. Startup 比賽

我本來諗住Hackathon係大家有一D有趣嘅問題或諗法,之後一齊討論下可以點樣用technology去解決,之後會起一個prototype出黎做demo。但係唔少人都係business background。佢地D idea都好正路同普通嘅Business idea,參加都主要係揾人幫手implement個prototype。當我地 pitch 完個idea之後,人地第一時間問點賺錢同埋有咩business model。

Read More

The Law of Leaky Abstractions

Abstraction is hiding infomation to simplify a task. In most cases, abstraction is doing well. But in some cases, something inside abstraction layer can go wrong and make the abstraction fail, user have no ideas what is going on as the detail is hidden. The only way to fix it is to check the implementation of the abstracted layer. Therefore, abstraction fail to save us from complexity.

Paradox

Programmers want to make programming easier by providing abstraction, but become a proficient programmer is getting harder. Programmer have to understand all related abstraction layer to solve bugs caused by leaky abstraction. At the end, programmer cannot escape from understand the detail of abstraction layer.

Read More