Menu

Less IO for your Unit Tests with a Java SecurityManager

November 11, 2010

Our quest for a truly test-driven engineering team has enabled us to confidently ship our software every few minutes. Automated testing is the keystone of continuous deployment, and as a result our unit tests and smoke tests are thorough. Perhaps, a bit too thorough. (Our last unit testing extravaganza in the form of a cyclomatic-complexity-driven… Read more

Computation: “There is no try”

November 09, 2010

Often a complex, multi-step calculation requires your code to react to many circumstances. Typically you use exception handling to separate the normal control flow from error handling: Option<BigDecimal> result = Option.none(); try { result = compute(); } catch (WhateverException e) { // Perhaps rethrow. } if (result.isEmpty()) { // Perhaps retry, or set a dummy… Read more

If you ever write a varags method…

November 08, 2010

In some specific cases, methods with a variable argument list might greatly improve the usability of an API. However, it is very easy to overuse or misuse this language feature, leading to cumbersome APIs. Varags methods shine when the programmer knows how many arguments must be passed to a specific invocation of the method when… Read more

Evolve or die: Start-ups and “Dealing with Darwin”

November 04, 2010

It’s that time of the month again. Endless conversations about the product roadmap, planning, priorities and resources. “We’re accumulating too much technical debt,” says the CTO, “we badly need some time to work on magic-refactoring-XYZ.” The product guy nervously answers a bit too quickly: “Are you forgetting about those killer-features-of-the-year we’ve been putting off?” “What… Read more

A Fix-It Day with Cyclomatic Complexity

November 01, 2010

It is here that the stereotype of the programmer, sitting in a dim room growling from behind Coke cans, has its origins. The disorder of the desk, the floor; the yellow Post-It notes everywhere; the whiteboards covered with scrawl: all this is the outward manifestation of the messiness of human thought.   The messiness cannot… Read more