Skip to content
The Chat Archive
qwen3-30b-a3b· Alibaba (Qwen) LMArena Human Preference 140K

90-90-1 Rule for Python

  1. User

    90-90-1 Rule for Python

  2. Assistant

    The 90-90-1 Rule is a well-known observation in software development, often attributed to Tom Cargill, a programmer at Bell Labs. It highlights the disproportionate time spent on different stages of a project. Here's a breakdown of the rule and its relevance to Python development:


    What is the 90-90-1 Rule?

    The rule states:

    • 90% of the code is written in 10% of the time.
    • The remaining 10% of the code takes 90% of the time.

    This reflects the reality that:

    • The initial phase of a project (e.g., building core features) is relatively quick.
    • The final stages (debugging, testing, optimizing, and fixing edge cases) are time-consuming and complex.

    Why Does This Happen?

    1. Early Stages:

      • Developers focus on the main logic and core functionality, which is often straightforward.
      • Tools like Python's simplicity, readability, and extensive libraries (e.g., requests, pandas) speed up initial development.
    2. Late Stages:

      • Debugging and testing uncover hidden issues (e.g., race conditions, memory leaks).
      • Edge cases and user scenarios become harder to handle.
      • Optimizing performance (e.g., for large datasets in Python) requires deeper analysis.

    Application to Python Development

    Python's flexibility and high-level abstractions make it easy to write code quickly, but the rule still applies:

    • Example: Building a web app with Flask or Django might take a few days to set up the basic structure. However, ensuring security (e.g., preventing SQL injection), handling concurrency, or optimizing database queries can take significantly longer.
    • Tools to Mitigate:
      • Use unit tests (e.g., pytest) and integration tests to catch bugs early.
      • Leverage debuggers (e.g., pdb, ipdb) and linters (e.g., pylint, flake8) to identify issues.
      • Adopt code reviews and CI/CD pipelines to streamline testing and debugging.

    Key Takeaways

    • Time Management: Plan for the "last 10%" of the project to take most of the time. Avoid underestimating the effort required for testing and refinement.
    • Iterative Development: Break projects into smaller milestones to manage complexity.
    • Python-Specific Tips: Use Python's built-in tools (e.g., unittest, logging) and community resources (e.g., Stack Overflow, GitHub) to address challenges efficiently.

    Note

    The 90-90-1 Rule is a general observation, not a strict law. While it underscores the challenges of software development, it also highlights the importance of thorough testing and planning. In Python, leveraging its ecosystem and best practices can help reduce the time spent on the "last 10%."

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.