zoukankan      html  css  js  c++  java
  • Writing Better Javascript

       some of the techniques I use to make my code easier for other   programmers and projects to use.

      dumping useful functions into the utils.js file throughout this book.

       The problem with just dumping functions into a file in this way is that they become hard to manage  and maintain and, as I’ll explain shortly, difficult for others to integrate into their projects.    不利于别人使用,,,,

        I revisit my kitchen-sink file when I have reached a point in a project where the basic
    functionality is stable and I have a good feel for the way that different features fit together. At this point,
    and not before, I start to rework the code into modules so that it plays nicely with other libraries.

       再看代码,如果基本功能很稳定,并且把不同情况汇合到一起。再找代码重构,和别的库融合

      Once I have tidied up and modularized the code, I begin unit testing    当在模块化代码的时候,开始单元测试

    Testing is a very personal
    thing, and many testing proselytizers will insist that testing must begin as soon as you start coding

      测试是一个非常个人的事,

    Test when it feels right, test until you are happy with your code, and use the
    techniques and tools that work for you        测试感觉正确,喜欢自己的代码,并使用一些一具和技术

    Managing the Global Namespace

  • 相关阅读:
    ubuntu进入可视化界面
    MYSQL(一)
    PHP(一)
    MAC下安装NLTK
    初次使用NLTK
    iPhone项目的BaseSDK和DeploymentTarget
    ratelimit+redis+lua对接口限流
    java操作RabbitMq
    二维码生成并在下方添加文字,打包下载
    Redis六大淘汰策略:新来的员工不小心把Redis服务器撑爆了!!!
  • 原文地址:https://www.cnblogs.com/yushunwu/p/2598585.html
Copyright © 2011-2022 走看看