We recently completed a project with Allseas, a leader in marine construction. As Technical Director at Yabba Data Doo, my goal was to create a Python-based data model for the ballast systems across Allseas' fleet. This article shares the Python practices and guidelines we followed in this project.?
9 Guiding Principles and Best Practices?
Our project was based on the idea of continuous improvement, learning from both our successes and challenges. Here are nine principles that have become our guidelines:?
- Prioritize Effective Discussions: Beyond formal meetings, unplanned team discussions can yield valuable insights that contribute to more robust coding solutions.?
- Develop UML Diagrams Before Coding: The use of Unified Modeling Language (UML) diagrams before initiating the coding process can help effectively communicate design concepts and structure.?
- Stay Organized with Updated Sprint Boards: Regularly updating sprint boards ensures clear alignment on team tasks and objectives, fostering better project management and collaboration.?
- Start with Quick Prototyping: Rapid prototyping, preceded by a thorough analysis of the problem, provides a deeper understanding of challenges and aids in developing robust solutions.?
- Leverage Efficient Package Managers: The early adoption of tools like Poetry, a Python package manager, can streamline project management and simplify dependency control.?
- Ensure Small PRs and Commits: Smaller, more focused pull requests (PRs) and commits simplify the code review process and enhance code quality.?
- Perform Thorough Unit Testing: High code coverage, achieved through comprehensive unit testing, ensures the robustness of your model. Our team extensively utilized the pytest framework for this purpose.?
- Distinguish Between Unit and Integration Tests: The segregation of unit tests from integration tests improves code reliability and modularity. Utilize Mocks to make this distinction more efficient.?
- Maintain a Strong Type Hinting Discipline: Stricter type hinting, particularly for functions that return None, is crucial. Tools like Mypy, a static type checker for Python, can help catch common bugs and ensure cleaner code.?
Despite the smooth sailing, there were areas we identified as potential project pitfalls to mitigate in future collaborations:?
- Minimize Code Interference: Code review is crucial, but pulling other people's branches for non-review purposes can lead to conflicts. Clear boundaries need to be maintained to prevent unnecessary complications.?
- Do Not Underestimate System Integration: The "connecting the dots" part of the project is critical. It's essential to allocate enough time and resources for the integration of individual components into the overarching system.?
To sum up, our project with Allseas has further fortified our Python and project management skills. We've used modern PEP8 standards, applied effective design patterns, and balanced speed and quality. The experience has deepened our knowledge and competence to deliver robust, scalable solutions while upholding rigorous coding standards. As we move ahead, these insights will continue to serve as our reference, leading us towards success in future projects.?