DEV Community

Discussion on: Have you ever worked with an engineer who never leveled up?

Collapse
 
kspeakman profile image
Kasey Speakman

Although probably a violation of the YAGNI principle, this is an entirely valid way to structure this code with an eye for future maintenance. Perhaps the dev who wrote this has done the refactor from return isSomethingTrue(); to this structure so many times -- to add logic to one or both branches -- that they now default to the latter. And they expect that in the average case it will save time.

I don't do this thing in particular, but I will sometimes opt to do longer-form ways of structuring things when they are more amenable to maintenance in the future.