Discussion on the use of validate(need()) vs if()validate()

I agree with both points of view here. I would add that shiny-specific functions like validate+need or req are not as explicit about the condition they're testing. With a if statement, you have to be very explicit about nulls, empty, length, etc whereas the shiny functions are convenience shortcuts - they're more compact but also less precise in my opinion.

1 Like