Using Gulp-SASS with VS Code task runner

Published on August 07, 2015 in VS Code · Read time 4 minutes

With the task runner built in to VS Code, you can set up Gulp to automatically compile your SASS files to CSS with a simple key press. VS Code task runner prerequisites To be able to get this working, you need the following prerequisites Windows, Linux or Mac VS Code Node.js and NPM Gulp.js To install Gulp run the following command; or To install into your development environment. I’d generally recommend installing gulp globally as you will likely be using it a lot. You will probably want to install gulp-sass locally in your dev environment. We will get to that shortly. Existing Project If you are using an existing project and you already have a Gulp file ( GulpFile.js ) and a package.json file, feel free to skip the next step. New Project Create a new folder for your project, open VS Code and click File > Open Folder . Point to your new folder and click OK . Open a Node.JS command prompt, and change directory to your new folder. Now type the following command; As shown here; You will be prompted to enter details about your project. Either accept the default by pressing Enter or enter the details as appropriate. This will generate a package.json file for your project…

Why Visual Studio 2015 has changed my life

Published on July 24, 2015 in Visual Studio · Read time 3 minutes

I’ve been using Visual Studio on an almost daily basis since 2002 . Before that, my development tool of choice was Visual Basic 6 (Visual Studio 6). The shift between those two versions felt like using a whole new product at the time. Since then, changes to Visual Studio have been incremental. Microsoft have released a new version every 2-3 years. Visual Studio 2015, however, feels like another significant paradigm shift. The point of this post is not to outline all the shiny new features, there are official blog posts for that . No. I wanted to tell you how the changes to Visual Studio have directly changed the way I work on a day to day basis. Visual Studio Tasks (Task Runner Explorer) The wider web development community has been using task runners, GruntJS and more recently GulpJS, for at least the last few years. On every project I work on these days, I use TypeScript and SASS. Web essentials previously was responsible for compiling my SASS files, as well as providing linting for both SASS and TypeScript. With the 2015 release, this functionality has been removed. There are a bunch of Mads Kristensen extensions on Visual Studio Gallery that you can install that will add…

Why I don't want to be a front-end web developer

Published on June 25, 2015 in Career · Read time 4 minutes

The job title isn’t representative of my skill set As a front-end developer, you portray yourself as having a narrow set of skills. This probably isn’t the case. I did a quick search on a popular job forum for front-end developer jobs, and there is a clear recurring theme as to what skills are required to be a mid-level/senior front-end developer; (X)HTML (5), CSS, SASS/SCSS, LESS. Backbone, Angular, Knockout. Responsive web design (I’m assuming Bootstrap knowledge, Foundation etc). Adobe Photoshop, Magento. Knowledge of source control and some form of client side unit testing. My perception of these skills; HTML has remained relatively unchanged since it was invented in 1990 . If you don’t agree, just take a look at the source code for the first web page . HTML is easy, whatever the flavour. That’s actually is greatest strength, no barrier to entry for new developers. CSS is easy to learn, impossible to be great at. Thankfully tools such as SASS/SCSS and LESS are eliminating the pain. A web developer of any skill level and experience can learn to use these CSS pre-processors in 60 minutes or less. They’re simple. They just work. If you’re good at responsive web design, this is…

What I learnt from using TypeScript "for real"

Published on May 25, 2015 in TypeScript · Read time 6 minutes

I completed my first commercial Greenfield project using TypeScript over plain old JavaScript throughout, and there were some frustrations along the way. TL;DR TypeScript is awesome, for sure, but there needs to be improvements to tooling to streamline the experience. TypeScript is strongly typed of course, but it doesn’t force you to code in this manner, which can result in shoddy code. Tweaking is required to make bundling work properly. Tooling Frustrations When I started the project, I was using Visual Studio 2012 Update 4 with TypeScript 1.0 pre-installed. I was brought in to work on this project on a short term basis, and this is how the machine was set up when I arrived. Normally I wouldn’t choose to use Visual Studio 2012 (I like to use the latest tools where possible) but I decided to just go with it and make do. Once deficiencies in tooling became clear, I did eventually push for an update to Visual Studio 2013 Update 4, which in fairness resolved most of my frustrations. I have a license for JetBrains ReSharper, which has support for TypeScript 1.4 (and indeed that is the default setting when using ReSharper 9). This was actually my first tooling problem. When using…

WCF custom authentication using ServiceCredentials

Published on April 03, 2015 in WCF · Read time 24 minutes

The generally accepted way of authenticating a user with WCF is with a User Name and Password with the UserNamePasswordValidator class. So common that even MSDN has a tutorial , and the MSDN documentation for WCF is seriously lacking at best. The username/password approach does what it says on the tin, you pass along a username and password credential from the client to the server, do your authentication, and only if there is a problem then you throw an exception. It’s a primitive approach, but it works. But what about when you want to do something a little bit less trivial than that? is probably what you need. Source code for this post is available on GitHub . Scenario I should prefix this tutorial with a disclaimer, and this disclaimer is just my opinion. WCF is incredibly poorly documented and at times counter intuitive. In fact, I generally avoid WCF development like the black plague, preferring technologies such as Web API. The saving grace of WCF is that you have full control over a much more substantial set of functionality, and you’re not limited by REST but empowered by SOAP. WCF plays particularly nicely with WPF, my favourite desktop software technology. I’ve never…