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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Go vs. Swift [pdf]

166 点作者 jakerockland超过 8 年前

15 条评论

chmike超过 8 年前
I don&#x27;t see any &quot;strength&quot; in the classical object oriented programming model as found in C++ or Java. Actually, in modern programming composition is considered superior to inheritance.<p>The interface concept of Go makes programming with composition much more flexible and powerful than with the class model. The author skips this Go specific and original interface typing. This provides a multiple inheritance equivalent without all the complications on C++ and that most OO oriented languages forbid because of that complication.<p>Go is a very original language in this aspect as well as with concurrency. Understanding and mastering these properties goes beyond simple syntax analysis.<p>To me the most remarkable property of Go is its simplicity. As I explained to a friend who is a strong advocate of D, the difference with other programming language is the same as dealing with a spoken language of 1000 words instead of 10,000 words. It&#x27;s true that the language with 10,000 words is more expressive and richer. But the effort required to learn, read and write a language of 1000 words is much lower than a with a language of 10000 words. I&#x27;m beyond 50 years old, and too me this makes a huge difference. The best way to express it is that <i>with Go programming is fun again</i>. I hope that Go will preserve this simplicity. At the beginning Java was simple too. They later killed it to the point I don&#x27;t want to deal with Java code anymore.
评论 #13435113 未加载
评论 #13434758 未加载
评论 #13436407 未加载
评论 #13436994 未加载
评论 #13435834 未加载
pawadu超过 8 年前
I found the study very shallow and superficial. For example, who cares how many people have starred a project on github? And why should I care how many lines &quot;hello world&quot; is in a language [1]?<p>I would rather see a discussion about performance, platform support, maintainability, governance and do on.<p>---<p>[1] someone please create a new programming language where the empty file means &quot;print hello world&quot;. Since you can&#x27;t do any better than that it would once and for all put an end to this stupid benchmark.
评论 #13434517 未加载
评论 #13434956 未加载
评论 #13436211 未加载
seanalltogether超过 8 年前
The more I use swift, the more I&#x27;ve grown to appreciate the concept of Optionals and how the compiler enforces it&#x27;s usage. I have found that my swift code is more robust and explicit than my ObjC or Android java code is, as well as the team members around me.
评论 #13432970 未加载
评论 #13431848 未加载
评论 #13434416 未加载
评论 #13433867 未加载
评论 #13431431 未加载
评论 #13434249 未加载
评论 #13435718 未加载
yvsong超过 8 年前
Swift: better OO, syntax, IDE; Go: built-in concurrency;<p>Swift is a great joy for iOS development, where compatibility with Objective C makes things smooth, and operation queues are good enough for concurrency. Xcode is a big productivity booster. Good to break Swift&#x27;s own backward compatibility with new releases to keep innovation, while providing a quick fix tool. Hope it will become a great server language too.
评论 #13431486 未加载
评论 #13431555 未加载
评论 #13432650 未加载
solidsnack9000超过 8 年前
&gt; Because concurrency is supported through an Apple API rather than being explicit in the language’s design, using it is currently very much coupled to iOS or macOS development.<p>I am not sure this is accurate, because libdispatch has been ported to Linux:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;apple&#x2F;swift-corelibs-libdispatch" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;apple&#x2F;swift-corelibs-libdispatch</a><p>They are &quot;...early in the development of this project...&quot; but server-side frameworks use it.
评论 #13433465 未加载
blario超过 8 年前
Very basic comparison. Doesn&#x27;t go into the quality of the generated code, compiler speed or efficiency, etc.
评论 #13432265 未加载
评论 #13431996 未加载
scotty79超过 8 年前
Semi-related, side-by-side comparison of how common things are done in swift and go:<p><a href="http:&#x2F;&#x2F;rosetta.alhur.es&#x2F;compare&#x2F;swift&#x2F;go&#x2F;#" rel="nofollow">http:&#x2F;&#x2F;rosetta.alhur.es&#x2F;compare&#x2F;swift&#x2F;go&#x2F;#</a>
danielparks超过 8 年前
Go feels like a beefed up version of C.<p>Swift feels like a high level language with static typing.<p>Interestingly, Swift doesn&#x27;t feel much like Obj-C.
评论 #13439171 未加载
评论 #13435447 未加载
c0ffe超过 8 年前
I favored Swift over Go in a small project (developed in my freetime) because it has template &#x2F; metaprogramming support, and it calls destructors inmediately on unreferenced objects.<p>Some things that can be improved:<p>* It needs more support &#x2F; packages for Linux (and Windows maybe?). I was using Manjaro Linux, and around November 2016 (dont remember exactly), the existing packages in the AUR didnt work anymore.<p>* No built-in weak collections.<p>* No source subfolders for the same project when using the buit-in package manager (I dont know about Go in this matter).
coldcode超过 8 年前
I use Swift every day and appreciate it a lot, while I have only cursory experience in Go, mostly because it didn&#x27;t have any real debugger support in the past. But any comparison is rather shallow because at the moment they don&#x27;t really address the same target usage, and Swift is only minimally supported on the server side where Go is generally used. Give it a couple years and the comparison might be more meaningful.<p>Once Jetbrains Gogland is up and running I will be playing more with Go.
twoquestions超过 8 年前
The analysis looked good to me, but I was only able to read it after I downloaded it. I hate to be &quot;that guy&quot;, but the Github pdf viewer brought Chrome to its knees.
tonyedgecombe超过 8 年前
I can&#x27;t believe many people are making that choice, it strikes me the domains of the two languages don&#x27;t intersect very much.
alvil超过 8 年前
It&#x27;s not true that Go requires import &quot;fmt&quot; to print something.
评论 #13434106 未加载
waynecochran超过 8 年前
No mention of functional programming and the idiomatic async calls using closures made popular as of late by JS?
评论 #13432976 未加载
评论 #13432402 未加载
zatkin超过 8 年前
I&#x27;m confused as to why this piece was written using LaTeX.
评论 #13432271 未加载
评论 #13432104 未加载
评论 #13431342 未加载
评论 #13431353 未加载