Both are firmly on the good side of an industry with a lot of bad actors, and neither will trap you with a renewal price you didn't see coming.
Porkbun is the developer favourite, and the reasons are concrete rather than aesthetic: renewal prices among the lowest of the full-service registrars, WHOIS privacy free forever, SSL free, email forwarding included, URL forwarding included, and an API that takes ten minutes to learn. The company is small, the interface is fast, and there is no upsell funnel.
Namecheap is the larger operation. A bigger TLD catalogue, a reseller API with a proper sandbox environment, phone-adjacent support tiers, and a surrounding product line — hosting, VPNs, email, private email hosting — that some people want in one place. Its pricing is competitive but usually a little above Porkbun at renewal, and its interface carries more cross-sell than Porkbun's does.
For an individual developer or a small team registering domains for their own projects, Porkbun is the better default. Cheaper to hold, nothing to decline at checkout, and the API is pleasant.
For an agency, a reseller, or anyone registering domains at volume programmatically, Namecheap's API is the more serious tool — a sandbox you can test against, bulk operations, and reseller pricing tiers that Porkbun doesn't offer.
If you only ever want the lowest possible renewal on mainstream TLDs and you live on Cloudflare, note that Cloudflare Registrar undercuts both by selling at cost.