`

what is clean code?

阅读更多
Dave Thomas关于整洁代码有段话:
Clean Code can be read, and enhanced by a developer other than its original author. It has unit and acceptance tests. It has meaningful names. It provides one way rather than many ways for doing one thing. It has minimal dependencies, which are explicitly defined, and provides a clear and minimal API. Code should be literate since depending on the language, not all necessary information can be expressed clearly in code alone.
   针对可理解性与可维护性做了阐述,可理解性对于普通程序员来说最重要的是友好,当然单元测试,后续的验收测试也必不可少,体现了敏捷开发,测试驱动的要素。
   函数或方法应该具有有意义的命名,每段代码块具有单一功能,减少与外部系统,环境,方法的依赖,API则尽可能少,前面我们做的项目实际上后来我感觉API设计的有冗余,提供了至少2个方法来获取同一引擎,首先当然是不好管理资源,其次犯此minimal API戒条,并且API意义也不明确,多义性很多,同时依赖于三个函数,失败!
   我想API实际上是系统暴露的使用契约,必须从命名到使用的场景,已经依赖上都有明确的意义,有歧义是不行的,某种意义上,具有”API的完备性“。
分享到:
评论

相关推荐

    Clean Code

    Clean-Code-A-Handbook-of-Agile-Software-Craftsmanship-Robert-C-Martin-Series Robert C. Martin Series The mission of this series is to improve the state of the art of software craftsmanship. The books ...

    clean_code

    about programming, there will be lots of code. If the book is about managing, there will be lots of case studies from real projects. These are the books that all serious practitioners will have on ...

    Learn.CakePHP.With.Unit.Testing.1484212134

    What is clean coding What is TDD and the development cycle using this approach How to work with fixtures, model tests, text callbacks, controller tests, and more How to do mocks, test suites, testing ...

    7 Rules Of Writing Good Code

    Others say to write ‘clean code’, whatever that is supposed to be. Here are my 7 Rules of writing good code and the reasons why I advocate for them. Rule #1: Don’t Write a Mystery Novel ...

    The Clean Coder - A Code of Conduct for Professional Programmers

    Martin, "The Clean Coder: A Code of Conduct for Professional Programmers" Prentice Hall | 2011 | ISBN: 0137081073 | 256 pages | PDF | 6 MB Programmers who endure and succeed amidst swirling ...

    Clean C++: Sustainable Software Development Patterns and Best Practices

    If you want to teach yourself about writing clean C++, Clean C++ is exactly what you need. It is written to help C++ developers of all skill levels and shows by example how to write understandable, ...

    Get Your Hands Dirty on Clean Architecture.epub

    You'll also learn what shortcuts produce what types of technical debt and how, sometimes, it is a good idea to willingly take on those debts. After reading this book, you'll have all the knowledge...

    Clean Architecture

    Now, building upon the success of his best-selling books Clean Code and The Clean Coder, legendary software craftsman Robert C. Martin (“Uncle Bob”) reveals those rules and helps you apply them., ,...

    The Clean Coder

    Martin, "The Clean Coder: A Code of Conduct for Professional Programmers" Prentice Hall | 2011 | ISBN: 0137081073 | 256 pages | PDF | 6 MB Programmers who endure and succeed amidst swirling ...

    Efficiency Guide (erlang)

    slower than the clean code (because the clean code has become faster, not because the uglier code has become slower). This Efficiency Guide cannot really learn you how to write efficient code. It can ...

    Learn CakePHP(Apress,2ed,2016)

    What is clean coding What is TDD and the development cycle using this approach How to work with fixtures, model tests, text callbacks, controller tests, and more How to do mocks, test suites, testing ...

    Clean Architectures in Python A practical approach to better software design

    The main point of the clean architecture is to make clear “what is where and why”, and this should be your first concern while you design and implement a software system, whatever architecture or ...

    Learn CakePHP: With Unit Testing, 2nd Edition

    What is clean coding What is TDD and the development cycle using this approach How to work with fixtures, model tests, text callbacks, controller tests, and more How to do mocks, test suites, testing ...

    Clean Architecture A Craftsman's Guide to Software Structure and Design

    Now, building upon the success of his best-selling books Clean Code and The Clean Coder, legendary software craftsman Robert C. Martin (“Uncle Bob”) reveals those rules and helps you apply them. ...

    Filipek B. C++17 In Detail 2019.pdf

    If you’ve ever asked “what’s in C++17 and what does it mean for me and my code?” — and I hope you have — then this book is for you. Now that the C++ standard is being released regularly every ...

    Beginning CSS Preprocessors(Apress,2015)

    You’ll see how to write code in a very clean and scalable manner and use CSS preprocessor features such as variables and looping, which are missing in CSS natively. Reading Beginning CSS ...

    Entity Framework Code First Succinctly(Syncfusion,2014)

    You just focus on the actual domain model and its characteristics, and forget about the persistence details, which is pretty much what domain driven design (DDD) is about.  It sits on an API for ...

    tcpip几个例程

    What you can download here is a very clean code written by an experienced programmer, with proper error handling and plenty of comments. The universal generic C++ class cSocket, written in plain C++, ...

Global site tag (gtag.js) - Google Analytics