Remix.run Logo
benjiro 2 days ago

A ton of stuff in PHP is mostly templating + DB calls for a lot of websites.

If you combine Go + Templ for instance, your "if err" are mostly on the DB calls. What you needed to check in PHP anyway.

Yes, the if err != nil is extreme frustration when your doing for instance, type conversion. But if your already doing this with reflection in your DB calls (by casting to the correct types in your struct), that saves a ton.

Same with getting external data, casting it directly to structs and if something is wrong, its a single "if err".

And if your just doing PHP style programming in Go, well, _, ignoring errors like PHP does and you can panic/recover to make Go act as badly as PHP, to save on the "if err". ;-)