View await-with-sync-function.js
function syncBar () {
console.log('in syncBar')
return 'syncBar'
function asyncBar () {
console.log('in asyncBar')
return Promise.resolve('asyncBar')
View util.js
function nil(value) {
return value === undefined || value === null
function notNil(value) {
return !nil(value)
function empty(value) {
if (nil(value)) {

Java vs Python

Split String


String numberString = "1,2,3,4,5";
int[] numbers =",")).mapToInt(Integer::parseInt).toArray();

Python runtime type checks with decorator

# This modules provides pre/post conditions for python functions via the @typeSpec decorator

from functools import reduce

def compact(d):
    return {k: v for k, v in d.items() if v != None}

Static vs Dynamic Typing for JSON Handling

The point of comparison here is a function that filters some JSON based on on an access property set in a JSON schema. See Haskell vs Clojure for an interesting similar comparison.


The Scala code uses the circe library for Json handling:


S3 Direct JavaScript Upload

TypeScript Code

S3 client module:

import * as AWS from 'aws-sdk'

export const REGION = 'eu-west-1'

Untyped Scala vs Properly Typed Scala vs Dynamic Typing

The point of comparison here is a simple function that looks up a string key in a nested map/dictionary (JSON data from the payload/claims of a JWT token) and returns the given key if it's there and None/nil otherwise.

Scala (Without Proper Types)

Original function:

def verifyPartner(partner: String, payload: Map[String, java.lang.Object]): Either[String, String] = {
View user.ts
export class User {
id: string
country: string
email: string
name: string
tags: string[]
verified: boolean
active: boolean
locale: string
openIds: any
View tsconfig.json
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2015", "dom" ],
"noImplicitAny": true,
View vs-code-user-settings.json
"editor.fontSize": 14,
"editor.tabSize": 2,
"editor.detectIndentation": false,
"editor.insertSpaces": true,
"files.trimTrailingWhitespace": true,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,