# Software Development Principles --- ### Stakeholders * Developers * Maintainers (including future you) * Users --- ## Development perspective Communication with * computer (OS, language, frameworks, libraries, APIs) * self * future self * other developers --- ### Complexity ![Complexity](https://www.factinate.com/wp-content/uploads/2018/02/sauroninternal-1024x535.jpg =500x) --- ### Issues * Knowing your goal * Reducing bug injection rate * Code reuse --- ### Knowing your goal * Talk to user * Create a requirement specification * Use domain-driven design --- ### Domain-driven design * Shared context and model (ubiquitous language) * Naming and language * Nouns vs verbs --- ### Reducing bug injection rate * Separation of concerns * YAGNI * Modularity * Managing state * Testing --- ### Separation of concerns *(or one thing at a time)* * Approach to development * Structure of software --- ### Quality attribute requirements * Effectiveness * Cost-effectiveness * Correctness * Robustness (stability under stress) * Interoperability * Configurability * Performance * Efficiency * Minimalism * Consistency * Scalability * Availability * Extensibility * Portability * Security * Usability * [More](https://en.wikipedia.org/wiki/List_of_system_quality_attributes) --- ### Separation of structure * HTML * CSS * JavaScript --- ### YAGNI * Agility * Organic development * vs Generality --- ### Modularity * Encapsulation (information hiding) * Cohesion (single responsibility principle) * Decoupling (principle of least knowledge) * Do not repeat yourself (DRY) * Consistent (interface) * Replaceable * Independent * Reusable * Extensible * Testable --- ### Managing state * Dependency injection (vs global variables) * Functional programming --- ### Testing * 50% of development time * Modularity allows... * Top-down design, bottom-up coding * Test-driven design * YAGNI * Continuous integration * Generous logging --- ### Further reading * [Code smells](https://blog.codinghorror.com/code-smells/) & [more code smells](https://github.com/lee-dohm/code-smells) * [Software design patterns](https://en.wikipedia.org/wiki/Software_design_pattern) * [Thoughts on OOP and complexity](https://medium.com/better-programming/object-oriented-programming-the-trillion-dollar-disaster-92a4b666c7c7) --- ## Maintenance and collaboration perspective * Communication with future self and other developers * Principle of least surprise * Commenting * Why, what, (how?) * Version control * Git workflows * Cactus pattern * Style * Consistency * Standards --- ## User/ production perspective Communication with users and client sysadmins * Principle of least surprise * Fitness of purpose * Ease of installation/ uninstallation * Respect for user environment * Ease of maintenance (updates) * Ease of configuration * Documentation relevance * Stability * Performance * Monitorability --- ## Addendum * [Machine learning-specific principles](https://developers.google.com/machine-learning/rules-of-ml/) --- ## Random * Don't repurpose existing variables or reuse variable names * Don't break production APIs * ([version them sanely 1](https://blog.container-solutions.com/api-versioning-what-is-it-why-so-hard)) * ([version them sanely 2](https://apisyouwonthate.com/blog/api-versioning-has-no-right-way)) --- fin --- <!-- https://github.com/hakimel/reveal.js --> <!-- set slide font size --> <style> .reveal { font-size: 16pt; } </style>
{"metaMigratedAt":"2023-06-14T16:21:38.732Z","metaMigratedFrom":"YAML","title":"Software Development Principles","breaks":true,"slideOptions":"{\"theme\":\"league\",\"transition\":\"fade\"}","description":"Developers","contributors":"[{\"id\":\"af4558ef-b062-4687-9f98-987767d1b68a\",\"add\":1455,\"del\":412}]"}
    290 views