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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Null Is Not the Billion Dollar Mistake. A Counter-Rant (2015)

6 点作者 0x54MUR418 个月前

6 条评论

moi23887 个月前
Well, this is a load of hogwash.<p>Null is definitely the billion dollar mistake. It’s not the “null” value however, since this could indeed be seen as a badly implemented option monad.<p>It’s the implicit nullability of all reference types which is the mistake, since it leads to undefined behaviour at runtime.<p>Also; in regards to the linked style discussion in the post; you’re wrong about all of it :p
评论 #41717985 未加载
评论 #41720910 未加载
Sakos7 个月前
The biggest problem is always just going to be that it breaks any understanding or concept of a type system. When object.doThing().doOtherThing() can fail because the result of doThing() can be null, you suddenly have to fill your entire code base with unreadable cruft to avoid that happening. Because it&#x27;s not just that one method where this is possible.<p>It especially doesn&#x27;t help in languages like Java, where nulls completely subvert static types and static type checking and it turns a whole class of issues into runtime errors.<p>Allowing null means you&#x27;re implicitly codifying Type class | null for every single reference type everywhere in your code. By doing it implicitly, you&#x27;re not providing any semantics in the programming language or in the runtime to be able to deal with it at the same abstraction level as the code around any particular point where something can be null. This is incredibly error prone and makes for ugly, brittle code.<p>Yeah, it&#x27;s a billion dollar mistake.
评论 #41718788 未加载
karmakaze7 个月前
&gt; JavaScript itself is a beacon of usefulness that is inversely proportional to its purity or beauty, so long story short: ...<p>How can I take this seriously. The language&#x27;s shortcomings is from being written practically overnight, not from inverse proportional value elsewhere. This post might be a $100 mistake.
orionblastar8 个月前
Where UserName Is Not Null<p>Filters out the records where UserName is not Null.<p>Where UserName Is Null<p>Filters out the records where UserName is null and possibly didn&#x27;t finish the registration process.
Jerrrrrrry7 个月前
Coincidentally surely, and not Dunning-Kreugur, that this exact thing proved to be another literal 2 comma line item just last week.
评论 #41720921 未加载
octav1237 个月前
Stopped reading at &quot;Functional programming languages like to make use of the Optional “monad” ... but that’s just another way of modelling NULL.&quot; It is clear he doesn&#x27;t understand simple things like Option and the purpose of that and monads.