News for hackers. Stuff that matters.
Re:Push ifs up and fors down by foota on Wednesday November 15, 2023 @05:55PM (#38283733)
I think the argument here could be stated sort of as push "type" ifs up, and "state" ifs down. If you're in rust you can do this more by representing state in the type (additionally helping to make incorrect states unrepresentable) and then storing your objects by type.

I have a feeling this guide is written for high performance, while it's true that premature optimization is the devil, I think following this sort of advice can prevent you from suffering a death from a thousand cuts.

There are no comments on this comment yet.