Code Monkey home page Code Monkey logo

Comments (1)

MMmaXingXing avatar MMmaXingXing commented on August 13, 2024

介绍

TypeScript是JavaScript的超集,可以编译成纯JavaScript;

优点

  • 强类型,避免编译时候发现一些非常弱智的错误(类型安全)。
  • 模块化开发,支持类,继承等语法
  • 对编辑器友好,代码补全,接口提示,转到定义,重构等。
  • 对开发人员友好,强类型规范使得代码变的相对更容易维护(和js相比,不过很大程度上还是取决于开发人员)。
  • 大型项目开发更易于维护和管理。

有句话觉得很好,Typescript保持了代码的清洁,一致和易于调试。

缺点

  • 有些笨重,适合大型项目开发,微小型项目,使用JavaScript相对来说更灵活一些。
  • 不可以直接用于网页项目的展示,需要编译,使用时最好有一套成熟的编译发布方案,全部人工维护会更容易出错和增加工作量。
  • 生态系统方面,JavaScript相对来说还是更完备一些。
  • 模板语法噪音,避免使用内联类型可以成为最佳实践,类型语法将与函数实现隔离,这将使类型签名和实现变得更容易阅读。

from daily.

Related Issues (20)

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.