How to avoid burnout

Published on November 19, 2015 in Career · Read time 6 minutes

You work hard 7 days a week, and you do your best to stay up to date with the latest industry trends. Inevitably you will become demoralized and demotivated and eventually suffer a partial or full-on collapse where all your progress comes to a grinding halt. After a period of time (days, weeks or months!) you get back on track and pick up where you left off, eventually leading to the inevitable burnout cycle where you end up back where you were. I’ve been through this cycle several times, and I’ve even blogged about it before , but now I have learnt the ultimate techniques to break the endless cycle and find a more maintainable work-life balance. Here are my 5 ultimate tips to avoid burnout. Stop Start by reducing your workload. You are probably doing some or all of the following on a regular basis; Watching training videos, doing some form of professional online training Freelance or other paid work for friends, family, or professionally Contributing to open source, or some form of unpaid work where you have responsibilities and deadlines Your day job You probably can’t stop doing your day job, so you will want to give that the highest precedence. However, I can’t tell you how…

TypeScript beginners guide

Published on October 02, 2015 in TypeScript · Read time 8 minutes

TypeScript is a tool that enables you to write better JavaScript. You may have heard that TypeScript is a superset of JavaScript, but what does that mean? TypeScript is JavaScript. If you know JavaScript already, then you already know JavaScript. You can convert an existing JavaScript file to TypeScript simply by changing the file extension. TypeScript has a very low barrier to entry (you can easily write it using Notepad) and has a small learning curve. TypeScript has a transpiler, called tsc which transforms (compiles, if you like) your code from TypeScript to JavaScript. If you use any TypeScript paradigms, then your code cannot be understood directly by a JavaScript execution engine ( V8 for example). You can, however, enable source maps and debug your TypeScript code directly. Developers: “Why should I bother using TypeScript?” When I talk to developers about TypeScript, the first thing they ask me is “Why should I bother using TypeScript?” or “I already understand JavaScript and I’ve been using it for x years, so I don’t feel the need to use it…“. This is a great platform to explain to people why they should use TypeScript. Not because I’m on some personal mission or…

Writing AngularJS 1.x with TypeScript

Published on September 24, 2015 in TypeScript · Read time 32 minutes

AngularJS 1.x is a front end JavaScript framework that has gained huge traction and popularity in the development community. AngularJS greatly simplifies previously hard tasks like two-way data binding, templating, the MVC design pattern, despendency injection and more. Using TypeScript, we can create more robust and scalable AngularJS code to deliver the ultimate user experience whilst avoiding the traditional spaghetti code nightmare that JavaScript applications can often descend into. AngularJS version 1.x is written in JavaScript. Its successor, Angular 2.x, is written using TypeScript. It was originally going to be written in Google’s propriety language AtScript, but the teams have merged the projects and are now working together on TypeScript. All the code for this project is available to view on GitHub . There is also a demo project on GitHub pages . Note : This tutorial assumes you have some knowledge of Angular 1.x. Note : This tutorial tries to stay editor independent, meaning the concepts apply to TypeScript specifically and not to an editor. When necessary, screenshots showing relevant information will be of VS Code . VS Code is a free, cross platform editor hat has…

Using ES6 features with TypeScript

Published on September 18, 2015 in TypeScript · Read time 9 minutes

TypeScript is a transpiler The TypeScript compiler converts your code from TypeScript, which is a subset of JavaScript, to TypeScript. Compiler vs. Transpiler There is some confusion about the difference between a compiler and a transpiler. A compiler takes your code and turns it into something very different, a whole new language. A good example is with a high level language such as C# or Visual Basic. When you write code and build it, the compiler (either csc.exe C# compiler or vbc.exe Visual Basic compiler in this case) takes your code and turns it into Intermediate Language (IL). Example C# code; And the compiled code (as seen using ILDasm.exe); The above code is certainly not C#. The C# has been changed into a whole new language. A transpiler takes your code and changes it. But it’s still in the same language that you started out with. TypeScript is JavaScript, infact, TypeScript is a subset of JavaScript. When the TypeScript compiler runs over your code, it reads in TypeScript (which is JavaScript) and outputs JavaScript. The end resulting language is the same as what you started out with. The following TypeScript code is completely valid; And the resulting transpiled…

Getting started with TypeScript

Published on September 11, 2015 in TypeScript · Read time 6 minutes

This is the 101 tutorial which describes getting started with TypeScript using either the TypeScript Playground , Node.js or VS Code . At its simplest, TypeScript is a programming language that provides optional static typing for JavaScript. TypeScript is JavaScript. Any valid JavaScript is valid TypeScript. The beauty of TypeScript is that you can define types for your JavaScript variables and functions, and get compile time error checking and error reporting. This tutorial focuses on getting started with TypeScript and demostrates the basics to get up and running quickly. TypeScript Playground The quickest, easiest way to get started with using TypeScript is to experiment with the TypeScript playground . The TypeScript playground enables you to write TypeScript code in the browser, and see the resulting compiled JavaScript alongside. First things first, TypeScript doesn’t try to force you to write code in a particular style. In fact, you can write 100% pure JavaScript code in get the same code out at the other end. Try entering the following code in the TypeScript pane on the left; See the output? Identical. You can take advantage of TypeScript is much or as little as you…