Editing /etc/hosts in emacs

Excerpt from ~/.emacs:

(defun hosts ()
"Open /etc/hosts as root."
(interactive)
(find-file "/sudo::/etc/hosts"))