It’s easy to type ufw allow 8080 and move on. Without a protocol, ufw opens that port for TCP and UDP both, which is often twice what you need.
Compare the two:
sudo ufw allow 8080
sudo ufw allow 8080/tcp
sudo ufw status
The first rule shows up as 8080 in the status, the second as 8080/tcp. The manual uses port 53 as its example: ufw allow 53 allows both TCP and UDP on port 53 to any address on the host. For DNS that is correct, since DNS really does use both. For a web app, a database or an admin panel it’s just an extra open port.
An open UDP port with nothing listening does little harm today. The problem comes later, when some service starts listening on that UDP port and is reachable right away because of a rule you forgot about.
I’d always write the protocol. To fix an existing rule, delete it and add the narrower one:
sudo ufw delete allow 8080
sudo ufw allow 8080/tcp
Application profiles have the same issue. ufw app info shows which protocols a profile opens, so look before you trust the name. And for services that really need both, like DNS, leaving it out is fine as long as you meant it.
Further reading: ufw(8) manual page