HTML5 - the missing manual 2nd edition

Three principle of html5

  1. don’t break the web
    • XHTML 2 broke the Web because it demanded an immediate, dramatic shift in the way web pages were written (and it fail)
    • compatible, support degrade on new element
  2. pave the cowpaths
    • embracing a widely supported but poorly designed feature
    • standardize some common use case
  3. be practical
    • Change base on usage and requirement

Read More

簡評五

怪怪设计论: 抽象无处不在

文章主要帶出以下幾點:

  1. Abstraction 做得好唔好唔係睇同現實有幾相似,係睇有冇抽象到事物嘅必要本質,抽象出黎嘅object易唔易被處理,唔係為用理論而抽象。
  2. 設計必需由數據表現形式出發,而唔係一D OO 嘅design pattern。
  3. 設計時,要係現實世界同電腦系統嘅抽象中平衡
    總括而言,軟件設計時,必需深入了解現實嘅問題,再抽象必要嘅本質,以Data為設計嘅藍圖。Implementation果時,唔可以過度重視現實世界嘅抽象而忽略電腦系統嘅抽象,因為implementation果時係要做大量嘅計算,如果個model唔適合計算,就會做成更多嘅問題。係設計對外嘅interface時,可以多運用OO嘅思想,令到其他人可以更易運用。

15 May 2018

為解決問題而design,而唔係死守 pattern同rules。

  • High level api model from 現實世界
    • as we need to solve business problem, simplify it by abstract business logic
  • Low level api model from 電腦系統 (abstract the system logic)
    • as we need to solve technical problem, we need to simplify the implementation details

21 Oct 2018

睇最後果5個point就得

Read More

HTML and CSS

This is a nice for beginner who don’t have technical background. It is easier to understand and illustrations are beautiful.

It gives a brief overview on how web site work in the beginning. And then explain the HTML tag one by one. It also explain the subtle different between similar HTML tags and attributes.

Read More

Bootstrap 3 implementation demo

Spent almost 2 days on building this page to explain my learning and understanding on Bootstrap 3 implementation. Most of the time spent on thinking how to explain the logic in word.

There are lots of improvement in my writing skills. Although lots of time spent, it does help me to have a deeper understand on the idea.

Learning from Bootstrap 3

Reset script

Different browsers have different default style. To make the user experience consistent among browsers, we have CSS reset script or normalize script. In Bootstrap 3, normalize.less reset the CSS.

HTML accessibility

Web page today have rich UI element. But for blind people, they use screen reader to read the page. They cannot understand image and icon. Bootstrap 3 provide .sr-only and .sr-only-focusable to show content to screen reader without affecting the visual content. .sr-only-focusable appears after the element focused by pressing the ‘tab’ key. Beside the Bootstrap 3 mixin, there are html attribute like aria-label for accessibility.

LESS function

In LESS, class and mixin share the same syntax. To hide the a mixin, we can add an empty parenthesis after the mixin, like .mixin(). This may create some code like .mixin { .mixin() }. It looks redundant, but it is good in design, as the interface and implementation are separated.

Read More

Implementation of Bootstrap 3 - mixins.less

mixins.less contains utilities, components, skins and layout ‘functions’ of LESS.

Utilities Mixins

mixins/hide-text.less

It is used to hide the text in the dom. Why don’t we use display: none or visible: hidden? Because screen reader cannot read it. An issue on GitHub show a use case. Screen reader don’t have OCR and cannot read the text in image, we can put the image in background of an DOM, put the text inside the DOM. So screen reader can read it. To hide the text from other users, we can use the .hide-text mixin.

mixins/opacity.less

It adds IE 8 support on opacity. If we don’t need to suppport IE 8, we can use the opacify directly.

Read More

Implementation of Bootstrap 3 - variables.less

variable.less is the first files to be imported in the entry point of Bootstrap 3 LESS. It declare all variables.

This design of variable.less against the rule of thumb that variable should be declare on use. But after considering the design principle of Bootstrap 3, variables.less is a good design. Let’s discuss why this design is bad at the first glance.

Read More

Review of "the mythical man month" chapter 3

We always heard a small, sharp team of first-class people is better than a big team, but it is difficult to scale. What should we do when a big product need to be built?

The surgical team

The book suggest a surgical team like structure to reduce the communication cost. Only one member cutting away on the problem and other teammates give support to him.

Surgeon

  • Chief programmer
  • Define functional and performance specification
  • Design, code and test program
  • Write documentation
  • Responsible for all codes

Copilot

  • Able to do what ‘surgeon’ do
  • Prevent ‘surgeon’ to make mistake
    • Discuss and evaluate idea and design with ‘surgeon’
    • Reseach alternative design strategies
  • Discuss the functional interface with other teams
  • Know all the code
  • May write code, but he is not responsible for any part of the code

Read More

Review of "the mythical man month" chapter 2

Why it is difficult to estimate the time cost of a software project?

Five reasons

  1. Programmers are optimist, tends to underestimate the time cost.
  2. Having assumption that man and months are interchangeable.
  3. Software managers have less inherent courage and firmness.
  4. Schedule process is poorly monitored. Technique and routine from other engineering does not work in software engineering, programming is some sense in a creativity activity.
  5. When the schedule is lagged behind, more man power is added, which make the situation delay worser.

Why programmers are optimist?

The time cost of debugging and testing cannot be estimated until or after implementation. Programmer usually ignore the time cost of that.

Read More

簡評六

當主管卻不懂交辦,當心「猴子」爬上身

文章將團隊成員分為五種不同層次,最低層次係要等人俾指示,最高就係可以獨立行動,間中做例行報告。要令員工可以獨立行動,需要時間累積信任。

文中仲提及一D指派工作嘅技巧:

  • 要清楚指出工作內容
  • 可運用數字明確指出目標,促進員工思考
  • 盡力說動部屬願意做不樂意的事
    • 最好當然係每個人都做樂意做嘅野。但萬一冇人肯做,都要靠員工去補位
  • 用正確既方法去指派工作,文中提出4種
    1. 直接告訴我你要我做什麼
    2. 我希望你先考慮我的意見,再決定我要做什麼
      • 員工可能想用新方法去解決問題
    3. 我想自己決定要做什麼
      • 員工唔需要監督,係開波之前要搞清楚目標同方向
    4. 大家共同討論、決定之後,我就很樂意去做

仲有三個指派工作嘅大忌

  1. 指派太多工作
  2. 有多過一個人落order
    • 會唔知做邊個task先,影響團隊信任
  3. 把最困難的事,交給最有能力的人
    • 最重要都係cost and benefit,做最有value嘅task

Read More