Saturday, August 4, 2018

Distinguished Engineer + 疯狂工作

跟着公司的Distinguished Engineer code, 真会爱上coding, 爱了会更加爱。


Vk
=====
0. Rely entirely on logic, not on syntactic similarity.
1. Code slowly (type slowly) and calmly even under deadline, able to understand the code with the whole picture without running it, and change them with confident;
2. If things are not right, do not do a quick fix, fix the right things by thinking of a proper architecture;
3. Focus on how to produce nicely knitted code that blends well with existing codes;
4. When undo etc., look at each places and figure out whether they are correct;
(codes is like an article, look at it without running)
(figure out the best flow for handling things, with good naming convention)
5. Very patient, no rushing for finishing.
6. Don't treat code improvement as a deadline thing, it is a continual process, treat it as a hobby thing
7. Have a clear workflow in mind, can immediately point out which workflow is redundant, which can be simplified

Code Advice
1. reduce parameters (copy utterances, new_mentions)
2. de-nesting
3. de-memory for long code
(no visited variable, if not...return directly rather than go last)
4. no bidirectional code
5. don't scare of correctness, just refactor and use unit test for your advantage
6. don't call redundant things
e.g. when you have candidates already, don't call a function where first step is get_candidates
7. annotate the output
a)Yes
if not ..
return
b)No
if ...:
long list

8. make a new list rather than delete element in existing list
9. a. function 1,2,3 return
Can just move it outside and detect for that instance
[each function should focus on one task, not too many things;
and don't put specific things too deep;
think of why you feel easily lose track of what is done in the current code]

Additional
1. use extract method and extract variable to comment the complex chunk of code and complex chunk of expression.
2.


这几天特别专心的工作,因为一个deadline 接着一个deadline.
学了很多东西,因为一群印度人从印度过来。
他们真是一群乐观的民族,deadline的时候也没见他们疯狂工作,就是打游戏什么的;然后晚上再工作。工作中有娱乐,娱乐中有工作。

自己方面,顺利完成目标有种成就感,但是这有赖于旁边的三位印度人的帮助。
开始的时候完成了code很开心,然后那个distinguished enginner要求写unit test才能check in, 我还以为可以慢慢写,我也没写过test case,于是又专心的码着,我觉得这种逼迫对学习很有效,几个小时内从新手变成中级用户。完全没有感觉时间的过去。deadline真是一把好刀。

从本来的不情愿加班,到加班加到很有热情,中间的成就感很重要。我觉得在工业界需要这种热情来带动,而不是单纯的工钱和时间的对等,这样才能做的积极快乐,学的更多,这可比金钱价值高多了。这怎么看都是一种良性循环。

另外发现很多是后最不想干的事情都是最重要的事情。先干了再说。

No comments:

Post a Comment