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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

The Coolest Programming Language Features

1 点作者 alraj将近 2 年前

1 comment

rurban将近 2 年前
re The Kotlin example fun String.mutate():, extending the builtin String class. This a favorite example, because in Java builtin classes are sealed&#x2F;closed, and in Kotlin and many other langs they are open, so you can monkeypatch those system classes. <a href="https:&#x2F;&#x2F;kotlinlang.org&#x2F;docs&#x2F;sealed-classes.html#sealed-classes-and-when-expression" rel="nofollow noreferrer">https:&#x2F;&#x2F;kotlinlang.org&#x2F;docs&#x2F;sealed-classes.html#sealed-class...</a><p>A cool new feature or a bad mis-feature?<p>Closed classes offer tremendous compile-time safety guarantees and optimization possibilities. with open classes you have to check inheritance on each and every call at run-time, with sealed classes you can easily inline them. A much cooler feature than open classes.<p>Larry Wall was so angry about closed java classes that he wanted them open and slow. On the other hand, Damian Conway, the perl6 designer, wanted them closed by default. You have to look at the current raku design if they are still open or closed. One of the many reasons why raku is so slow.
评论 #36356026 未加载