In zsh, which
behaves reasonably, so you can simply do
if which thing > /dev/null 2>&1; then
echo installed
fi
or
which thing > dev/null 2>&1 && echo installed
Note that which is a shell builtin, and its behavior is not reasonable in all shells, so this behavior cannot be relied upon.