Which ever route is the easiest to read(usually it's the second one) is the one I pick. Less code is more.
I've worked with both a lot, and I find the second one is often better for my cognitive load. If you need if/else/elseif perhaps to many things are going on at once.
It depends on what kind of logic is needed, and which one reduces the amount of code and improves the readability.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.