TypeScript, although very promising language, does not solve fundamental JavaScript’s issue (feature?) with “this” property binding. TypeScript can lead to unfortunate errors since it is heavily used by people coming from C#/Java communities, who bring coding patterns with them. Let’s have a look at code example from TypeScript playground: class Greeter { greeting: string; constructor(message: string) { this.greeting = message; } greet() { return “Hello, ” + this.greeting; } } let greeter = new Greeter(“Alexander”); console.log(greeter.greet()); // Hello, Alexander Now, lets make slight change to…Continue Reading “TypeScript is actually JavaScript and one still has to be careful”

There are many old cool languages in the world which brought absolutely new ideas into programming. One of them is APL and its main idea was to build programs as array processing pipelines. And it is amazing how many pretty complex problems can be solved in APL very easily and expressively using just array processing. Modern programming languages all get features which enable us building programs which almost completely consist of array processing pipelines. Just look at LINQ and how it transformed the way how…Continue Reading “Learning from APL: item by item function application”

In programming, everywhere in the code we use procedural abstractions in the form of function/procedure or method (in object-oriented programming).  These procedural abstractions (later in the article I will call them just functions) usually have parameters. It is interesting that if you fix one or more parameters to some particular value, the function can acquire additional meaning and can be used as a dedicated function with a separate name.  For example, consider function add(x,y).  When you take the first parameter and fix it to some…Continue Reading “Configuring function call”