Articles
Here are all the items relating to Articles (page 3 of 4)
Cross Framework Messaging
Wednesday, 20 January 2016
With the proliferation of Javascript frameworks, I found myself in the
situation where I needed two different UI elements — built with two different
Javascript frameworks — to communicate with each other.
Rather than choosing to migrate one onto a different framework, I looked at a
way of allowing them to send messages to each other using the Mediator Design
Pattern.
Using this pattern, I have an example of an Angular app, a React app, and a
plain Javascript app communicating.
Read More…
Very Light Javascript
Tuesday, 24 November 2015
I recently needed to put together a quick proof of concept for a small project
and decided to use this as an opportunity to try out a lighter than light
approach to Javascript I’d been thinking of for a while.
Whilst frameworks like Bootstrap are already quite light, I wanted to see if I
could remove even more. With all the Angular 2 kerfuffle, I wanted to look
for another framework which I can use instead. I also wanted to drop gulp
and just try using npm instead.
Read More…
Memoization
Monday, 14 September 2015
Some of my recent blog entries have dealt with using functional practices in Javascript. There are obviously downsides to functional programming as well, and one commonly stated one is around performance.
One area this applies to is in the large number of function calls resulting from this approach — particularly when we are writing recursive code.
We will give an example of this problem — calculating Fibonacci numbers — and then look at a technique known as memoization as a way of improving performance.
Read More…
Functional Example
Saturday, 12 September 2015
This blog entry will take the techniques discussed in the previous articles about functional Javascript and currying and apply them to an example problem.
Read More…
Curried Javascript
Tuesday, 8 September 2015
In my previous blog entry, we looked at how functions are first class entities in Javascript, what an anonymous (or lambda) function is, and how we create and use closures.
We will now look at another functional technique, known as currying, which builds on those concepts.
Read More…
Functional Javascript
Thursday, 3 September 2015
Functional programming is seeing an increase in popularity, as can be seen in rising adoption of languages like Scala, Clojure and Erlang. Even Java has introduced lambdas (more about lambdas, later).
Javascript supports a functional programming style and I find that working within that style makes many things simpler when developing Javascript. This is particularly true when working with promises.
This blog entry discusses some basic functional techniques and demonstrates how they can be used within Javascript. It should be useful to both people who wish to adopt a more functional style in their Javascript, and to people who just want to understand more about functional programming.
Read More…
Promises in Javascript
Wednesday, 10 June 2015
Javascript is single threaded and non-blocking, which means that lines of Javascript code are not necessarily executed in the same order they are written. This can cause problems with asynchronous behaviour, for example if the Javascript needs to call two different APIs in a specific order. This article discusses this challenge, and looks at the use of promises to address them.
Read More…
A learning stub server in 40 lines of code
Wednesday, 2 April 2014
This article demonstrates a simple stub server, written in Javascript, which captures responses as it proxies them to backend services, and can then act as a stub server, serving up those responses as appropriate.
Read More…
PhantomJS for client side testing
Monday, 17 March 2014
Please note that PhantomJS has been suspended, so this article is only retained out of historical interest.
As web-based projects do more on the client side, conventional server-side performance testing is not able to give you all the performance story. I have, therefore, started looking around for tools which would give more insight into that purely client-side performance.
Read More…
Creating vagrant boxes with veewee and packer
Sunday, 16 February 2014
This is an old article, and the technologies used in here may have changed significantly since I wrote it. Proceed with caution.
I’ve been creating a few vagrant base boxes recently — some for a DevOps course I am putting together, and some for investigations in my current project — and I thought I’d quickly share my experiences of the two tools: veewee and packer.
Read More…