DIR=$(dirname $(readlink -f $0))
However OS X doesn't have readlink, so the longer BASH_SOURCE thing makes sense there.I started using the longer one, and then I gave up on shell scripting on OS X for other reasons, and didn't go back. So yeah there is a lot of random cargo culting.
In Oil I hope to provide an even simpler method that's built in (and it also has readlink builtin to support this)