选择 3 或什么都没有

  • Good, Fast, Cheap: Pick 3 or Get None: Engineering is about compromises. The usual saying is good, fast, cheap - pick two. But the only way to quickly deliver cheap software is to make it good. Neglecting quality leads to a downward spiral. Good boundaries between modules balance time to delivery and total cost of ownership, but teams can't be too big.
  • Simple Code: The first step to simple code is to want it. Simpler code is better for optimization, testing, and maintenance. To get closer to the simplest solution, design it twice.
  • Good Tests: Good tests are crucial, especially for critical software like cryptography. Property-based tests generate many test cases and check properties. A good test suite speeds up development and helps keep code simple.
  • Quality is an Uphill Battle: Simple code and good tests slow down the start of a project, but are worth it in the long run. Every new addition requires more investment, and it's difficult to convince bosses of the importance of design and tests.
  • The Performance XOR Simplicity Fallacy: Reasonable performance is important for good, cheap software. People don't always prioritize performance, but even small performance issues add up with a large user base. Fixing performance problems doesn't always make code more complex; often, it makes it simpler and faster. Performance and simplicity are not mutually exclusive.
  • What if Speed is Paramount?: If speed is the priority, start simple. Understand the problem, devise a simple solution, fix memory access patterns, optimize hotspots, and scale if needed. A good simple design makes optimization easier and keeps complexity contained.
阅读 8
0 条评论