Source: Zhihu, author: 大狐狸
Link: https://www.zhihu.com/question/36426051/answer/76031743
- Refactoring is a programmer’s main skill.
- A work log expands your brain capacity.
- Profile first — only then do you have the face to talk about optimization.
- Comments are valued for quality, not quantity. Do away with period-like “routine comments”. Comments carped on all over the place are really just background noise.
- An ordinary programmer + google = a super programmer.
- Unit tests are always a good deal.
- Don’t write the framework before the implementation. Better the other way around: distill the framework out of the prototype.
- If the code structure is clear, nothing else is a problem.
- Good projects have a tough style: one-key test, one-key release, one-key deploy; lousy projects are sneaky by nature — passed on by word of mouth, nothing written down, all mysterious.
- Don’t be afraid of change when coding; embrace change.
- Keep recharging. There’s only one way for a programmer to die: dying of being out of date.
- In programming, isolation is the direction, naming is the key, testing is the protagonist, debugging is the supplement, and version control is the regret pill.
- One line of code, one soldier. Only an organized force has fighting power. Unit size shouldn’t be too large: squads of a thousand and platoons of ten thousand easily turn into a mass grave of ten thousand.
- Refactoring / optimizing / fixing bugs: only one of these at a time.
- Encapsulate simple modules; layer complex modules.
- The human brain has limited capacity, so tidy beats messy. If you can’t read the code, try reformatting it; if the interface is awkward to use, try wrapping it again.
- Iteration speed determines work intensity. If you want it faster, better and cheaper, start by simplifying the development process and speeding up iterations.
- Forget optimization while writing code — premature optimization is equivalent to malicious sabotage; forget the code while optimizing — optimization has to be based on performance testing, not on agonizing over every line.
- The best tool is pen and paper; the next best is markdown.
- If your leader asks how long a task will take and you can’t answer, the task probably wasn’t broken down finely enough.
- Better to overestimate by a week than to underestimate by a day. Being too “optimistic” easily scares the boss.
- The most useful language is English. The next is probably Python.
- Seeing once beats hearing a hundred times. Draw the results and everything is clear at a glance — debugging time drops dramatically.
- Resources and code should both be under version control. A resource mismatch is far harder to track down than a code mismatch.
- Don’t develop based on imagination, develop based on prototypes. The value of a prototype is validating an idea quickly and saving everyone time.
- Plain text is the first choice for serialization. Binary, obfuscation, encryption, compression and the like can be added when the need arises.
- The compiler will always understand micro-optimization better than you do. You can only push in the directions it isn’t good at.
- Don’t make plans that are too big, too far out, or too detailed. Even if you make them, they’re useless.
- At least half your time will go into integration. Time, time — there is never enough time.
- When you go against mainstream opinion / method / style / habit, checking yourself first is the most reliable move.
- Chase down bugs proactively, whether or not they’re yours. This makes your technical ability shoot up and your personal image soar; if your bug is dug out by someone else… hehe, then you’ll be in a very passive position ~≧﹏≦
- When you don’t know which technical book to pick, choose a thin one. At least it won’t be too expensive, and you’ll be able to finish it.
- git is the best. Simple, reliable, free.
- Only throw assertions at “predictable irrationality”.
- Logs should record time and category. And they must be able to redirect their output.
- Comments are mediocre documentation. Better is clear naming. Let the code tell its own story.
- Reinventing the wheel is a great way to train — provided you’ve seen other wheels.
- code review is best done in groups or pairs. With some understanding of the business, the suggestions carry more value (though that’s not absolute). And it won’t become a burden. A single admin doing reviews personally easily becomes the team’s bottleneck.
- Do your research before asking. Asking off the point gets you looked down on and wastes your own time.
- Never look down on a program-girl (╯3╰)

