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

What every JavaScript developer should know about Unicode

This story starts with a confession: I was afraid of Unicode for a long time. When a programming task required Unicode knowledge, I was searching for a hackable solution for the problem, without detailed sense what I was doing. My avoiding continued until I faced a problem that required detailed Unicode knowledge. There was no way to apply situational solutions. After applying some efforts, reading… Continue reading

The art of writing small and plain functions

The complexity of software applications is growing. The code quality is important in order to make the application stable and easily extensible. Unfortunately almost every developer, including myself, in his career faced with bad quality code. And it's a swamp. Such code has the following harmful characteristics: Functions are too long and do too many things Often functions have side effects that are difficult to… Continue reading

How to iterate easily over object properties in JavaScript

I like my code to be elegant and efficient. The logic should be straightforward to make it hard for bugs to hide, the dependencies minimal to ease maintenance [...]. Clean code does one thing well. Bjarne Stroustrup, inventor of C++ In the same period of ECMAScript 2016 release in June 2016, JavaScript developers are happy to know that another bunch of awesome proposals reached the stage… Continue reading

Make your JavaScript code shine: knockout old ES5 hacks (Part 2)

Many developers were frustrated about JavaScript, especially before ECMAScript 2015 standard. And they had the right too: the language is known for its weakness and initial design drawbacks. How did it happen? At the beginning of the web era, no one did know how exactly the web will look in 10 - 15 years. And especially that a small Java's brother JavaScript will become the… Continue reading

Make your JavaScript code shine: knockout old ES5 hacks

It's known that before ECMAScript 2015 JavaScript language was tricky. For simple scripts ES5 code works fine. But as soon as the application complexity grows, you start to feel that the lack of language constructs is making your code unpleasant. Because you have to implement the application requirements, you can't jump over the parts of code that are troublesome to implement in ES5 style. The… Continue reading

Detailed overview of well-known symbols

Symbol is a new primitive type available from ECMAScript 2015, which allow to create unique identifiers let uniqueKey = Symbol('SymbolName'). You may use symbols as keys of properties in objects. A list of symbols that JavaScript treats specially is published as well-known symbols. Well-known symbols are used by built-in JavaScript algorithms. For example Symbol.iterator is utilized to iterate over items in arrays, strings, or… Continue reading

JavaScript variables lifecycle: why let is not hoisted

Hoisting is the process of virtually moving the variable or function definition to the beginning of the scope, usually for variable statement var and function declaration function fun() {...}. When let (and also const and class, which have similar declaration behavior as let) declarations were introduced by ES2015, many developers including myself were using the hoisting definition to describe how variables are accessed. But after more… Continue reading

Why object literals in JavaScript are cool

Before ECMAScript 2015 object literals (also named object initializers) in JavaScript were quite elementary. It was possible to define 2 types of properties: Pairs of property names and related values { name1: value1 } Getters { get name(){..} } and setters { set name(val){..} } for computed property values Sadly, the object literal possibilities match into a single example: Try in JS Bin var myObject = { myString: 'value 1', get myNumber(… Continue reading