Code Monkey home page Code Monkey logo

fet's Introduction

Google的原则:不作恶。

程序员的原则:不挖坑。

写代码的正确方式:战战兢兢,如履薄冰。

前言

程序员是一个创造力强,个人色彩浓厚的职业,不同的人,代码的风格习惯千差万别,这个时候,就需要标准来约束程序员的代码,越是庞大的项目越应该如此。规范越早引入越好,规范的约束永远不嫌多。

好的原则

我们应该遵循古老的原则:“能做并不意味着应该做”。

  • 约定优于配置
  • 不要太过于依赖注释,注释只是业务的补充,良好的代码结构和命名能够能够避免很多不必要的注释
  • 清晰原则:清晰胜于技巧 (代码是给人看的,其次才是在机器上运行的,10行复杂的代码不如30行清晰的代码)
  • 吝啬原则:除非确无它法,不要编写庞大的程序(动不动就上千行的代码不要再出现了!!!)
  • 健壮原则:健壮源于透明和简洁

fet's People

Contributors

zhaoda avatar pines-cheng avatar bitdeli-chef avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.