Software Imagineer's blog

Hidden JavaScript functional patterns in TypeScript

Tomas Grubliauskas | Wed Aug 08 2018

TypeScript has enabled JavaScript codebases to scale like no other technology before. It has mostly to do with a flexible type system the TypeScript provides. Type checking helps to avoid runtime surprises, but it arguably also makes JavaScript projects look more like written in Java, C# or other object-oriented programming languages. There is nothing wrong with object-oriented approach or object-oriented fans writing TypeScript how they know best. The point is that JavaScript has a functional side and a lot can be gained by using it. Moreover, since TypeScript is so flexible it can also help to make functional code type safe.

Let's explore some of the functional patterns which are familiar to JavaScript programmers, but may be less known to programmers who mostly work with TypeScript.

The secret to achieving your goals was always hiding in a book

Tomas Grubliauskas | Fri Jul 27 2018

We turn to books when we want to tap into accumulated knowledge of human society. Depending on your dedication you can learn anything from quantum physics to ancient style of Japanese carpentry. But more than often we turn to books for answers to our daily struggles. And one of the universal struggle of our lives is achieving success and fulfilling our goals. Unsurprisingly, captivation by success has dominated the top-selling book lists since the beginning of the top-lists. Goal setting, motivation and success has probably been approached from every single possible angle. Pop-science, spirituality, mathematics and all kinds of pseudo sciences, just pick one and you will find a book about it. But no matter how many more books are written and printed, it still does not feel like we have discovered the secret method of achieving our goals.

Hacking my language learning process

Tomas Grubliauskas | Sat Oct 07 2017

Learning languages is good for your brain. Scientists say it can help prevent alzheimer’s disease. Others say it changes your perception of the world. But most of all, learning languages is fun. Well…. It is fun when you are in a bar with multi-cultural group of friends and you learn how to say “Cheers!” and “Thank you” in five different languages. Or when you learn how to say “my bear drinks beer” in Russian on Duolingo. But past the basics, learning languages is quite hard. I am definitely feeling the struggle while learning Danish and this motivates me to look for ways to hack the learning process.

Ways to iterate an array in TypeScript

Tomas Grubliauskas | Wed Jul 26 2017

Quick overview of ways to iterate an array in TypeScript.

Java is slowing Android’s growth and Kotlin is not the answer

Tomas Grubliauskas | Sat Jul 22 2017

I am sitting in my study, it’s dark and completely silent, I am in the creative flow, typing away the last lines of code for my new Chromecast game. I hit build and strange sound fills the room. This strange sound might fool someone into thinking that I am about to make serious breakthrough in molecular physics. But in reality my Macbook Air is trying to build 200 unique lines of code wrapped in megabytes of Android libraries. My flow is gone, and I am left with flashbacks of Android development from five years ago.