Category – code
21 posts tagged with "code" (See all categories)

HHandling nulls in C# the right way

31.01.20177 Min Read — In code

Working with the possibility of null in any language that allows it, sucks. It's tedious, and there's boilerplate code involved, it's not fun and error prone. Luckily for those who write C#, there's a…

FFunctional JavaScript - What is a Functor?

16.06.20164 Min Read — In code

When you first start looking into functional programming, you hear a lot of scary terms such as functors, monads, monoids, lift, fold, etc. Some of those things are sort of complicated to understand…

UUnit testing using Typescript and Mocha

05.05.20162 Min Read — In code

Not long ago I wrote a post on how to setup testing using Mocha, Chai, Karma, Webpack, Sinon and TypeScript and although this is something I still use today, using karma and Webpack might be an…

FFunctional JavaScript - Composition

25.04.20168 Min Read — In code

Composition is a nice way of reusing existing functions to create new ones. Each of those functions will act on some data that is passed by as an argument, transforming it and then returning it so…

LLinting TypeScript with Webpack

07.04.20163 Min Read — In code

Linters are an excellent way to enforce some structure and to help avoid errors. If you have never used a linter, you're missing on a set of great tools that will assist your team to write better code…

HHow to stub promises using Sinon.JS

29.02.20161 Min Read — In code

Promises are a great way of doing async programming. But testing with promises can be a bit cumbersome, even with the use of the arrow functions syntax. Recently I've found a small and nice package to…

AAsync await with ES6/Babel and TypeScript

17.02.20166 Min Read — In code

Promises are an excellent way of making asynchronous calls, and they're most definitely an improvement over working with only callbacks. Take the following example, calling a URL that returns a movie…

FFive great shortcuts for Visual Studio

17.01.20161 Min Read — In code

I don't know about you, but when I'm coding, I like to keep my hands on the keyboard. I find that reaching for the mouse is disrupting and breaks the flow. So I like my shortcuts. I don't know all of…

TTalking about ES15: classes

02.09.20153 Min Read — In code

Update: I have also recorded a video about classes , if you want to watch it in addition to reading this post. JavaScript has always been an object-oriented language. It never had a class definition…

TTalking about ES15: strings

25.08.20151 Min Read — In code

There are a few new features related to strings in ES2015. They're easy to learn and they allow for a more clean code. In ES15, some new methods were added to the String object. For instance, now…

TTalking about ES2015: destructuring

19.08.201512 Min Read — In code

Destructuring is a new feature in ES2015 which allows us to declare or assign values to variables. It's a very powerful way of doing that. It might sound a little confusing at first, but it really is…