Fourteen experiences in programming for five years
permutation:
1., when the performance is in problem, if it can be calculated and processed in the application layer, then take it out of the database layer. Sorting and grouping are typical examples. It is always easier to improve performance in application layer than in database layer. As for MySQL, SQLite is more manageable.
2. about parallel computing, if possible, avoid it. If you can't avoid it, remember that the greater the ability, the greater the responsibility. If possible, try to avoid direct thread manipulation. Operate on a higher level of abstraction as much as possible. For example, in iOS, GCD, distribution and queue operations are your good friends. The human brain has not been designed to analyze the infinitely temporary state. This is my painful lesson.
3. simplifies the state as much as possible and localizations as far as possible. Apply the supremacy.
4.'s short and combinable way is your good friend.
5. code annotations are dangerous, because they are easy to update and are not timely or misleading, but this can not be the reason for not writing notes. Don't comment on trivial matters, but if necessary, strategically lengthy notes are needed in some special places. Your memory will betray you. Maybe tomorrow morning, maybe after a cup of coffee.
6. if you think a use case scenario may "not have a problem", it may be a month after you have suffered a miserable failure in the product you publish. Be a skeptic, test, verify. When
7. is in doubt, communicate with all relevant people in the team.
8. does the right thing - you usually know what this means.
9. your users are not stupid. They just don't have the patience to understand your shortcut.
10. if a developer is not scheduled to maintain your system for a long time, be alert to him. 80% of the blood, sweat and tears flow after the release of software - you will then become a world weary person, but also a smarter "expert." The
11. task list is your good friend.
12. takes the initiative to make your work more enjoyable, and sometimes it requires your efforts.
13. quietly collapsed, and I will still wake up from this nightmare. Monitor, log, alarm. Be aware of all kinds of false alarms and unavoidable feelings of passivation. Keep your system sensitive to faults and timely alerts.
14. is a complex enemy.
[English Original: 14 lessons after five years of professional programming]