What is the characteristic of Swift
Swift: 10 compelling language features
Like any new programming language, it also brings Swift some features that set it apart from other languages. Still, there is one important difference to languages like Ceylon, Clojure, Darts, Go, Kotlin, Scala and as they are all called: Due to the clear positioning of Apple too Swift the latter will very likely soon be one of the most widely spoken languages overall. Correspondingly stands out Swift characterized less by innovative and experimental features than by a clear mainstream focus.
The following list shows ten outstanding features of Swiftdesigned to support software developers in their actual tasks. Some of the features can also be found in a similar form in languages such as C #, C ++ and Java. But in this combination they are new and groundbreaking for contemporary software development.
- Almost an old shoe, but unfortunately it is still not a matter of course Type inference for local variables. Undoubtedly, there are many cases where an explicit type specification helps readability - what Swift also supported - but in most cases less is simply more.
- Consistently sets Swift on Properties instead of member variables. The so-called Getter and Setter methods become superfluous, which makes a significant difference, especially for Java developers, who typically have a particular tendency to do so.
- Contrary to the name, most of the local variables are now used for immutable data. Programming languages support this with key words such as and, which are often omitted for the sake of readability. Swift turns that around and puts on Immutability-By-Default. For example, parameters must be explicitly marked with in order to be able to change them in the body of the method, and methods of value classes can only change the state if they are declared as.
- Often you want to summarize a few attributes without defining a new class. Swift supports this through in the language built-in tuples, whereby the elements can optionally be named. It is particularly interesting to use a method as a return type to simulate several return values.
- To avoid the Nile pointer problem, the type system differs from Swift between references that can be (optional) and those that always refer to an object. These are accompanied integrated optionals a special instruction as well as several operators in order to implement the most common concatenations briefly and concisely.
- In addition to literals for numbers and strings, Swift also Literals for arrays and dictionariesThe latter in particular visibly improves readability compared to variants without language support.
- Swift supported named parameters, i.e. when a method is called, the name of the parameter is also specified. It is noteworthy that the specification of the name when calling up can be mandatory and is also required for all parameters except the first without any further action.
- As Enumeration with Associated Values Swift denotes a data type that is most closely related to Case classes is comparable in Scala. It enables variant formation over unrelated data types including support for Pattern matching. In other programming languages, however, the inheritance mechanisms are often violated for variants.
- In particular, C ++ has the deterministic de-initialization popularized, which can also be found in Swift finds again. It solves the problem finally and try-with-resources equally simple and reliable - and without shifting responsibility to the user of the class.
- In Swift classes can be added without changing the code Class extensions expand. This applies to both methods, properties and protocols. This is insignificant for self-developed code - but it is essential for the integration of third-party libraries.
The list contains just a few of the many features of Swift. But the direction is clear: agility with sustainability, pragmatism instead of dogmatism and generalization instead of specialization. Overall power Swift a very good impression. The only question that remains is whether it will also be used outside of Apple's platforms.
- Why is the clock not moving counterclockwise?
- Do psychopaths sociopaths care about money
- What is Krishnadevaraya's contribution to Telugu
- Can replace Kotlin Scala in data science
- How are GATE grades calculated
- Can Trump survive the latest scandal?
- The rain would stop
- What was the last song recorded by Lata Mangeshkar
- Can Quora boards replace Internet forums
- Are there rednecks in Russia
- What is the M390 steel folding knife
- What's wrong with the University of Edinburgh
- What is Lukas Graham's most successful song
- Should I help everyone
- What are some crazy taxi experiences
- What is the name of a dress with a high waist
- Is glutaraldehyde a physical hazard
- Christians eat pork
- What is a mother's obligation
- What dating advice needs to be debunked
- Which sleeping pills are not addictive
- What are the most contagious diseases
- Could humans sterilize the earth?
- What's your favorite Prince song
- License plates are random
- Who are the best bespoke tailors in Shanghai
- Where can I find the best Tableau tutorials
- What makes GitHub so special
- How do users use LogMeIn
- What is spatial resolution
- What is your favorite piece of underwear
- Can training with the tube increase muscle size
- Do liberals realize that most bankrupts are liberals