October 12, 2016

Performance at its (CPU-) Core

Who should read this?

This article will be interesting for you if you:
    • Are trying to decide which hardware to buy;
    • Are designing a service that is supposed to run on a specific hardware specification;
    • Are an operator like me; or,
    • Generally like to fiddle around with hardware and tune system performance.

    October 04, 2016

    Launching a new product – from zero to native couponing

    Recently, we successfully launched native couponing in our Android and iOS Apps. Providing coupons with discounts in various areas provides benefits to the approximately 1 million people who use our mobile services on a regular basis. Our users collected more than 15,000 coupons in just the first couple of weeks after launch.

    Launching a completely new product is always a challenge, especially if you have a lot of stakeholders – product managers, digital advertisers, sales people, developers, quality assurance specialists, etc. just to name a few. All of them are involved in building great products for our users.

    From the viewpoint of a technical project lead, it is challenging to meet all the functional and non-functional requirements. This blog post shows how we bootstrapped a new product from the technical side, from zero to getting it into production; which technology we used; which architecture fits our requirements; how we embedded it in the existing infrastructure; and, most importantly, what to avoid. This article will cover these topics at a high level and will not provide any implementation details.

    September 28, 2016

    Parallel Streams

    The Streams API that came with Java 8 enabled functional programming by taking advantage of the new lambda functionality and the method references. One of the most popular features of streams is that they support lazy evaluation. Another very popular feature of streams is that they are capable of processing results concurrently using multiple threads. In this article, we will examine the main points to consider when using a parallel stream.

    Creating a parallel stream is really simple; you just have to designate that your stream is parallel and the operations are done in parallel automatically for you. There is no need to write any threading code to make it happen. There are 2 ways to create a parallel stream: you can either create it from an existing stream, by calling the parallel() method, or use an extension method that has been added to the Collection interface, as below:
     Stream<String> stream = Stream.of("cat", "dog");  
     Stream<String> parallelStream = stream.parallel();  
     Stream<String> parallelStream2 = Arrays.asList("cat", "dog").parallelStream();  

    September 27, 2016

    Optionals in Java 8 and How to Use Them

    Since the release of Java 8, NullPointerExceptions have been pretty common. Before Java 8, your code was probably full of "if statements" to check if a variable was null. Still, it was impossible to catch every NullPointerException out there. With Java 8, Oracle attempted to solve this issue. They didn’t invent the holy grail, but they did make our lives as developers much easier by helping prevent code smells and those nasty Exceptions. Now, if you start a new project, you should definitely use Java 8 to avoid NullPointerExceptions.

    So what exactly did Oracle do to help us in our misery? They introduced Optionals. [1]

    You may have heard of Optionals already a few times, but you maybe dont know exactly know how to use them in the right way. If you use them in the wrong way, it is like you wouldnt use Optionals at all. So let's take a look how Optionals could be used.

    Java 8 Date and Time API [Quick Introduction]

    Along with new language features like lambda expressions and streams, Java 8 has also introduced a new concept to deal with dates and times. Working with dates and times prior to Java 8 was a little tricky and cumbersome, which led to the popularization of third-party time libraries like Joda-Time. Even for those starting to learn Java with version 8, it is still important to be able to understand the code written the old way. In this article, we will examine the core differences between the old and new way.

    First of all, in order to use the new classes, import the java.time package like this:
     import java.time.*;  

    August 21, 2016

    iOS: Creating a Custom UIViewController Transition Animation – a Step-By-Step Guide

    First of all - what is this 'Transition animation', you might ask? Well, no rocket science here - transition animations provide visual feedback about changes to your app’s interface. UIKit provides a set of standard transition styles to use when presenting view controllers, and you can supplement the standard transitions with custom transitions of your own.You may have seen a lot of transition animations that look really nice and neat but you might not have any idea of how to create one. Some of them look really complicated and some really simple, but in the end you just don't know where to start.

    That's why I am going to introduce you to custom transitions. In this step-by-step guide, we are going to create a regular custom transition animations and, in doing so, wash away any fears you might have had about them.
    So let's get started!

    July 04, 2016

    The WWWW Guide to Refactoring

    If you are working on an ever-evolving codebase, refactorings are something you're sure familiar with. Martin Fowler’s Refactoring book is a must-read for any developer. Lets start with his definition of refactoring:
    Refactoring is the process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its internal structure.” [1]
    The book describes the process of refactoring and spends most of the time explaining how to do the various refactorings. In this post I will talk about the essential wwww questions:

    WHY should we refactor?
    WHEN should we refactor?
    WHO is involved in a refactoring?
    WHAT should be refactored?