Matt Paddock No, this isn't example of clean code. It's antipattern. if(expression) { return true; } else { return false; } You second proposition is still the same antipattern. From my point of view, teaching antipatterns is wrong. Any live coding session will be a disaster for begginer with bad habits. Writing a code like this, during a job interview, is a red flag for me. Proper (clean) version of IsHappy function should look like this (2 is magic number and should be moved to const). public bool IsHappy(int levelOfHappiness, int maxHappiness) { return levelOfHappiness * 2 == maxHappiness; } Teaching SOLID principles is great (I know senior devs with problems with it), but do you really think, that refactoring lesson is good for absolute begginers? To refactor code one should know a little bit more about coding than pure basics.
