Kakay
(Kakay)
1
Variables are declared like
var myVariable:String?
or containing prefixes like private, fileprivate, lazy, etc.
Computed variables start the same way. So they are easily differentiated from functions.
Do functions have to have "func" at the beginning?
Example:
override func viewDidLoad() {
super.viewDidLoad()
doSomething()
}
could be written as
override viewDidLoad() {
super.viewDidLoad()
doSomething()
}
What do you think?
This is a massive breaking change without a single benefit except for not needing to type 5 characters. My personal response to this will be: -1
17 Likes
toph42
(Topher Hickman)
4
There needs to be a compelling reason for the change. Do you have anything besides βit saves a few characters?β
1 Like
NobodyNada
(NobodyNada)
5
Consider the following, under your proposed syntax:
foo(_ someClosure: () -> ()) {
// ...
}
foo() {
// ...
}
Is the second statement declaring a new function overload, or calling the first function with a trailing closure?
11 Likes
-1, It provides no functionality to remove the keywords.