Hi all
I've been a web developer for quite some time, and last year I start diving into this "Swift" and "SwiftUI" app development thing.
While I mainly focus on app development, there are some options on framework/language to choose: React, Flutter, Swift, Android.
I also have moderate experience on other language like Python, PHP, JS, Go etc etc.
Up to this moment and this version of Swift (v5), the development experiences of Swift is: Worst.
I can only see that Swift is making simple things complicated, and difficult to read.
For example, a simple ForEach loop:
In PHP:
foreach($list_of_items as $item){
...
}
But in Swift:
ForEach(0 .. <5){ item in
...
}
At the first glance, it is so weird to put item outside the ForEach loop, until we read further and know that item is a parameter. I don't even know what the in keyword is all about.
But if you are using format like PHP, you don't need another keyword in.
And this is how Swift write try...catch
do {
try checkPassword("password")
print("That password is good!")
} catch {
print("You can't use that password.")
}
Why can't Swift just do this, just like other programming language (Python, PHP)?
try{
...
}catch{
...
}
We can save another keyword do
And do you know how to use Camera features in iOS app? The template code is long and there are a lot of settings before writing the code so I don't put it here.
And actually, there are some 3rd parties Camera libraries that do the same thing?! That simplify the setup process.
Why can we use Swift native camera function like this:
objCamera = new Camera(some_configs)
objCamera.takePicture()
objCamera.close()
This really make me walk away from Swift.
So, here is my little suggestion: I hope that the next version of Swift can make things less complicated, and easy to use.
I'm not talking about syntax sugar, but really, writing easy to understand program is actually the joy of development.
Thank you.