Jump to content

Talk:Swift (programming language)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by SineBot (talk | contribs) at 08:15, 8 June 2017 (Signing comment by 27.0.3.145 - "Should "Kotlin" be a "Influenced by" entry?: new section"). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Not possible to read as standalone

This article is hard to follow for anybody who does not have good prior Objective-C knowledge. It reads more as a history of the language design than an introduction to the language itself. I think Swift (as other PLs) should be presented standalone rather than in a "while language X has feature Y, Swift was designed with feature Z because..." way. I do not have the necessary expertise to do it, however. --Alien Life Form (talk) 06:56, 8 April 2016 (UTC)[reply]

Example code is not example code

The section Example code is a series of short demos, introduced step-by-step; WP avoids anything like "how-to" info. Instead, example codes are supposed to give a feel for what actual code looks like, without any how-to. As such, it should also be fairly small -- certainly no more than a page. This was noted in a discussion above a year ago, and nothing has changed.

If someone can't give a an example of a Swift program, I'm for just removing it. --A D Monroe III (talk) 23:08, 18 July 2016 (UTC)[reply]

I agree that it's a poorly written examples section. I'm not sure about deleting it completely, since it's a useful thing to have in a programming language article, but I wouldn't mind rewriting it. I could rewrite it as a couple of example programs (maybe Hello World and a slightly longer one) with a short description? Go and Perl seem to have well-written examples. I just noticed that Python doesn't have one, though, so I guess it's not universal. Pianoman320 (talk) 23:33, 18 July 2016 (UTC)[reply]
I'm all for having an example; I'm just against this one. A new example of true simple use of Swift would be great, or two examples if the first is Hello World and the second is short. --A D Monroe III (talk) 14:59, 19 July 2016 (UTC)[reply]
I think we should provide a properly referenced example as Wikipedia requires. Is anyone against that? Dgraemer (talk) 18:09, 19 July 2016 (UTC)[reply]
The section can be shortened, but other than that I see no reason to make big changes to it. Apple’s documentation provides the ‘proper references’ for the syntax, the rest can be original.–Totie (talk) 18:28, 19 July 2016 (UTC)[reply]
That is not possible as Wikipedia does not allow original research. Everything must have references. Dgraemer (talk) 19:06, 19 July 2016 (UTC)[reply]
It would be very disruptive to apply OR to that level; more than half of WP would have to be deleted. Showing a simple example program is WP:BLUE to anyone that programs in the language, and helpful to other readers. Let's focus on helping them. --A D Monroe III (talk) 20:16, 19 July 2016 (UTC)[reply]
You must provide a reference, as a program is not something trivial that everyone knows. Dgraemer (talk) 21:41, 19 July 2016 (UTC)[reply]
There are literally millions other articles to pursue this on with more cause than here. Persisting here is only disruptive. The claim is off-topic anyway. No more responses to this. --A D Monroe III (talk) 21:52, 19 July 2016 (UTC)[reply]

Swift is the bank infrastructure for messages/payments

See http://www.riksbank.se/sv/Finansiell-stabilitet/Finansiell-infrastruktur/System-i-den-svenska-infrastrukturen/SWIFT/ --Mats33 (talk) 00:27, 18 September 2016 (UTC)[reply]

Someone Should Check Struct Copy On Write

"To ensure that even the largest structs do not cause a performance penalty when they are handed off, Swift uses copy on write so that the objects are copied only if and when the program attempts to change a value in them. This means that the various accessors have what is in effect a pointer to the same data storage, but this takes place far below the level of the language, in the computer's memory management unit (MMU). So while the data is physically stored as one instance in memory, at the level of the application, these values are separate, and physical separation is enforced by copy on write only if needed.[46]"

I am just learning Swift, but I know MMU's and this makes no sense for a struct that is not larger than at least a page, which is larger than most structs. The reference [46] is a long video, I scanned through it but could find no mention of this. Someone who knows Swift might either find a better reference if this paragraph is true, remove this paragraph if it is false, or qualify it that it is only used for large structs if that is the case. 73.93.154.221 (talk) 01:47, 22 December 2016 (UTC)[reply]

Is this a sales promotion?

Is the preamble/intro section written by the Apple sales dept? — Preceding unsigned comment added by Hence Jewish Anderstein (talkcontribs) 17:25, 30 January 2017 (UTC)[reply]

@Hence Jewish Anderstein: Someone added a {{advert}} template to this article last year, and it's still here. I still don't see anything wrong with the lead section. Does anyone know why this cleanup tag was added to this article? Jarble (talk) 07:37, 16 May 2017 (UTC)[reply]

Should "Kotlin" be a "Influenced by" entry?

Swift seems similar in terms of syntax to Kotlin. Take a look at this comparison: http://nilhcem.com/swift-is-like-kotlin/ Should "Kotlin" be a "Influenced by" entry? — Preceding unsigned comment added by 27.0.3.145 (talk) 08:12, 8 June 2017 (UTC)[reply]