The enchanted electrical website of Dr. Sinclair
-
Motivation, Self-control and Good News
Written by James SinclairHow to you make yourself do things that you don’t feel like doing? When it’s a cold winter morning and you have to get up in the dark to go to work, how do you make yourself leave the warm bed? If you’ve just started a diet, how do you resist the doughnuts your work colleague decided to share? How do you make yourself strap on the running shoes and go jogging? Doing things you don’t feel like doing is hard work—it takes willpower. But where do you get the motivation?
-
One weird trick that will change the way you code forever: JavaScript TDD
Written by James Sinclair‘One weird trick’ is a cheesy title, I know. Originally I was using it as a draft placeholder title for a joke. But the more I thought about it, the more it seemed appropriate because it’s true. Test Driven Development is one weird trick that will change the way you code forever. It will make you a more badass developer.
-
How to fight like a man
Written by James SinclairA friend of mine asked me for some advice before he got married. This was my response.
-
TDD Should be Fun
Written by James SinclairSometimes TDD can seem like a drag. Are you writing mocks that are several times more complicated than the code you will test? Does your test suite take minutes (or hours) to run? Does refactoring your code fill you with dread because of all the tests to rewrite? If any of this sounds familiar then it may be time to try a new strategy.
-
A Gentle Introduction to Javascript Test Driven Development: Part 3
Written by James SinclairThis is part three of a three-part series outlining my personal approach to JavaScript TDD. Testing code that creates HTML and manipulates the DOM can be tricky—especially when testing without a browser. In this article I outline one approach to this, and finish off the sample application we have been building through the series.
-
A Gentle Introduction to Javascript Test Driven Development: Part 2
Written by James SinclairWorking with JavaScript network calls can be tricky when practicing Test Driven Development. This article gives an example of how to use stubs and Promises to make testing network calls easier. This is part two of a three-part series outlining my personal approach to JavaScript TDD.
-
A Gentle Introduction to Javascript Test Driven Development: Part 1
Written by James SinclairGetting started with test driven development (TDD) can be daunting. It sounds tedious, boring and hard. There’s also a confusing array of frameworks and libraries out there. Some work on the server; some work in the browser; some do both… it can be hard to know where to start. This is part one of a three-part series outlining my personal approach to JavaScript TDD.
-
Star Wars: The Force Awakens—Philosophy, passion and Jesus
Written by James SinclairI really like Star Wars, and I enjoyed The Force Awakens. I think that when you dig below the surface, the ways in which it agrees and disagrees with Christianity are different from what you might expect. In the end, the Star Wars movies are just that: a bunch of movies. But, as I’ve said before, if we watch in the right way, movies can point us to something deeper and more meaningful—a new and better hope.
-
A Gentle Introduction to Functional JavaScript: Part 4
Written by James SinclairIn the last article of our four-part introduction to functional programming in JavaScript, we looked at higher-order functions. In this article we discuss how to use these new tools with style.
-
A Gentle Introduction to Functional JavaScript: Part 3
Written by James SinclairIn the last article, we saw how functional programming can be used with arrays. In this article we examine higher-order functions—functions for making functions.