---
title: "#programming-with-types articles | Hashnode"
description: "Explore 1 articles tagged #programming-with-types on Hashnode. Tutorials, guides, and how-tos from the community."
url: "https://hashnode.com/tag/programming-with-types"
---

Tag

# #programming-with-types

1 posts · 0 followers

[qilingzhao](https://hashnode.com/@Zhao70) · [Mar 5, 2023](https://hashnode.com/posts/programming-with-types-chapter-2-basic-types/640411baba8baa592246d2d2)

### [<Programming with Types>随想: Chapter 2. Basic types](https://qilingzhao.com/programming-with-types-chapter-2-basic-types?utm_source=hashnode&utm_medium=feed)

类型限制了一个变量可以接受的有效值的集合，对数据可以进行的操作，数据的意义。 空类型(The empty type) 根据类型的定义，类型定义了可以接受的有效值集合，那么这个集合有没有可能为空？答案是有可能的，TypeScirpt 的 never 就是这种类型。 需要注意的是，空类型不同与 void, 后者是有效值集合当中只有一个值，但这个值没有任何意义。而空类型的有效值集合本身是空的。 使用场景 控制流分析 在函数调用时，标志一个函数不会返回任何值: 在调用过程中抛出异常、死循环或者程序崩溃...

2 min read · [qilingzhao.com](https://qilingzhao.com/programming-with-types-chapter-2-basic-types?utm_source=hashnode&utm_medium=feed)
