Content pfp
Content
@
https://opensea.io/collection/dev-21
0 reply
0 recast
2 reactions

greg pfp
greg
@gregfromstl
Potentially hot take but early returns are horrible for readability and should be avoided https://x.com/t3dotgg/status/1799640178459656662?s=46
3 replies
0 recast
12 reactions

SonOfMosiah pfp
SonOfMosiah
@sonofmosiah.eth
I’m a big fan of early returns esp for js/ts
1 reply
0 recast
1 reaction

greg pfp
greg
@gregfromstl
Why?
1 reply
0 recast
1 reaction

SonOfMosiah pfp
SonOfMosiah
@sonofmosiah.eth
Mostly used to check for invalid/unwanted states. When this is done first you can separate that logic from your core logic and also get some type narrowing in most cases
1 reply
0 recast
0 reaction

greg pfp
greg
@gregfromstl
Unwanted or invalid states should throw errors though
1 reply
0 recast
1 reaction