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

RReal Immutable Types With TypeScript

07.03.2020 - 4 Min Read - In code

When writing TypeScript there's a pretty easy, simple solution to create immutable objects and it doesn't involve adding third-party libraries.There! There you go, that's all that you need.Before I…

TTypeScript and the Power of the Unknown

15.07.2019 - 4 Min Read - In code

TypeScript is a language that is moving forward really fast and sometimes is hard to keep up with it, there are so many features being released constantly, that we may be missing some really important…

HHandling nulls in C# the right way

31.01.2017 - 7 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…

UUnit testing using Typescript and Mocha

05.05.2016 - 2 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.2016 - 7 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.2016 - 3 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.2016 - 1 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.2016 - 6 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.2016 - 1 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.2015 - 3 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.2015 - 1 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 there…

TTalking about ES2015: destructuring

19.08.2015 - 11 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…