Show/Hide hidden files without restarting finder? I came to understand that the following is the way to toggle the visibility of hidden files:

defaults write com.apple.finder AppleShowAllFiles YES
# replace YES with NO to hide hidden files
killall -HUP Finder /System/Library/CoreServices/Finder.app


Is there a way to show/hide hidden files without killing the Finder?
On macOS Sierra, version 10.12.4 and above, you can press ⌘+Shift+. (period), to toggle hidden files inside of Finder.

Late edit: This currently works on Mojave too, as of b5, 18 Aug 2018.