"程式員求生指南:關於寫程式的二三事" 感想

文章嘅結構非常清淅,段落標題已經係一個好好嘅小結,冇必要再作總結。

要點

職業道德

Programmer嘅職業道德就係寫D有Quality嘅Code。

行外人可能唔明,Product有冇Quality,Client好易睇得出,冇Quality嘅野好易俾市場圖汰,跟本生存唔到,何來道德?事實上,Software嘅Quality,唔識寫Code嘅人真係會睇唔出。

行外人眼中,淨係睇到你整個UI好唔好睇,D功能用唔用到。其實E D野好多時call個library, copy and paste 下D Code就做到。真正嘅Software Quality係要睇背後個Logic嚴唔嚴謹,結構易唔易Extend。行外人眼中淨係見到一D符號,連D Code咩意思都唔知,點樣明白背後嘅Idea,何來講得出有冇Quality?

正如作者所講,Software 冇一個「外觀」(啱啱講有UI唔代表Software Quality),係一D抽象嘅,只有係實際contribute嘅人先知到個Quality,好多時都係靠自己良心去做。

揾工真係要揾D上司有technical backgound,隊Team注重Code Quality嘅公司。如果老細係行外人,跟本唔識分D Code有冇Quality,好易就升左D亂寫Code交數又識卸膊嘅Programmer。果D幫人地執手尾嘅良心Programmer真係灰左機。

Read More

2 Is Greater Than 1 : Why You Should Learn Multiple Programming Languages

We should set our target to be a software engineer, not a programmer in specific language. Learning another language prove that we are able to work with any language, provide us more opportunity.

What is a good programmer?

  • Don’t try to think like a computer, try to think like a human, then force the computer to think like a human. *

In another words, a good programmer write readable code and can encapsulate abstract programming concept into a simple interface. To achieve this target, we have to understand and use design patterns in a proper way. The first step is to understand how to organize codes, for exmaple when to use if, when to use loop, when to define a method, etc.

Read More

Review of "RSpec vs. Test Unit: How Test Driven Development Works"

When develop a web application, we work in an iterative manner to make code to be deployed as soon as possible. We implement a small feature, test it and make sure it works, and then move on to the next. This is the workflow of test driven development. TDD is a basically repeating write a few line of code and testing.

Manual testing is time consuming, so automated tests are introduced. Besides automated test is really useful in a big team. It help us to prevent to break other feature you don’t know. It is common to have feature you don’t know because the code base is too large for one developer to understand every detail. Automated tests help us to detect error during development. Fixing a bug during development is much easier, because every detail is in our brain. Automated test prevent our feature broken by others, saving us from undoing the feature in the future.

Read More

Mean vs Median

To give an overview of a set of number, we can use mean or median. When to use mean and when to use median?

We can get the sum of numbers from mean, but not median. If we need the total value, mean is a good choice. If you want to eliminate the effect of some extrem value, we may use median. If we only care the overview of a set of number, median is also a good choice.

Read More

Is code reusing always good?

Everytime we need a new feature, code need to be added. Adding a new feature is not difficult, the most difficult part is how to add the new code. Can the new code bug be easily extended? Can the new code be reuse?

When come to reusability, things become tricky. I always try to integrate the new feature into current routine, to make the code “reusable”. But it is not a good idea everytime.

Read More

Functional utility library is good

There is a data tracking report need to be update. I have some learning on this task.

Requirement

  1. Update report cache workflow and structure
  2. Clean up deprecated code
    • Some old and long MySQL queries
  3. Show the expired data in the report when the new data is not ready
    • Current behaviour: If new data is not ready, the report page will be blank

Context

  • The remote read-only database is slow, drag down the development speed
  • There are two data sources, I need to merge data from two database to produce report data
    • One database store business data and other store analytic data

Read More