TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Hyper-Typing

19 点作者 agos12 天前

2 条评论

omneity9 天前
&gt; The strictness even allows us to remove the if check inside the function, since now TypeScript gives us the compile-time guarantee that obj will always have property key.<p>This is a dangerous suggestion. While the author does acknowledge it is a compile-time guarantee only, that doesn’t imply it is safe to remove the if inside the function.<p>An API call, reading a file, calling less well-behaved libraries or making some system calls can all result in objects that pass compile-time checks but will cause a runtime exception or unexpected behavior.<p>As for the thesis of TFA itself, it sounds quite reasonable. In fact a high “level” of typing can give a false sense of security as that doesn’t necessarily translate automatically to more stable applications.
评论 #43924278 未加载
评论 #43924601 未加载
评论 #43924545 未加载
评论 #43924543 未加载
pscanf12 天前
Author here. Curious to hear if anyone&#x27;s experience also matches mine, or if instead you find the trade-off to be worth it most of the times. :)
评论 #43924604 未加载
评论 #43931994 未加载
评论 #43894645 未加载
评论 #43925769 未加载
评论 #43924442 未加载