To the best of my knowledge, a swap partition needs to be the same size as physical RAM to allow for hibernation. If hibernation is not a needed feature, it can be smaller.
As far as using a swap file, there's no need to set it to a specific size. The file is dynamic so it will increase or decrease in size as needed.
I believe some of the reasons Ubuntu switched to using swap files was to A) maximize drive space by eliminating swap partitions, and B) preventing a system halt when a swap partition, which can not be dynamically adjusted, ran out of space.