SWIFT: func should be called function

Originator:m.hatzung
Number:rdar://17656501 Date Originated:5/6/2014
Status:Open Resolved:
Product:Developer tools Product Version:
Classification: Reproducible:YES
 
keyword func should be changed into function

Comments

...

Seriously?

I personally think this kind of radar is just a huge waste of time for everybody...

If you never tried AppleScript, then go for it... Then come back and tell us what you think about "readable" code...

👎

Like @taichino said, do you really want var to be variable? While func and var are abbreviations, they are used so frequently and on lines of code that can already be long, I don't see a problem.

return is usually followed by a local variable or a short expression and has no modifiers like methods do so I see no reason to abbreviate it.

Is the radar # correct?

It looks like the radar # is much higher than any other recently submitted.

By christoffer at June 18, 2014, 12:58 p.m. (reply...)

Actually, there are already some abbreviations and acronyms like id, byref, IMP, SEL, etc. And Its 100% obvious for all developers that func means function and var means variable.

We don't have to be a perfectionist and Swift doesn't have to be restricted by Cocoa convention. Imagine swift can be used in other platform like node.js. Do you wanna type "variable" in these context?

Exactly!

@owensd: Then, maybe we could shorten "return" to "ret". And when we're on it, let's shorten everything and create a cryptic mess. Please, just learn how to type properly.

See also: http://openradar.appspot.com/radar?id=5547248897228800

Boo! func or def, too much typing, especially as modifiers are added and names for parameters. Let's keep the function definition to one line.

We are in a Cocoa & Cocoa Touch world. Abbreviations are bad! function should be to right keyword.

By david.w.hart at June 6, 2014, 4:39 p.m. (reply...)

fn or fun are more common abbreviations… if function going to be shortened, it might as well be really short.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!