You know that mkdir can take multiple directories? If you run:
mcd dir1 dir2 dir3
That function will run: mkdir "dir1" "dir2" "dir3" cd "dir1" "dir2" "dir3"
(Surrounding $@ with double quotes, puts quotes around each item instead of quotes around the whole string: command "directory1/sub directory" "directory2"
$@ => directory1/sub directory directory2
"$@" => "directory1/sub directory" "directory2"
"$*" => "directory1/sub directory directory2"
)
Just run mcd foobar and you (try) to create the directory and enter it. IMO a nice shortcut.