Summary

When we are developing an application in a team environment, it is important to have a well-defined coding style that is adhered to by everyone on the team. This allows us to have a code base that is easy to read and maintain.

If a style guide remains static for too long, it means that it is probably not keeping up with the latest changes within the language. What is too long is different for each language. For example, with the C language, too long will be defined in years, since the language is very stable; however, with Swift, the language is new, and changes are coming pretty often, so too long can probably be defined as a couple of months.

It is recommended that we keep our style guides in a versioning control system so that we can refer to the older versions if need be. This allows us to pull the older versions of the style guide and refer back to them when we are looking at older code.

It is recommended, not only with Swift but other languages as well, that you use a Lint tool to check and enforce good coding practices. For Swift there is a great tool called SwiftLint (https://github.com/realm/SwiftLint) that has a command-line tool and an Xcode plugin as well as integration with other IDEs.

In the next chapter, we will look at some of the Swift core libraries.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset