zoukankan      html  css  js  c++  java
  • Effective Java 47 Know and use the libraries

    Advantages of use the libraries

    1. By using a standard library, you take advantage of the knowledge of the experts who

      wrote it and the experience of those who used it before you.  

      Use Random.nextInt(int) to get the random number without flaw.  

    2. You don't have to waste your time writing ad hoc solutions to problems that are only marginally related to your work.
    3. Performance tends to improve over time, with no effort on your part.
    4. Libraries maintained by community also tend to gain new functionality over time.
    5. Standard libraries is that you place your code in the mainstream. Such code is more easily readable, maintainable, and reusable by the multitude of developers.  

    Libraries you should know

    Every programmer should be familiar with the contents of java.lang, java.util, and, to a lesser extent, java.io. Collections Framework under java.util, Java.util.concurrent.  

    Summary

    Don't reinvent the wheel. If you need to do something that seems like it should be reasonably common, there may already be a class in the libraries that does what you want. If there is, use it; if you don't know, check. Economies of scale dictate that library code receives far more attention than most developers could afford to devote to the same functionality.

  • 相关阅读:
    OnWndMsg处理功能
    SpringMVC Ajax返回的请求json 的方式来解决在中国字符串乱码问题
    【Shell剧本练习】得出的结论是当前用户
    C++指针和引用简介
    HDU 3126 Nova [2009 Asia Wuhan Regional Contest Online]
    工作过程的编译器
    ubuntu selinux
    Maven创建工程 WEB
    Weblogic集群
    Dubbo
  • 原文地址:https://www.cnblogs.com/haokaibo/p/know-and-use-the-libraries.html
Copyright © 2011-2022 走看看