• 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

  • 相关阅读:
    ZOJ Bookcase
    C*++ Calculations
    STL <cctype>
    线段树单点更新+区间更新
    ZOJ Supermarket
    STL <cassert>
    算法导论<二>
    MV Maker [DP]
    LIS 最长有序子序列(递增/递减/非递增/非递减)
    LIS
  • 原文地址:https://www.cnblogs.com/yushunwu/p/2598585.html
Copyright © 2020-2023  润新知