I'm also extremely curious why they think that if-else approach is somehow bad.So, I found the segment, and yes, this is valid and correct. There's nothing wrong with this code.
Usually when such objections are raised you end up looking at an "alternative" that's a clusterchuckle of self-references and recursions, because competent procedural programming is so last century /s