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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Kotlin is like TypeScript

32 点作者 yoshiokatsuneo大约 8 年前

12 条评论

COil大约 8 年前
I think we get it, every languages are like Kotlin!
评论 #14373979 未加载
realharo大约 8 年前
TypeScript has structural typing, that is a HUGE difference.
评论 #14374028 未加载
评论 #14373889 未加载
atemerev大约 8 年前
"Happy languages are all alike; every unhappy language is unhappy in its own way".
realharo大约 8 年前
<p><pre><code> name: string; constructor(name: string) { this.name = name } </code></pre> You don&#x27;t have to do this in TypeScript either, you can just do<p><pre><code> constructor(public name: string) { } </code></pre> Also, the &quot;Empty collections&quot; section doesn&#x27;t do the same thing, the collections you created in Kotlin are immutable.<p>And the TypeScript ones have the value `undefined` (unfortunate that strictNullChecks doesn&#x27;t catch things like that <a href="https:&#x2F;&#x2F;github.com&#x2F;Microsoft&#x2F;TypeScript&#x2F;issues&#x2F;8476" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Microsoft&#x2F;TypeScript&#x2F;issues&#x2F;8476</a>).<p>And for some nitpicking, please be consistent with your semicolons, either use them or don&#x27;t use them, but don&#x27;t mix it randomly like that.
评论 #14374097 未加载
janwillemb大约 8 年前
Why this comparison?
评论 #14373925 未加载
yoshiokatsuneo大约 8 年前
derived from Swift is like Kotlin: <a href="https:&#x2F;&#x2F;github.com&#x2F;Nilhcem&#x2F;swift-is-like-kotlin" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Nilhcem&#x2F;swift-is-like-kotlin</a>
评论 #14373900 未加载
评论 #14374079 未加载
dtech大约 8 年前
This is getting ridiculous
评论 #14374100 未加载
ccozan大约 8 年前
Is this Kotlin the new &quot;Erlang&quot; of the HN&#x27; first page?
mhd大约 8 年前
I wonder what&#x27;s the oldest and&#x2F;or most maligned language that you can use to make a similar comparison that&#x27;s still somewhat valid...
ptx大约 8 年前
&quot;for index in 1–5&quot; is like &quot;for let index of underscore dot range 1–6&quot; in the same way Lisp is like COBOL.
codesternews大约 8 年前
Kotlin is like Swift<p>Kotlin is like TypeScript<p>that infer<p>TypeScript is like Swift<p>am I getting right? or Is there anything else?
评论 #14374152 未加载
评论 #14374154 未加载
boubiyeah大约 8 年前
Kotlin is also like Kotlin
评论 #14374182 未加载