Question: "Which features overcomplicate Swift? What should be removed?"
I really can’t think of anything! This is a tough question…
See, Objective-C first had quirky memory management. It was overly expressive, method names were just too long. Blocks sort-of worked, but they weren’t real closures. There wasn’t a lot of safety built in, and I don’t regard it as a productive, fun to work with, language. Regardless, it got the job done.
Then, Swift came along.
Here’s what I like about Swift:
- Optionals. Tricky at first, I thought: can’t we just leave all the !’s and ?’s and just get back to check if a variable is nil? Then, I realized optionals make your code stronger, by checking at compile-time whether a variable is not empty and usable.
- Closures. Great for throwing in code that’s not part of your code structure.
- Generics. Sort-of closures turned inside-out, writing code that has a specific goal or intent regardless of what types you put in.
- Optional chaining. How many times did I write numerous if-statements to dig into a JSON structure to find out whether a variable existed? Not anymore!
Then, Swift is expressive and concise, which makes it easier to pick up for beginner developers. The language grows with you as you learn, and has plenty of fun stuff for advanced developers. And code doesn’t need to be rewritten from ObjC to Swift, thanks to the bridging headers, any library out there is usable in a Swift project.
One point of critique? Well, the compiler tends to get slow on bigger projects, especially when you do compiler-heavy stuff like type inference. And, random Xcode crashes occur from time to time. But on Swift itself? Nope.
I think Swift was made to alleviate the overcomplication of Objective-C, and to give app developers a language that’s not invented in 1983.
Join 11.000+ app developers and marketers
- Every Monday: get curated app marketing news, resources, tools and goodies in your inbox
- Grow your app's userbase with the latest App Store Optimization and app marketing strategies
- FREE: Get the free step-by-step Get Started With Your App Idea guide to set yourself up for App Store success!
Comments & Thoughts
On The Blog
10 Networking Tips For Your iOS Development Career
So you’re a junior iOS developer, starting out in your new career. But finding your first job isn’t as easy as you thought. You’ve got the skills, but without the experience you’re struggling to even get an interview. Don’t worry, if you follow our tips you’ll soon be getting some much needed human contact again, and a job to boot!
How Do App Makers Become Rich in a Year, Month, Week or Overnight?
We all know the stories. A 12-year old makes an app and it becomes a success overnight. An unknown indie game developer becomes world-famous in a matter of hours and makes millions. How do they do it? What makes an App Maker successful and more important: how do you get rich fast making apps?
App Failure: Match Around for Location-Based Dating
In the spring of 2011 I started working on an app concept called Match Around, it's GPS-based real-life matching and dating. Together with a marketing agency I worked out the first version of the application, tested it at a music festival and even pitched it to a multinational. What led to the demise of this app?