N
N
NikolayDe2015-07-06 17:36:27
Swift
NikolayDe, 2015-07-06 17:36:27

What is the qualitative difference between the Swift programming language and other languages?

Hello.
I want to appeal to people who have experience in developing in Swift.
My question is, Apple writes:
"Swift's unique combination of elegance, power, and safety has the opportunity to move the entire software industry forward."
Is this just marketing, or is there something unique about Swift that other languages ​​don't have, or something that makes it better than other languages?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Tikhonov, 2015-07-08
@tikhonov666

The functionality of enums, structures has been expanded - in many respects they are now similar to classes.
enum Barcode {
case UPCA(Int, Int, Int, Int)
case QRCode(String)
}
Closures (lambda, blocks), sorting can be written
reversed = sorted(names, { (s1: String, s2: String) -> Bool in return s1 > s2 } )
reversed = sorted(names, { s1, s2 in return s1 > s2 } )
reversed = sorted(names, { s1, s2 in s1 > s2 } )
reversed = sorted(names, { $0 > $1 } )
reversed = sorted(names, >)
Error handler
enum CarEngineErrors: ErrorType {
case NoFuel
case OilLeak
case LowBattery
}
func checkEngine() throws {
guard fuelReserve > 0.0 else {
throw CarEngineErrors.NoFuel
}
...
}
Swift in open source

N
nadi9, 2015-11-03
@nadi9

I would also add
Strong typing
Optionals
Generics
Tuples
No garbage collector
The flexible use of parentheses and semicolons makes Swift handy when migrating from other languages. In general, Swift has absorbed the properties of many languages.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question