Opera takes the cake

May 17, 2010

In Firefox, Chrome, and Safari, timeouts passed to setTimeout are subject to signed 32-bit integer arithmetic overflow. For instance, the following code shows an alert immediately, as if zero or a negative value had been supplied. setTimeout(function() { alert(‘hi’) }, 2147483648); Internet Explorer has the same problem, except they use unsigned 32-bit integers. Try this… Read more

Instantiators, a Data Driven IoC

May 10, 2010

We’re working on a new library which will be part of kawala and wanted to share our initial thoughts. The full design doc is available on the wiki. Below, you can watch our design review session. An instantiator is meant to instantiate objects from string representation of its constructor arguments. In addition, instantiators can produce… Read more

A Better Option for Java

May 04, 2010

If you are somewhat familiar with Scala or Haskell, you are probably used to Option[T] or Maybe a, the neat way to pass around “partial values” – values that may be missing. Maybe a in Haskell represents either Nothing or Just x for some x of type a. In Scala Option[T] is either Nothing or… Read more

Entities and Values

In object-oriented programming, defining new classes of objects is the typical way of introducing new types. It is extremely important to classify these types in order to ensure separation of concerns. In this article, I am going to define two common classes of types, namely entities and values. Entities are objects of the domain model,… Read more

Deployment Infrastructure for Continuous Deployment

May 02, 2010

Continuous deployment is the unification a number of best practices to create a more iterative and responsive engineering organization. Frequent, small commits reduce merge conflicts and help engineers adapt to changes in other parts of the code more quickly. Thorough automated testing ensures confidence in the codebase and allows engineers to make changes without worrying… Read more

Use a Before Method in Your Tests

April 28, 2010

When writing unit tests using the JUnit like frameworks, the mantra is to avoid any work in the class and prefer putting initialisation logic in a dedicated before method. Imagine you’re testing JSON manipulation and you have sample fixture data to work on. public class WhyUseBeforeTest { static Json.Array fixture = (Json.Array) Json.fromString(“[5,6]”); @Test public… Read more