TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Swift Style Guide by GitHub

88 pointsby hacker_userover 9 years ago

6 comments

potatosareokover 9 years ago
What does Github write that uses Swift? I thought they didn't have an iOS app and I figured their desktop app was some node-webkit or electron based thing based on it being 27mb download.
评论 #10967767 未加载
评论 #10967472 未加载
评论 #10968582 未加载
评论 #10975679 未加载
评论 #10968461 未加载
rsendvover 9 years ago
Lost me at "Tabs, not spaces." :p
评论 #10966731 未加载
评论 #10972384 未加载
评论 #10967194 未加载
评论 #10968904 未加载
评论 #10967879 未加载
gregdoesitover 9 years ago
The thing that strikes me is how much shorter a Swift style guide is, compared to an Objective C one. E.g. <a href="https:&#x2F;&#x2F;github.com&#x2F;raywenderlich&#x2F;objective-c-style-guide" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;raywenderlich&#x2F;objective-c-style-guide</a><p>This fact tells a lot about the langage. The language is pretty strict as to what it allows to write and reduces the need of a style guide to specifying best practices.
glhaynesover 9 years ago
I&#x27;m not so sure about &quot;Make liberal use of vertical whitespace to divide code into logical chunks.&quot; — it&#x27;s my tendency to add a lot of vertical whitespace as I write code, but the more I go back and remove it, the more I&#x27;m convinced that it wasn&#x27;t really helpful and that whatever little help it <i>did</i> provide was far outweighed by how much less context could be seen on the screen at one time.<p>I think of it kind of like prose: we organize related sentences into paragraphs and then have little or no extra vertical whitespace between paragraphs. If you ever find yourself thinking you need some extra level of hierarchy division within a paragraph, you&#x27;re likely really just needing a new paragraph.
评论 #10989273 未加载
tempodoxover 9 years ago
&gt; <i>Fewer debates about aesthetics</i><p>Are you kidding? You just added one. De gustibus non est disputandum.
评论 #10966775 未加载
vemvover 9 years ago
&gt; Not even leading indentation on blank lines.<p>Ugh. I wonder how is this a real issue?<p>Non-indented blank lines ARE an issue though - they make code editing more cumbersome, requiring pressing the tab key far more often.<p>Also, tabs are for bros.
评论 #10967035 未加载
评论 #10968429 未加载