当前位置:网站首页>This article will show you what typescript is
This article will show you what typescript is
2022-07-23 23:13:00 【Underwater barbecue shop AI】
Catalog
One 、JavaScript The biggest problem
The most common types of errors written by programmers can be described as Type error : A certain type of value is used where different types of values are expected . This may be due to a simple spelling mistake 、 Unable to understand the Library API The surface of the 、 Wrong assumptions about runtime behavior or other errors .
Use JavaScript The most prominent problem in writing code is type checking : because JavaScript yes Weak type language , Most users can only use the code Operation phase To find the wrong type , This makes the error can not be found and repaired in time , It has buried hidden dangers for future development .
JavaScript No ability to express the relationship between different code units . combination JavaScript Quite strange Runtime semantics , This mismatch between language and program complexity makes JavaScript Development has become a difficult task to manage on a large scale .
TypeScript The goal is to be JavaScript programmatic Static type checker —— let me put it another way , Is a tool that runs before the code runs ( static state ) And make sure the type of program is correct ( Type checking ), So that we can find the type error problem in time in the code writing stage .
Two 、 What is? TypeScript
TypeScript Is a free and open source programming language developed by Microsoft . It is JavaScript One of the Superset , And it essentially adds optional static typing and class-based object-oriented programming to the language .
TypeScript It's a very popular kind of JavaScript Language extension . It's in the existing JavaScript A type layer is added to the syntax , And even if this layer is deleted , It will not affect the original performance of the runtime . Many people think that TypeScript “ Just a compiler ”, But a better understanding is to put TypeScript As two separate systems : compiler ( That is, the part dealing with grammar ) and Language tools ( That is, dealing with the part integrated with the editor ).
3、 ... and 、JS , ES , TS The relationship between
1995 year :JavaScript Be born
Netscape at that time was relying on its
NavigatorBrowser becomesWebThe most famous first generation Internet company when the era opened .Because Netscape wants to be static
HTMLAdd some dynamic effects to the page , therefore Brendan Eich It was designed in two weeksJavaScriptLanguage .It's called
JavaScript, The reason is that at that timeJavaLanguage is very popular , Just want to rub a wave of heat , actuallyJavaScriptExcept in grammarJava, The rest of it doesn't matter .1997 year :ECMAScript Be born
Because Netscape was developed
JavaScript, A year later, Microsoft imitatedJavaScriptDevelopedJScript, In order to makeJavaScriptBecome a global standard , Several companies are unitedECMA(European Computer Manufacturers Association)( European Association of computer manufacturers ) The organization has developedJavaScriptThe standard of language , go by the name ofECMAScriptstandard .2015 year :TypeScript Be born
TypeScriptyesJavaScriptSuperset ( It will eventually be compiled asJavaScriptCode ), Which containsJavaScriptAll elements of , Can runJavaScriptCode for , And expandedJavaScriptThe grammar of . Compared withJavaScript, It also adds static types 、 class 、 modular 、 Functions in interface and type annotation , Easier to develop large projects .TypeScriptProvide up-to-date and evolvingJavaScriptcharacteristic , Including those from 2015 Year ofECMAScriptAnd features in future proposals , For example, asynchronous function andDecorators, To help build robust components .
Sum up the relationship between the three in one sentence :ECMAScript Standard language ,JavaScript yes ECMAScript The implementation of the ,TypeScript yes JavaScript Superset .


Four 、 Why use TypeScript
TypeScript Expanded JavaScript, Provide powerful Type checking and Grammar tip function , Combination such as VS code This kind of compiler , Can greatly improve the development efficiency , Reduce the maintenance cost in the later stage of the project :


边栏推荐
- Matlab Foundation
- TAP 系列文章9 | 应用开发加速器
- About synchronizing data from computer to mobile
- Smart IOT source code with configuration IOT source code industrial IOT source code: support sensor analysis services, real-time data collection and remote control
- [leetcode ladder] linked list · 206 reverse linked list
- D2admin framework is basically used
- 礪夏行動|源啟數字化:既有模式,還是開源創新?
- Tap series article 5 | cloud native build service
- Analysis of mobile semantics and perfect forwarding
- Introduction and project development of MVVM and mvvmlight (I)
猜你喜欢

Microsoft SQL Server database language and function usage (XIII)

Tap series article 9 | application development accelerator

Investment suggestions for overseas senior players (2) 2021-05-03

unity visual studio2019升级到2022版本(扔掉盗版红渣)

Internet协议栈 TCP/IP模型 物理层、链路层、网络层、传输层、应用层的作用

USB to can device in nucleic acid extractor high performance USB interface can card

1000个Okaleido Tiger首发上线Binance NFT,引发抢购热潮

fl studio 20.9更新中文版宿主DAW数字音频工作站

Introduction and project development of MVVM and mvvmlight (I)

TAP 系列文章9 | 应用开发加速器
随机推荐
Lixia action | Yuanqi Digitalization: existing mode or open source innovation?
[C language] address book (static version)
浅析基于NVR技术的视频能力与未来发展趋势
TAP 系列文章9 | 应用开发加速器
mysqlbinlog命令介绍(远程拉取binlog日志)
ospf终极实验——学会ospf世纪模板例题
TAP 系列文章7 | 易于管理的流水线配置
Drools (1): introduction to drools
ES6 other syntax and extended syntax summary
Tiktok launches multilingual subtitles and translation tools
Rosbag file recorded by LIDAR point cloud data is converted into CSV file
Diabetes genetic risk testing challenge advanced
unity visual studio2019升级到2022版本(扔掉盗版红渣)
Array - 59. Spiral matrix II
The I2C interface mode offline burning operation method of h7-tool has been released (2022-07-16)
Programming in the novel [serial 20] the moon bends in the yuan universe
Stm32f4 check the frequency of each part of the system
Matlab wavelet toolbox import signal error (doesn't contain one dimensional single)
The ultimate experiment of OSPF -- learn the example of OSPF century template
Absl tutorial (4): strings Library