Tag: swift

Swift and Kotlin are two great languages for iOS and Android development respectively. They both have very modern features and syntax that can help enormously to build native apps. But, how do they both compare to each other? Are they similar? Can we reuse more code between platforms if we adopt them in our projects?

Those are the questions we will explore in this post together with some real app code examples implementing the same features in both languages.

Naming conventions are very important in software development for many reasons, but especially for readability. According to Wikipedia:

Reasons for using a naming convention (as opposed to allowing programmers to choose any character sequence) include the following:

to reduce the effort needed to read and understand source code

to enable code reviews to focus on more important issues than arguing over syntax and naming standards.

to enable code quality review tools to focus their reporting mainly on significant issues other than syntax and style preferences.

So, what is a good name? This issue is controversial because there are multiple dogmas and styles out there. In Swift, despite being a young language, naming conventions are quite established already (with Swift 3), and includes guidelines about casing, naming parameters, methods,... However, there is no “defacto” way to name your implementation classes when you use protocols as a public abstract API and how to group code inside namespaces/modules.

For those of you who attended the iOSX Enterprise Summit, here is my presentation about good practices for writing clean code.

What exactly is clean code? is your code clean? how can you improve your code quality? In this presentation we will answer these and other questions by exploring some of the general principles that any clean code should have. The presentation will cover very different levels of abstraction, going from the lowest ones to build up to the highest ones.

We will get started by defining "clean code" and understanding why readability is so important. We will dive into good codestyle practices by analysing naming conventions, code formatting, comments... We will then continue with good practices whenwriting functions, methods or classes; and finish up with some of the most useful software design patterns applied to mobile platforms.

All along the presentation we will show specific code examples written in Objective-C and/or Swift that expose some of the most common anti-patterns found in iOS development. By the end of the presentation you will be able to quickly detect anycode smell in your project and you will be better prepared to write a "cleaner" alternative.