Elvis Operator (aka Safe Navigation) in JavaScript and TypeScript

Posted Leave a commentPosted in Concepts of programming languages, Javascript, TypeScript

One of the first feature requests of TypeScript was the Elvis operator. More precisely, the null-safe navigation operator. That’s a variant of the “dot” operator allowing you to access attributes and methods even if the object preceding the dot is null or undefined. In most languages implementing the Elvis operator, the expression null.firstName simply returns […]

What About the Performance of Java 8 Lambdas?

Posted Leave a commentPosted in Concepts of programming languages, functional programming, Java 8, java 9, JIT, Performance, Uncategorized

Isn’t it funny that I start writing a series of articles about Java 8 Lambdas in 2018? Mind you: my first article dates back to April 2012, six years ago. I fell in love with functional programming even earlier. I suppose it was roughly in 2008, ten years ago. From this perspective, functional programming is […]

Using Java 8 Lambdas Efficiently

Posted Leave a commentPosted in Concepts of programming languages, functional programming, Java 8

Functional programming is en vogue. There are many good reasons to adopt functional programming. Recently, I watch more and more Java programmers using the new programming style. As things go, they experiment and play with their new toy, pushing it to the limits. This article briefly shows why Lambdas are useful, what Java programmers make […]

Escape Analysis in Java

Posted Leave a commentPosted in Concepts of programming languages, JIT, JVM, Optimization

Spectre and Meltdown came as a shock. They showed that low-level CPU optimizations have an impact on our lives. Plus, they proved an illusion of most programmers wrong. Yes, you’re using a high-level language. But that doesn’t mean all those abstraction layers shield you completely from the CPU. I’ve demonstrated the effect of the CPU […]

Compiler as a Service: Why TypeScript 2.5 Biggest Feature is a Refactoring

Posted Leave a commentPosted in Concepts of programming languages, TypeScript

TypeScript 2.5 is there! That’s the headline of the tweet sending me to the TypeScript 2.5 announcment. To my surprise, the article described a new refactoring of Visual Studio Code. Did they choose the wrong title? Is this article really about TypeScript, or is it about an IDE? As it turns out, refactoring is baked […]

NewsFlash: Lukas Eder’s JAX Talk And Turing Complete SQL

Posted Leave a commentPosted in Concepts of programming languages

Did you know SQL is Turing complete? Obviously, it’s not. It’s a purely declarative language. It’s designed with a single purpose in mind: dealing with relational databases. Surprisingly, modern SQL is Turing complete, indeed. This stunning claim has been proven by David Fetter. He’s also written an example that really blew my hat off. It’s […]

TypeScript and ES2016 Decorators vs. Java Annotations

Posted 1 CommentPosted in Angular, Concepts of programming languages, ECMAScript, Java 8, TypeScript

Consider this TypeScript snippet. It’s a very simple Angular2 component. It looks almost like a Java class, doesn’t it? In particular, the @Component looks like a Java annotation. In fact, it plays the some role as a Java annotation. It tells the Angular2 framework that this class is not an ordinary POJO, but something special. […]

Adding Type Inference to Java: Good or Evil?

Posted 3 CommentsPosted in Concepts of programming languages, developer productivity

My previous post raved about the simplicity type inference is going to bring to Java. I love the idea. Java is such a verbose, ceremonious language. Little wonder so many developers prefer dynamically typed languages, which seem to be so much simpler to use until you write a huge enterprise application. Java’s proposed type inference […]

Newflash: Are Java 8 Lambdas Closures?

Posted 1 CommentPosted in Concepts of programming languages

Bruce Eckel has published some interesting thoughts about closures and lambda expressions in Java 8. He claims that Java’s lambdas are essentially closures because the original definition of closures stems from functional programming languages, and pure functional languages don’t know variables. Hence, Java’s restriction that lambdas can only access effectively final variables of the surrounding […]