This works in sh, bash, zsh, etc:
mkdircd() { mkdir -p "$1" && cd "$1" } mkdircd /tmp/new/directory/at/arbitrary/depth