Template for TypeScript, Handlebars and Webpack architecture

by dotnetnerd 5. October 2017 12:05

I recently started a new project, based on my own medicine of not using a framework, but building a simple architecture, that can grow and change freely based on needs as they arise. It is coming along very nicely, and has allowed us to have a pretty clean architecture.

For this project we chose to base the solution on TypeScript, and use handlebars for views along with a few other small libraries. As a clientside build tool we wanted to use webpack, because it is fast, has a lot of plugins that we can use, and is well suited for working with css modules. More...

TypeScript patterns: Lazy

by DotNetNerd 12. July 2017 08:48

I have been working with TypeScript for quite a while now, and I really enjoy how the strong typing enables better tooling, as well as more understandable code, where the patterns of old look more like themselves, than they do in plain JavaScript. With the adoptation that TypeScript has seen in the last couple of years, I think it is safe to say that it is a good bet going forward, so if you are not already on board I highly recommend it. I will bet your time is better spent with languages and patterns, than they are learning the framework flavour of the day – although they do in themselves provide inspiration for patterns.

More...

TypeScript 2 – full speed ahead!

by DotNetNerd 1. May 2017 10:30

I have been happy working with TypeScript for quite a while now, and I am happy to say that things are moving ahead with the language quite well. It is not that long ago that TypeScript version 2.0 was realeased, and with steady releases we are now at version 2.3.

One of the big things that came to TypeScript in version 2.0 was discriminated union types and the option to do strict null checks, which combine quite nicely. Discriminated unions are simply done using the pipe operator, and the compiler will do strict null checks if you use the --strictNullChecks switch. More...

TypeScript 2.0 beta non-nullable types

by DotNetNerd 13. July 2016 07:19

tsOne of the nice features of functional programming languages like F# is the lack of null. Not having to check for null every where makes code a lot less errorprone. As the saying goes "What can C# do that F# cannot?" NullReferenceException". Tony Hoare who introduced null references in ALGOL even calls it his billion-dollar mistake. The thing is that although this is quite a known problem, it is not trivial to introduce non nullable types into an existing language, as Anders Hejlsberg talked about when I interviewed him at GOTO back in 2012.

With version 2.0 of TypeScript we do get non-nullable types, which has been implemented as a compiler switch --strictNullChecks. More...

Initial thoughts on Angular 2

by dotnetnerd 31. May 2015 16:29

I was asked to do a talk about Single Page Applications and Angular 2 in a couple of weeks. At first I was a little sceptical, because Angular 2 is far from a finished product yet. After agreeing that the main points could be around SPA architecture, TypeScript and how you can build these kinds of applications without using a framework I said yes. So lately I have been working on the talk and the first part has been quite easy to do. Yesterday I got started on demoes, and dived into Angular 2 for real.

More...

Is TypeScript taking hold?

by DotNetNerd 7. April 2015 13:08

Fantastic times! I just got back from a week off around easter, summer is almost here and I was awarded Microsoft MVP for ASP.NET/IIS for the first time. So all I that is missing is getting some blogging done.

At the moment I am really enjoying TypeScript, and I am feeling really good abouts future with the recent collaboration between the TypeScript and AnguarJS teams. I still argue that in most cases where you want your solution to live long, you should avoid the SPA frameworks. However I concede that they are popular, so it is a good step for TypeScript, which I think will help the adoption. I also think it will be good for Angular 2.0, to avoid introducing their own new language, and instead get the benefits of the good work done on TypeScript itself as well as tooling.

More...

Who am I?

My name is Christian Holm Diget, and I work as an independent consultant, in Denmark, where I write code, give advice on architecture and help with training. On the side I get to do a bit of speaking and help with miscellaneous community events.

Some of my primary focus areas are code quality, programming languages and using new technologies to provide value.

Microsoft Certified Professional Developer

Microsoft Most Valuable Professional

Month List