7 tips to handle undefined in JavaScript

When I started to learn JavaScript about eight years ago, a bizarre situation for me was the existence of both undefined and null that represent empty values. What is the clear difference between them? They both seem to define empty values, and moreover the comparison null == undefined evaluates to true. Most of the modern languages like Ruby, Python or Java have a single null value… Continue reading

Announcing Voca: The ultimate JavaScript string library

Open source changed the software development. And it changes the developers. Many libraries, apps, servers, and much more are powered by open source software. Catch the open source wave I always wanted to create and maintain an open source project. It is a must experience for every software developer. This way I started to work on a JavaScript library called Voca. It's main scope is… Continue reading

Make your Swift code expressive: addition operator use cases

I like reading short and expressive code. Because developer spends more time reading code than writing, expressiveness often is obligatory. Unless shortness does not obscure the intent, I favor concise expressions over longer ones. For example: Try in Swift sandbox import Foundation let greeting = "Hello, " let who = "World" let message1 = greeting + who let message2 = greeting.appending(who) print(message1) // => "Hello, World" print(message2) // =>… Continue reading

How to use correctly 'self' keyword in Swift

In Swift self is a special property of an instance that holds the instance itself. Most of the times self appears in an initializer or method of a class, structure or enumeration. The motto favor clarity over brevity is a valuable strategy to follow. It applies efficiently in most of the cases, and helps to increase the code readability, but... affects code shortness. Applying this… Continue reading

Mastering Swift: tips about array and dictionary literals

Imagine you have a bunch of delicious candies 🍬, about 20-30 items. Normally a person can eat about 2 or 3 candies per day. To deal easier with a lot of candies, it makes sense to keep them in a single place. And reasonable this place is a plastic bag or a small box, instead of keeping them spread around and messy on the table.… Continue reading

Useful details about underscore keyword in Swift

Swift is known for its ability to help creating readable and self explanatory code. Such practice is efficient, because writing meaningful code has a big impact on understanding: and as result on productivity. The language offers useful syntax to improve the readability using argument labels, or to access a tuple or structure component. For instance the following function returns a tuple that contains the minimum… Continue reading

Coding like Shakespeare: practical function naming conventions

What a piece of work is a man! How noble in reason, how infinite in faculty! Hamlet, William Shakespeare Code is prose. Clear and meaningful prose is easy to read and follow. Everyone enjoys reading such prose. The same quality should apply to source code. The way developer express his thoughts through a programming language is important. Writing code is communication: with your teammates and… Continue reading

Mastering Swift: essential details about strings

String type is an important component of any programming language. The most useful information that user reads from the window of an iOS application is pure text. To reach a higher number of users, the iOS application must be internationalised and support a lot of modern languages. The Unicode standard solves this problem, but creates additional complexity when working with strings. On one hand, the… Continue reading

Useful tips for migrating to Swift 3.0

Not long ago the 3.0 version of Swift language was released. The new version is available in Xcode 8, or you can download the compiler directly from swift.org. The new version has a lot of improvements in terms of code readability, function invocation consistency, better naming conventions and the removal of some C-style elements. In terms of readability, the NS prefix is dropped… Continue reading

The path of software development craftsmanship

The software development complexity is increasing day by day. Almost every year a new framework (like AngularJS, ReactJS) is released, new build tool (like Webpack, Rollup). Even new JavaScript versions (ECMAScript 2015, 2016 and soon 2017) are released every year! Generally the same situation exists in other fields of software development. For example mobile applications. 2 years ago Apple introduced a new programming language Swift.… Continue reading