Friday, June 06, 2014

Dear Apple, please make Swift more fun

Dear Apple,

it was with great pleasure that I see you enjoy 3 letter key words.  Your use of 'let' and 'var' were inspired!  These allow people to line things up nicely in a 4 space world.  With 3 letters for the keyword, and 1 for the space.  Brilliant!

However python has more elegant type setting than Swift in this case.  It uses "def" rather than "func".

It is not too late to make Swift more fun!

For your consideration:

func sayHello(personName: String) -> String {
    let greeting = "Hello, " + personName + "!"
    return greeting
} 

... now let's remove that c at the end of func...

fun sayHello(personName: String) -> String {
    let greeting = "Hello, " + personName + "!"
    return greeting
} 


See how the function name nicely lines up with the variables below!  That is type setting gorgeousity right there that is!

Pretty please, think hard about renaming func.  To either "fun" or to "def".


Thank you,
René.