Заключение
Conclusion
Programming is not a zero-sum game. Teaching something to a fellow programmer doesn’t take it away from you. – John Carmack, cofounder of id Software
We hope you enjoyed this introduction to the principles of clean coding and code style guides. The techniques presented here are less a specific set of rules than a set of habits, and like all habits, you’ll need to discover them yourself through daily application. As mentioned earlier in the guide, feel free to copy this C# style sheet for Unity developers to use as a starting point for your own guide. Make the tweaks as needed, depending on your preferences. The most important thing is you agree on a standard as a team and stick to that. However, it doesn’t stop with styling conventions. Prepare your code to be scalable by breaking it into small, modular pieces. As the marathon of development unfolds, expect to rewrite your code over and over again. Production can be a trying process with changing requirements.
If you are interested in more resources on writing a clean, organized, and readable codebase, check out our other e-book Level up your code with design patterns and SOLID and its companion sample project on the Unity Asset Store.
References This guide is a short list of best practices used in computing. For more information, refer to the Microsoft Framework Design Guidelines, which serve as an overarching style guide for this document. You can also learn more from the comprehensive volumes already written about clean code. Here are a few of our favorite books to consider to further your understanding: Clean Code: A Handbook of Agile Software Craftsmanship. Robert C. Martin, 2008. Prentice Hall. ISBN 978-0132350884. The Pragmatic Programmer, 20th Anniversary Edition. David Thomas and Andrew Hunt, 2019, Addison Wesley, ISBN 978-0135957059. Refactoring: Improving the Design of Existing Code, Second Edition. Kent Beck and Martin Fowler, 2018. Addison-Wesley. ISBN 978-0-134-75759-9. Test-Driven Development, First Edition. Kent Beck, 2002. Addison-Wesley. ISBN 9780321146533.