I spoke on November 7 at the Swift Summit in San Francisco’s Palace of Fine Arts on pushing the boundaries of Swift to the server. It’s a subject area that has been generating a huge amount of interest and talk within the Swift development community. This perhaps isn’t surprising, as developers and mobile application developers, in particular, are generally innovative individuals who like to try out new tools and technologies.
As part of the Swift Summit session, I thought it was important to spend some time discussing not just that you could use Swift on the server for the back-end components of iOS mobile applications, but why you should. I also wanted to share some fundamental reasons why server-side Swift isn’t just an interesting technology, but one that will escape the hype bubble to become a fundamental component of real applications.
The themes I discussed really fall into the three following categories:
These are all important, regardless of the size of the application being developed or the team doing the development work.
Collaborative and flexible development
One of the immediate advantages of being able to use Swift for both the client and server components of an end-to-end application is the ability to break down development silos. When different languages are used on the client and server — for example, Swift on the client and Ruby on Rails for the server — it naturally leads to a division of the ownership of the two components between two distinct teams. This leads to challenges around communication and visibility, project planning and resource assignment.
Swift’s advantage is that it can be used for both parts, allowing those divided, siloed teams to be brought together. This enables each team to be able to view and review the other team’s work as it is implemented in a language they understand. It also allows individuals to be easily moved from working on one component to another based on project demands and resource availability.
Improved application quality
As well as enabling individual developers to move between components, another huge advantage is being able to share and move code between components. At the most basic level, artifacts such as data models used on the client that need to be stored off-device on the server can be reused on both sides. In more advanced cases, parts of the application function that are currently carried out on the server could be easily moved to the client in order to enable users to do more tasks offline.
This brings increased flexibility and improved quality into the application. Rather than requiring independent implementations of items such as the data model to be created in different languages for the client and the server, the same code can be used in both places, ensuring consistency and lessening the chance of these discrepancies inadvertently creating bugs.
Performance, scalability and total cost of ownership
Finally, Swift is a highly performant, compact language, which makes it easier to provide a scalable server component and to reduce hosting costs. In programming language terms, Swift is part of a group of modern native languages alongside languages such as Go and Rust that are seen as potential replacements for C and C++. They are statically compiled and strongly typed like C but have more advanced ease-of-development characteristics such as inferred typing and automatic memory management. This makes the developer experience more like that of an easy-to-use scripting language such as JavaScript, Node.js or Ruby.
The net of this means they are fast and comparable to high-performance languages like C++ and Java. They’re also much faster than scripting languages such as JavaScript, Node.js or Ruby, while remaining compact and using much less memory than the other languages. This becomes crucial for application scalability and hosting costs, as it means you need fewer application instances for a given workload and they can be more densely packaged.
The combination of these types of capabilities means there was rightly a lot of buzz at the Swift Summit about Swift on the server, not just because it’s an interesting technology for developers to experiment with, but also because it provides fundamental advantages for end-to-end mobile application development.
The post Swift Summit speaker explains why developers should build end-to-end apps in Swift appeared first on Mobile Business Insights.