As swap is recommended just in case all RAM is maxed it’s better to have a swap partition as swap files have certain limitations when in combined use with BTRFS:
"subvolume - cannot be snapshotted if it contains any active swapfiles"
has a chance to fragment
has issues with hibernation (that I’ve personally encountered multiple times)