continue-custom/docs/docs/languages/swift.md
2023-11-08 16:38:17 -08:00

4.2 KiB

Swift

Swift is the #21 most popular language according to the 2023 Stack Overflow Developer Survey.

Benchmarks

✅ Swift is one of the 19 languages in the MultiPL-E benchmark

❌ Swift is not one of the 16 languages in the BabelCode / TP3 benchmark

✅ Swift is one of the 13 languages in the MBXP / Multilingual HumanEval benchmark

❌ Swift is not one of the 5 languages in the HumanEval-X benchmark

Datasets

✅ Swift is included in The Stack dataset

❌ Swift is not included in the CodeParrot dataset

❌ Swift is not included in the AlphaCode dataset

❌ Swift is not included in the CodeGen dataset

❌ Swift is not included in the PolyCoder dataset

Stack Overflow & GitHub presence

Swift has 331,145 tagged questions on Stack Overflow

Swift projects have had 425,921 PRs on GitHub since 2014

Swift projects have had 325,962 issues on GitHub since 2014

Swift projects have had 1,334,455 pushes on GitHub since 2014

Swift projects have had 2,731,776 stars on GitHub since 2014

Anecdotes from developers

u/[deleted]

Just a general tip: even though it's a bit out of date, chatgpt will answer these questions much faster and sometimes more accurately than Reddit can. I've pretty much replaced Google with chatgpt and my productivity is up and stress is down. For questions about the newest SwiftUI stuff try Google Bard. The LLMs aren't perfect. There's still a place for Reddit and stack overflow, but I'd check with an LLM first.

u/Zagerer

I've tried copilot with SwiftUI and it's good for auto generating some things like specific styles, but not so good for other parts. Sometimes it helps with unit tests,but others it gets stuck in a loop.

u/AppleHitMyHead

Here is my journey coming from C++: Read through "A Swift Tour" and follow along in a Swift Playground. Many times, I feel, "Huh, this part is so much better than C++.", or "This is pretty much the same," I don't force myself to learn everything though, for example, I skipped protocol entirely. This process took me a few hours. As I dug into SwiftUI, I ran into syntax I didn't understand. Instead of looking up the official document, I just Google or ChatGPT it. When I start doing things in a C++ way that I always hate, I often pause and search if Swift does it better. Oftentimes times, Swift does do it better! Still, I carry some baggage from C++ and later notice if I had done it differently, I would have saved myself a lot of trouble (for example, really thinking about whether things can be null or not). Don't be afraid of re-writing; it is part of the process. Today, I am still learning; however, I started to catch myself speaking in C++ "accent" using Swift, and oftentimes, I can Google/ChatGPT my way out of it.