Stop making swap partitions—use swap files instead
On Linux, swap files are generally easier to add, resize, and remove than dedicated swap partitions, and modern systems no longer impose the old performance penalty. The gist gives concrete mkswap --file, swapon, and /etc/fstab commands; util-linux 2.41 also sets nocow so the recipe works on Btrfs.
The HN discussion adds important caveats: zram or zswap may be preferable for some workloads, traditional swap remains useful for incompressible pages and hibernation, and filesystem/kernel details matter more than the article’s “always” framing.