Entries Categorized under 'Dynamic languages' ↓

Running scripts with npm

Clean Grunt

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 imperative code. It is easier to test, reuse and rewrite. So how do you do this in JavaScript? One…

Solving the Expression Problem in Javascript

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 Frameworks" or "Promises for asynchronous programming". Nothing specific there and, hence, nothing wrong. There is no motivation as to why we should adopt Jasmine…

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 commands. Installation If you have not used Gradle before, you must install…

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 values. I usually prefer to use an or-expression instead. The short-circuiting or, ||, avoids the repetition of the conditional operator and…

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 consider to be the three most powerful features of JSON are little-known. The main reason for this is…

Get S3 request statistics in four simple steps

Web Workers

Poor man’s two-way binding in Windows 8 (WinJS)

If you’re a web developer with prior experience from MVVM/MV* frameworks like Knockout or Batman going into Windows 8 development, one thing you quickly notice is the lack of two-way binding when using the WinJS template control. In this blog post we´re going to show you a starting point to roll your own two-way binding without going to another lib, when binding a simple view model to a view with a WinJS template. Intro When working with the ListView control…

The Cypher Ruby DSL for the Neo4j Graph Database

This week I released the neo4j-cypher ruby gem version 1.0.0. Cypher queries can now be written in Ruby instead of as a long string. The DSL uses common Ruby conventions and a neo4j.rb influenced API. The neo4j-cypher gem contains adaptors for both the neo4j.rb and neography gems. The DSL supports the cypher language implemented in the 1.8 release of neo4j which just have been released. Introduction to Neo4j and Graph Databases Using a graph database means that you store your…

Good CSS Practices

A Decimal to Roman Numeral converter in just a few lines

Tests in Javascript Metro Applications

Simple AOP in JavaScript

During a recent re-factoring of some JavaScript I accidentally removed the last line of a function that told the UI to re-render according to the new data. After that I figured, why not move this outside of the function and get a little AOP look and feel. The code below gives a simplified version of the problem. Foo.Bar=function(){ var someValue; var self={ foo:function(addThis){ someValue+=addThis; rerender(); //This line have to be here… } }; return self; }(); So with that in mind I created the three obvious methods, before, after and…

Finding Out Who Changed What with Datomic

Neo4j.rb 2.0 – An Overview

Writing a Node Module

Simple Google Maps API Example

Braceless Programming

The Fantastic SUBST Function (part 4)