- Hands-On Functional Programming with TypeScript
- Remo H. Jansen
- 445字
- 2021-07-02 14:03:06
Foreword
When TypeScript was officially announced on October 1, 2012, the only docs available was the dense official language specification. It was not easily accessible to beginner developers as there was significant focus on syntax. Additionally, it assumed an existing intimate knowledge of JavaScript. Nevertheless, it was complete in terms of TypeScript features at the time, and JavaScript was not as feature-rich as it is today. So, it was a plausible entry point into TypeScript, and that is what I and many others at the time used to learn TypeScript.
How times have changed. Over time, TypeScript has gained a number of features, and so has JavaScript. Keeping up to date now means following relevant GitHub issues and pull requests on Microsoft/TypeScript and reading up on the understanding offered by key developers. Remo is one of those key developers. I got introduced to Remo through his insightful comments on TypeScript issues and then discovered his blog (blog.wolksoftware.com). Remo's blog has been a great help in dissecting important features such as JavaScript decorators and explaining how they are implemented in TypeScript. I find myself linking fellow developers to his docs instead of the alternatives due to the high quality of his work.
Not only has Remo been a great help in understanding TypeScript (and JavaScript), but he has also been a great asset to the TypeScript library ecosystem. One question that I commonly receive from developers is how to do dependency injection in TypeScript. My answer is always a direct link to Remo's extremely useful InversifyJS library (inversify.io).
One of the key concerns that uninformed developers have had about TypeScript is "it only supports object-oriented programming." That is simply not true. TypeScript supports all JavaScript paradigms, and functional programming has first-class support. In fact, it provides a vital piece of famous functional programming languages (compile-time type information) for JavaScript developers.
All programming tasks can be considered as simple (data plus data transformation). This is the mental model encouraged by functional programming aficionados. To have a deep understanding of functional programs as a data transform pipeline, you need a way to define your data structures. This is what is only provided by TypeScript. In the absence of TypeScript, you see various (somewhat arbitrary) syntax elements used to describe the data structures that are flowing through your functional programs.
So, if you want to do world-class functional programming and your programming environment forces you (if only by convenience) to use JavaScript, please consider TypeScript and know that you are not alone. Remo H. Jansen is here to help you.
Basarat Ali Syed
Microsoft MVP and one of the leading global references of the TypeScript community.
- Visual C++程序設(shè)計(jì)教程
- SOA實(shí)踐
- Java高并發(fā)核心編程(卷2):多線程、鎖、JMM、JUC、高并發(fā)設(shè)計(jì)模式
- Web Application Development with MEAN
- WordPress Plugin Development Cookbook(Second Edition)
- ASP.NET 3.5程序設(shè)計(jì)與項(xiàng)目實(shí)踐
- Apache Mesos Essentials
- Learning Apache Mahout Classification
- 編程數(shù)學(xué)
- 用戶體驗(yàn)可視化指南
- Vue.js 3應(yīng)用開(kāi)發(fā)與核心源碼解析
- Java EE Web應(yīng)用開(kāi)發(fā)基礎(chǔ)
- Appcelerator Titanium:Patterns and Best Practices
- LabVIEW數(shù)據(jù)采集
- Swift編程實(shí)戰(zhàn):iOS應(yīng)用開(kāi)發(fā)實(shí)例及完整解決方案