Angular 6 Brings TypeScript 2.7 Bringing Improved Null-Safety

Posted Posted in Angular, Concepts of programming languages, TypeScript

The web is full of articles praising the improvements of Angular 6, such as library support (great!) and Angular Elements (even greater!). One small change usually passes by as a mere side-remark. But it’s a useful change, too. Angular 6 now officially supports TypeScript 2.7. That, in turn, is a major step forward for our […]

Unsubscribing From an Observable in Angular

Posted Posted in Angular

Since version 2.0, Angular uses RX.js observables a lot. Such an observable is potentially infinite. So in many cases, you need to unsubscribe from the observable manually. If you forget to do so, you end up with a memory leak. Actually, you’ll probably get away without unsubscribing for a long time. First, Angular cares about […]

How to Add a New Breakpoint in Bootstrap

Posted Posted in responsive design, web design

Bootstrap claims to be a “mobile first” framework. However, judging from the breakpoints, it’s a mobile-only layout framework. The largest breakpoint is 1200 pixels wide. Even my 15” MacBook has much more screen estate: its screen is 1440 pixels wide. Many desktop monitors have a width of 1920 pixels, and 4k monitors are gaining popularity […]

Elvis Operator (aka Safe Navigation) in JavaScript and TypeScript

Posted Posted 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 […]

Angular Components with Non-Standard Selectors

Posted Posted in Angular

When I teach Angular, I keep telling my students that Angular components are custom HTML elements, while Angular directives are custom attributes. Every tutorial I know teaches the same. Nonetheless, Angular is much more flexible. In reality, the selector of both components and directives can be any CSS selector. For instance, you are allowed to […]

What About the Performance of Java 8 Lambdas?

Posted Posted 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 […]