/* Smart *///for function naming in Swift 1. In general, we write a function that is so written in Func SayHello (name:string, greeting:string) { print ("\ (greeting), \ (nam e)}//call, this function does not read very well in accordance with human reading habits SayHello ("Rinpe", Greeting: "Hello")//2. The following is a modification to this function, func sayhelloto (name: String, withgreeting:string) { print ("\ (withgreeting), \ (name)")}//called so that it is comfortable to read, like reading a sentence Sayhelloto (" Rinpe ", withgreeting:" Hi ")//3. But then there is a problem, that is, the function of the internal direct use of the external name is very awkward, so we can define an internal name Func Sayhelloto (name:string, Withgreetingworld greeting:string) { print ("\ (greeting), \ (name)")}//is called like this, both to ensure that the reading is comfortable and ensure that the function is also comfortable to use inside:) Sayhelloto ("Rinpe", Withgreetingworld: "Hi")//4. Another case is that when the function performs a specific operation, the function name uses the verb directly, omitting the external parameter name, for example: Func multiply ( Numberone:int, _ Numbertwo:int), Int { return numberone * numbertwo}//is called so that it represents two numbers multiplied by a similar function: Max (x:t, y: T) Multiply (10, 10)
Recommendations for definition of Swift functions