79819447

Date: 2025-11-13 21:22:18
Score: 2.5
Natty:
Report link

@Wery848 Said it best in my opinion. Assuming that the program is either in state A or B at all times, you can completely avoid having the first if statement and just check if state B is active after running DoSomething(); . This also would reinforce the idea that there would only be state A and B which is not abundantly clear (for those reading your code) in your method above. This is of course entirely dependent on that fact.

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @Wery848
  • Single line (0.5):
  • Looks like a comment (1):
  • Low reputation (0.5):
Posted by: Stavros Morrison