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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Dart: Sound Null Safety

33 点作者 markdog12将近 5 年前

6 条评论

RivieraKid将近 5 年前
I&#x27;ve been using Dart and Flutter recently, mostly happy with it, Dart got into my top 3 languages actually (the other 2 are Swift and Julia).<p>Some random thoughts about Dart:<p>- The design seems driven by pragmatism and developer experience. I hate dogmatic approaches to languages (such as: FP is always better than OOP).<p>- No REPL.<p>- Two things I like about doc comments. First, they use &quot;&#x2F;&#x2F;&#x2F;&quot; instead of &quot;&#x2F;* *&#x2F;&quot;. Second, instead of the Javadoc style where every method argument and the return value must be described, in Dart the preferred style is to describe the method naturally with no prescribed structure.<p>- The formatter defaults to 80 characters, I think something like 105 would be better.<p>- Don&#x27;t like the access control model where private members start with an underscore, it&#x27;s just ugly. It would be better if everything was private by default and public memebers would be annotated with the &quot;public&quot; keyword.<p>- Overall, it seems like poor man&#x27;s Swift, can&#x27;t think of any amazing feature right now, but the whole experience is good, not too far behind Swift, better than Kotlin, even though Kotlin should be better on paper.<p>And Flutter:<p>- It&#x27;s fun and easy compared to Android and iOS. (I haven&#x27;t tried Swift UI yet so can&#x27;t compare.)<p>- Iteration speed is amazing and a killer feature. I have the IDE and the iPhone simulator side by side and with Cmd + \ I can reload the app in like half a second.<p>- You can&#x27;t achieve truly native experience but you can get close. The widgets don&#x27;t accurately mimic native widgets. For example scrolling physics on Android - it&#x27;s just similar.<p>- Performance seems reasonably good, native apps just feel a bit better for me.<p>- Flutter is the best technology for multiplatform mobile development IMO, unless you want to share code with web - Flutter for the web is DAO.
评论 #23480531 未加载
评论 #23481578 未加载
评论 #23482371 未加载
yagodragon将近 5 年前
Wow, they really listen to people&#x27;s feedback. Looking forward to testing it with a couple of small apps I have once it becomes stable. Overall, the dart&#x2F;flutter experience has been amazing for me. The team looks serious about providing the absolute best developer experience and so far they&#x27;ve done it.<p>Flutter&#x27;s future looks promising because it&#x27;s also a first-class citizen in the new Fuchsia OS. I don&#x27;t know how&#x27;s that experiment gonna end up, but even today it can be considered one of the best UI toolkit we have.
wstrange将近 5 年前
Kudos to the Dart team. I&#x27;m sure this feature was a super heavy lift.<p>&quot;The soundness of Dart’s null safety has another welcome implication: it means your programs can be smaller and faster. &quot;
pram将近 5 年前
What is Dart being used for these days? This isn’t snark I’m curious. I looked into it a couple years ago but ended up going with TS for a project, it looked pretty neat though.
评论 #23479885 未加载
评论 #23479866 未加载
评论 #23479936 未加载
评论 #23494103 未加载
_bxg1将近 5 年前
I&#x27;ll never understand why people thought it was a good idea to design static type systems that <i>can&#x27;t</i> express nullability&#x2F;non-nullability in the first place. In a Java codebase every single object reference is a potential land-mine, and the only way to be totally safe is to add a null check before every single access or method call. So most people just roll the dice until something inevitably breaks.
exclipy将近 5 年前
&gt; Dart shares sound null safety with Swift, but not very many other programming languages.<p>What about Kotlin and Rust?