Imagine, we are writing text processor. Now we have two requirements for our text processor:

- have three fonts

- add ability to color a text

So, text would look like this:

Desired fonts

Ok. We have understood a task. So let’s try to implement this task. …


Imagine, we are writing text processor. One of requirements to text processors is to have three fonts:

- font 1: A

- font 2: A

- font 3: A

Ok. We have understood a task. So let’s try to implement this task. One of the implementation would be:

public class…

When I saw the following piece of code, I was a little bit amazed how it works. So let’s jump to know how it works.

Let’s say we have the following code:

const arr = [[1, 2],[3, 4],[5, 6, 7, 8, 9],[10, 11, 12]];const flattened = [].concat.apply([], arr);console.log(flattened)
//…

State pattern

As wikipedia says:

The state pattern is a behavioral software design pattern that allows an object to alter its behavior when its internal state changes. This pattern is close to the concept of finite-state machines.

Simple example of finite-state machine is vending machine which state depends whether you…

Stepan Markakov

I am software engineer. I like to learn and like to develop software. I program with C#, SQL and JavaScript

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store