All posts in “Dynamic languages”

Comparing Core Async and Rx by Example

Last week I saw a core async webinar where David Nolen of Cognitect presented the use of core async with its channels and go blocks in a frontend application using ClojureScript. While watching it I got flashbacks to a problem I faced a while ago when I created some exercises (Functional Reactive Programming using the RxJava library) for my company that I never really managed to solve exactly the...

Neo4j.rb 3.0.rc

Neo4j.rb is a Ruby driver for the Neo4j graph database which I together with many contributors have been developing since 2008. It now consists of two Ruby gems, neo4j-core and neo4j. The neo4j-core gem is a simple Ruby wrapper around the Neo4j primitives: nodes, relationships, labels and properties. The neo4j.rb gem is a drop in replacement for active record in Ruby on Rails. Last week Neo4j...

Ping-Pong Pairing Over Git

When practicing new programming techniques I am a fan of ping-pong pairing. Ping-pong pairing is a way of pairing with TDD that evenly distributes the amount each programmer spends in front of the keyboard and the amount of test code versus actual code each programmer writes. The description from the C2 Wiki reads: [crayon-541de812a2870265303958/] Two programmers sit in from of one computer,...

Running scripts with npm

Most people are aware that is is possible to define scripts in package.json which can be run with npm start or npm test, but npm scripts can do a lot more than simply start servers and run tests. Here is a typical package.json configuration. [crayon-541de812a36d5266089104/] start, actually defaults to node server.js, so the above declaration is redundant. In order for the test command to work...

Clean Grunt

Grunt is the tool of choice for many client side web projects. But, often the gruntfiles look like a mess. I believe the reason for this is that many people don't care about keeping it clean. On top of that, the file is often generated by a tool, such as Yeoman, and not cleaned up after. I happen to think that the gruntfile should be clean and here is a how to do it. Here is how the...

Improving your functional CoffeeScript and JavaScript

Lately I have found myself being influenced by functional programming languages like Haskell and Clojure, especially in how I write JavaScript. Despite it still being a bit verbose, I think functional JavaScript can be very elegant. Add CoffeeScript to the mix and it's looks even better. More importantly, I find that code written in a functional style is much simpler than...

Solving the Expression Problem in Javascript

I just watched a great presentation by Daniel Spiewak called Living in a Post-Functional World. I watched it mainly because I heard it was a great presentation on how to deal with modules, which it was. A concept which is just as important in Javascript as it is in Scala. But at the end of the presentation Daniel talks about the Expression Problem as defined by Philip Wadler. Here it is as...

A Critique of the Thoughtworks Tech Radar on Javascript Testing

The Thoughtworks' Tech Radar has come out again and there is no change in the recommendation on Javascript testing. The radar recommends to "Adopt Jasmine paired with Node.js". This is very specific advice. It's not "Adopt Javascript testing paired with Node.js" but a specific tool, Jasmine. Compare this with more general advice such as "Adopt CSS...

Getting started with Gradle

Did you know that there is a Java build system that does not use angle brackets? More and more projects are using Gradle as an integrated part of their development process. In short, Gradle provides a Groovy DSL for declarative builds based on build conventions. This blog post aims to give you a kickstart if you want to start exploring Gradle yourself by introducing some core concepts and...

Javascript Conditionals

As we all know, Javascript is a very flexible language. In the article I will show different ways to execute conditional code by using some common idioms from Javascript and general object-oriented techniques. Default values Javascript does not support default values for arguments and it is common to use an if statement or a conditional expression to set default...

Three Undocumented Features of JSON

Update: This article was written as an April Fool's joke, taking a stab at the fact that JSON is a closed, dumb, and pretty anemic data format. There are other interesting data formats available, such as extensible data notation (edn). JSON (JavaScript Object Notation) is widely known as JavaScript's data format, often used as a language-independent data interchange format. However, what I...

Web Workers

I recently wrote a program, Word Maestro, which requires extensive calculations in Javascript. The calculations, permutations and searching, are very CPU intensive and hangs the GUI when performed in the foreground. Web workers to the rescue! Web workers are supported by most moderns browsers with the exception of IE (Surprise!). IE10 release candidate supports them, but it is not very wide...