Settings

Theme

Google Swift Style Guide

google.github.io

55 points by dkmar 8 years ago · 10 comments

Reader

weiming 8 years ago

Is there any data on Swift adoption among the popular apps/companies? E.g. last I remember hearing, Facebook was still on ObjC/C++, but Uber has gone all in.

One use at Google is internal tools according to this post: https://news.ycombinator.com/item?id=15701107

  • foobarbazetc 8 years ago

    We’re medium sized and our iOS app is something like 200k+ LOC of Objective-C. We started our rewrite (where we replace each .m with a .swift) when 4.0 became available.

    It’s been nice because Obj-C is a terrible language, but the worst thing about Swift (so far) is value types for collections. Just a terrible idea with no real benefit as far as I can see (someone will say COW something something concurrency something. But nothing concurrent is provided and all the code out there is just giant locks on base collection types. java.util.concurrent.* is unmatched)

brazzledazzle 8 years ago

Someone made a comment and deleted it that I’ll reply to here for them. One of their complaints was about spaces vs tabs and having to smash arrow keys.

I’m about to blow your mind (definitely blew my mind ages ago when I first learned about it):

Windows/Linux: Ctrl+arrow

Mac (rarely apps do ctrl but usually you can remap): Alt+arrow

This jumps words and will let you get around your lines much, much faster.

Of course vim or vim plug-ins would be useful to learn too, but you shouldn’t need to learn a whole new paradigm to navigate more efficiently.

  • qop 8 years ago

    I share this at work every now and then and I'm always shocked people never tried it. Seems obvious to me.

  • earenndil 8 years ago

    I use vim and thus repeatedly pressing directional keys has never been my primary concern. That said, I use tabs.

himom 8 years ago

https://github.com/kciter/awesome-style-guide/blob/master/RE...

tempodox 8 years ago

The nice thing about style guides is that there are so many of them to choose from.

melling 8 years ago

I don’t suppose there’s an Xcode/AppCode plug-in that handles most of this automatically, or with warnings?

Personally, I think every language should include its over version of gofmt.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection